/* ==========================================================================
   Site layout — the page-level styles for the CV and Projects pages.
   The look (colors, type, components) comes from styles.css, the Industry
   design system. Nothing here redefines a token; it only lays pages out.
   ========================================================================== */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body { margin: 0; }
a:hover { color: var(--color-accent-700); }

.page {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* The 1120px measure every band sits inside. */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.section { padding-bottom: 96px; }

/* — nav ------------------------------------------------------------------ */

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-divider);
}
.site-nav .nav-brand {
  margin-right: auto;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
}
.site-nav .nav-brand .slash { color: var(--color-accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.nav-cta { margin-left: 8px; }

/* — hero ----------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 56px;
  align-items: start;
  padding-top: 72px;
  padding-bottom: 56px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hero-eyebrow h6 { margin: 0; color: var(--color-accent-700); }
.rule-short {
  flex: 1;
  height: 1px;
  background: var(--color-divider);
  max-width: 120px;
}
.hero-name {
  font-size: clamp(44px, 9.4vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  text-transform: uppercase;
}
.hero-lede {
  font-size: 19px;
  line-height: 1.5;
  max-width: 46ch;
  margin: 0 0 24px;
  text-wrap: pretty;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* — stats band ----------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.stat {
  padding: 24px 20px;
  border-right: 1px solid var(--color-divider);
}
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; border-right: 0; }
.stat-value {
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1;
}
.stat-value .unit { font-size: 22px; }
.stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* — section headers ------------------------------------------------------ */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.rule-fill {
  flex: 1;
  min-width: 40px;
  height: 1px;
  background: var(--color-divider);
}
.section-num {
  font-size: 12px;
  letter-spacing: 0.08em;
}
.section-link {
  font-size: 14px;
  font-family: var(--font-heading);
  text-decoration: none;
}

/* — experience ----------------------------------------------------------- */

.xp-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--color-divider);
}
.xp-row:last-child { border-bottom: 1px solid var(--color-divider); }
.xp-period {
  font-family: var(--font-heading);
  font-size: 20px;
}
.xp-kind {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.xp-role { margin: 0 0 4px; }
.xp-org {
  color: var(--color-accent-700);
  font-size: 14px;
}
.xp-notes { font-size: 14px; }
.xp-notes p { margin: 0 0 8px; }
.xp-notes p:last-child { margin-bottom: 0; }

/* — project card grid ---------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card-grid .card { padding: 24px; }
.card-grid .card-title { font-size: 21px; }
.card-grid .card-body { font-size: 14px; }
a.card {
  color: inherit;
  text-decoration: none;
}
a.card:hover { border-color: var(--color-accent); }
a.card:hover .card-title { color: var(--color-accent-700); }

/* — stack ---------------------------------------------------------------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.stack-grid h6 {
  color: var(--color-accent-700);
  margin-bottom: 14px;
}
.stack-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

/* — talks table ---------------------------------------------------------- */

.talks .year {
  width: 90px;
  font-family: var(--font-heading);
  font-size: 16px;
}
.talks .venue { width: 200px; }

/* — dark fields (contact, closing CTA) ----------------------------------- */

.field-dark {
  background: var(--color-accent-900);
  color: var(--color-bg);
}
.field-dark h6 { color: var(--color-accent-300); }
.contact { margin-top: 24px; }
.contact .wrap {
  padding-top: 88px;
  padding-bottom: 88px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
.contact-heading {
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1;
  margin: 0 0 20px;
  text-transform: uppercase;
}
.contact-lede {
  max-width: 44ch;
  margin: 0;
  opacity: 0.8;
}
.contact-links {
  display: grid;
  gap: 14px;
  font-size: 15px;
}
.contact-links a {
  color: var(--color-bg);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 242, 243, 0.3);
  padding-bottom: 8px;
  word-break: break-word;
}
.contact-links a:hover { border-bottom-color: var(--color-bg); }
.contact-links .btn {
  margin-top: 12px;
  justify-self: start;
  border-bottom-width: 1px;
}
.contact-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid rgba(242, 242, 243, 0.2);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.contact-foot .right { margin-left: auto; }
.btn-on-dark {
  color: var(--color-bg);
  border-color: rgba(242, 242, 243, 0.4);
}
.btn-on-dark:hover { background: rgba(242, 242, 243, 0.12); }

/* — projects page -------------------------------------------------------- */

.proj-header {
  padding-top: 64px;
  padding-bottom: 48px;
}
.proj-header h6 {
  color: var(--color-accent-700);
  margin-bottom: 18px;
}
.proj-header-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: end;
}
.proj-title-big {
  font-size: clamp(40px, 8.4vw, 80px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
}
.proj-intro {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 8px;
  text-wrap: pretty;
}

.proj-index {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.proj-index a {
  padding: 18px 12px;
  border-right: 1px solid var(--color-divider);
  font-family: var(--font-heading);
  font-size: 15px;
  text-decoration: none;
  color: inherit;
}
.proj-index a:first-child { padding-left: 0; }
.proj-index a:last-child { padding-right: 0; border-right: 0; }
.proj-index .num {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.proj {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding-bottom: 88px;
  scroll-margin-top: 24px;
}
.proj-num {
  font-family: var(--font-heading);
  font-size: 46px;
  line-height: 1;
  color: var(--color-accent);
}
.proj-kind {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 10px;
}
.proj-meta {
  margin-top: 24px;
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.proj-meta .label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.proj-name {
  margin: 0 0 8px;
  font-size: clamp(28px, 4.6vw, 38px);
  text-transform: uppercase;
}
.proj-lede {
  font-size: 18px;
  max-width: 52ch;
  margin: 0 0 28px;
}
.pao {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 1px solid var(--color-divider);
  padding-top: 24px;
}
.pao h6 {
  color: var(--color-accent-700);
  margin-bottom: 10px;
}
.pao p {
  font-size: 14px;
  margin: 0;
}
.proj .btn-row { margin-top: 28px; }

.cta .wrap {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  align-items: end;
  gap: 48px;
  flex-wrap: wrap;
}
.cta h6 { margin-bottom: 16px; }
.cta h2 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}
.cta .btn-row { margin-left: auto; }

/* ==========================================================================
   Responsive — the prototypes were drawn at desktop width only; this is the
   breakdown the handoff recommends.
   ========================================================================== */

@media (max-width: 1180px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 48px;
  }
  .hero-portrait {
    max-width: 340px;
    aspect-ratio: 4 / 5;
  }
  .proj-header-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
  }
  .contact .wrap { padding-top: 64px; padding-bottom: 64px; }
  .contact-foot { margin-top: 48px; }
  .cta .btn-row { margin-left: 0; }
}

@media (max-width: 860px) {
  .section { padding-bottom: 72px; }
  .xp-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .stack-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .proj {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 64px;
  }
  .proj-meta {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 16px;
  }
  .pao { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--color-divider); }
  .stat:nth-child(2n) { padding-right: 0; border-right: 0; }
  .stat:nth-child(2n + 1) { padding-left: 0; }
  .stat:nth-last-child(-n + 2) { border-bottom: 0; }
  .proj-index { grid-template-columns: repeat(3, 1fr); }
  .proj-index a:nth-child(3n) { border-right: 0; padding-right: 0; }
  .proj-index a:nth-child(3n + 1) { padding-left: 0; }
  .proj-index a:nth-child(-n + 3) { border-bottom: 1px solid var(--color-divider); }
}

