/* ==========================================================================
   Ziaan Lalani — personal site
   Design tokens, shared shell, and per-section styles.
   ========================================================================== */

:root {
  --ink: #12161f;
  --ink-soft: #4b5160;
  --paper: #eef0ea;
  --paper-soft: #e2e5dc;
  --pitch: #1f6f4a;
  --pitch-dim: #17543896;
  --brass: #a9834f;
  --line: rgba(18, 22, 31, 0.12);
  --surface: #ffffff;

  --font-display: 'Fraunces', 'Iowan Old Style', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-w: 46rem;
  --max-w-wide: 64rem;
  --gutter: 1.5rem;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --ink: #eef0ea;
  --ink-soft: #b8bcc8;
  --paper: #12161f;
  --paper-soft: #1b2130;
  --pitch: #3fa072;
  --pitch-dim: #3fa07255;
  --brass: #cda978;
  --line: rgba(238, 240, 234, 0.14);
  --surface: #171c27;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }

::selection { background: var(--pitch); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--pitch);
  outline-offset: 3px;
}

/* ---------- Type scale ---------- */
.display-1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 5vw + 1rem, 4.5rem); line-height: 1.04; letter-spacing: -0.01em; }
.display-2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 2.5vw + 1rem, 2.6rem); line-height: 1.1; }
.display-3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 1.2vw + 1rem, 1.75rem); line-height: 1.2; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 38rem; }
.body-text { max-width: 38rem; color: var(--ink-soft); }
.body-text + .body-text { margin-top: 1rem; }
.eyebrow { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--pitch); }

/* ---------- Layout shell ---------- */
.wrap { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 var(--gutter); }
.col { max-width: var(--max-w); }

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--pitch);
  z-index: 60;
  transition: width 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.site-header__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-nav__links {
  display: flex;
  gap: 1.75rem;
}
.site-nav__links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current='page'] {
  color: var(--ink);
  border-color: var(--pitch);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.icon-btn:hover { background: var(--paper-soft); }
.icon-btn .icon-moon { display: block; }
.icon-btn .icon-sun { display: none; }
:root[data-theme='dark'] .icon-btn .icon-moon { display: none; }
:root[data-theme='dark'] .icon-btn .icon-sun { display: block; }

.menu-toggle { display: none; }

.mobile-menu {
  display: none;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.mobile-menu.is-open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.85rem var(--gutter);
  text-decoration: none;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.mobile-menu a[aria-current='page'] { color: var(--pitch); }

@media (max-width: 760px) {
  .site-nav__links { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }
}

/* ---------- Sections ---------- */
section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  section { padding: 3rem 0; }
}

.section-head { margin-bottom: 2.5rem; }
.section-head .display-2 { margin-bottom: 0.65rem; }

/* ---------- Hero (Home) ---------- */
.hero { padding-top: 4rem; }
.hero__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.25rem;
  align-items: start;
}
.hero__portrait {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-soft);
}
.hero__portrait--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.5rem;
}
.hero__role {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}
@media (max-width: 600px) {
  .hero__row { grid-template-columns: 1fr; }
  .hero__portrait { width: 84px; height: 84px; }
}

.ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 2.25rem 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ledger__item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}
.ledger__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--brass);
}
.ledger__label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.tag {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: var(--pitch);
  color: #fff;
  border: 1px solid var(--pitch);
}
.btn--primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--pitch) 85%, black); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--pitch); color: var(--pitch); }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn--primary:hover, .btn--ghost:hover { transform: none; }
}

/* ---------- Timeline (Academics) ---------- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0.4rem; bottom: 0.4rem;
  width: 1px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding-bottom: 2.75rem;
  opacity: 0.45;
  transition: opacity 0.4s ease;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.timeline-item.is-active {
  opacity: 1;
}
.timeline-item.is-active::before {
  background: var(--pitch);
  box-shadow: 0 0 0 4px var(--pitch-dim);
}
@media (prefers-reduced-motion: reduce) {
  .timeline-item { transition: none; opacity: 1; }
  .timeline-item::before { transition: none; }
}
.timeline-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.timeline-item__stage { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.timeline-item__period { font-size: 0.85rem; color: var(--ink-soft); }
.timeline-item__score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.25rem;
  color: var(--brass);
  margin: 0.4rem 0 0.75rem;
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-width: 34rem;
}
.subject {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 0.6rem;
}
.subject-group__label {
  font-size: 0.8rem;
  text-transform: none;
  color: var(--ink-soft);
  margin: 1rem 0 0.4rem;
}

/* ---------- Skills ---------- */
.skill-groups {
  display: grid;
  gap: 2.5rem;
}
.skill-group__title { margin-bottom: 1rem; }
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.skill-pill {
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.45rem 0.9rem;
  color: var(--ink);
}
.skill-pill--placeholder {
  border-style: dashed;
  color: var(--ink-soft);
  font-style: italic;
}
.soft-skill {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}
.soft-skill:first-child { border-top: none; padding-top: 0; }
.soft-skill__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.35rem; }

/* ---------- Projects ---------- */
.project {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}
.project:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; gap: 0.75rem; }
}
.project__meta { color: var(--ink-soft); font-size: 0.9rem; }
.project__name { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: 0.5rem; }
.project__links { margin-top: 1rem; display: flex; gap: 1.25rem; }
.project__links a { font-size: 0.9rem; color: var(--pitch); text-decoration: underline; text-underline-offset: 3px; }
.project--placeholder {
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- Contact ---------- */
.contact-list { display: grid; gap: 1.5rem; max-width: 26rem; margin-top: 2rem; }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.contact-row__label { color: var(--ink-soft); font-size: 0.9rem; }
.contact-row__value { font-size: 1rem; }
.contact-row__value a { text-decoration: underline; text-underline-offset: 3px; }
.placeholder-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.site-footer__name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin-bottom: 0.4rem; }
.site-footer__tagline { color: var(--ink-soft); font-size: 0.9rem; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer nav a:hover { color: var(--pitch); }
.site-footer__meta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
}