@media (max-width: 700px) {
  /* Stack each talk as year → title → venue instead of three columns. */
  .talks table, .talks tbody, .talks tr, .talks td { display: block; width: auto; }
  .talks tr {
    padding: 14px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
  }
  .talks td { border: 0; padding: 0; }
  .talks .year { width: auto; }
  .talks .venue { width: auto; margin-top: 2px; font-size: 13px; }
}

@media (max-width: 620px) {
  .site-nav {
    flex-wrap: wrap;
    gap: 16px;
    row-gap: 14px;
  }
  .site-nav .nav-brand { margin-right: 0; width: 100%; }
  .nav-links { gap: 18px; }
  .nav-cta { margin-left: 0; }
  .card-grid { grid-template-columns: 1fr; gap: 20px; }
  .stack-grid { grid-template-columns: 1fr; gap: 28px; }
  .proj-index { grid-template-columns: repeat(2, 1fr); }
  .proj-index a:nth-child(n) {
    border-right: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
    padding-left: 12px;
    padding-right: 12px;
  }
  .proj-index a:nth-child(2n) { border-right: 0; padding-right: 0; }
  .proj-index a:nth-child(2n + 1) { padding-left: 0; }
  .proj-index a:nth-last-child(-n + 2) { border-bottom: 0; }
  .proj-meta { grid-template-columns: 1fr; gap: 8px; }
  .hero-lede { font-size: 17px; }
  .btn-row .btn { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .stat {
    padding-left: 0;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-divider);
  }
  .stat:last-child { border-bottom: 0; }
}

/* — print: the CV page should print cleanly ------------------------------ */

@media print {
  .site-nav, .cta, .btn { display: none; }
  .page, .field-dark { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .section { padding-bottom: 24px; }
}
