/* Thyropeutics v2: full-frame, one idea per screen */
@font-face { font-family: "DM Sans"; src: url("assets/fonts/DMSans_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/fonts/DMSans_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0F2B36; --ink-deep: #0A1E26; --teal: #0E7C91; --bright: #4BB8CF; --pale: #8ED8E0; --amber: #F2AE4A;
  --text: #FFFFFF; --soft: #C3D3D8; --mute: #8FA6AE;
  --gut: clamp(20px, 5vw, 80px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--ink-deep); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--ink-deep); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.02em; }
em { font-style: normal; color: var(--pale); }

/* Header: floats over full-bleed screens */
.hdr { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 22px var(--gut); pointer-events: none; transition: background .4s, padding .4s; }
.hdr > * { pointer-events: auto; }
.hdr.solid { background: rgba(10, 30, 38, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-top: 14px; padding-bottom: 14px; }
.hdr nav { display: flex; gap: 30px; align-items: center; font-size: 14px; }
.hdr nav a { text-decoration: none; color: var(--soft); transition: color .2s; }
.hdr nav a:hover { color: #fff; }
.hdr .pill { color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 9px 18px; border-radius: 999px; }
.hdr .pill:hover { background: #fff; color: var(--ink); }

/* Screens */
.screen { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--bright); margin-bottom: 22px; }
.display { font-size: clamp(44px, 6.4vw, 104px); line-height: 1.0; letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 4.2vw, 64px); line-height: 1.05; }
.lede { font-size: clamp(18px, 1.5vw, 23px); line-height: 1.45; color: var(--soft); max-width: 34ch; margin-top: 28px; }
.note { font-size: 15px; line-height: 1.5; color: var(--mute); max-width: 52ch; margin-top: 26px; }
.src { position: absolute; left: var(--gut); right: calc(var(--gut) + 210px); bottom: 18px; font-size: 10.5px; line-height: 1.45; color: rgba(195, 211, 216, .5); max-width: 150ch; }
.num { font-size: clamp(40px, 4.4vw, 72px); line-height: 1; letter-spacing: -0.04em; color: #fff; }
.pre { font-size: 14px; color: var(--soft); margin-bottom: 4px; }
.center { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 0 var(--gut); text-align: center; }

/* Photos */
figure { margin: 0; }
.kb { overflow: hidden; }
.kb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 2.6s var(--ease); }
.kb.in img { transform: scale(1); }

/* 1. Landing */
.hero { display: flex; align-items: flex-end; background: var(--ink-deep); }
.hero-photo { position: absolute; top: 0; right: 0; bottom: 0; width: 64%; }
.hero-photo img { object-position: 50% 28%; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink-deep) 0%, rgba(10,30,38,.6) 28%, rgba(10,30,38,0) 60%), linear-gradient(0deg, rgba(10,30,38,.7) 0%, rgba(10,30,38,0) 35%); }
.hero-copy { position: relative; z-index: 2; padding: 0 var(--gut) clamp(56px, 10vh, 110px); max-width: 900px; }
.hero .lede { max-width: 40ch; margin-top: 30px; }
.hero .lede b { font-weight: 700; color: #fff; }
.hero-photo { background: var(--ink-deep); }
.hero-photo img { mix-blend-mode: luminosity; }
.hero h1 { font-size: clamp(52px, 7.2vw, 120px); line-height: .96; letter-spacing: -0.045em; max-width: 9ch; }
.notice { margin-top: 26px; max-width: 46ch; font-size: 13px; line-height: 1.55; color: var(--mute); }
.notice strong { color: var(--soft); font-weight: 400; }

/* Full-bleed statement screens (mission, consensus) */
.mission, .consensus { display: grid; place-items: center; }
.bleed { position: absolute; inset: 0; }
.bleed img { object-position: 50% 60%; }
.bleed::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(10,30,38,.78) 0%, rgba(10,30,38,.9) 60%, rgba(10,30,38,.97) 100%); }
.big { font-size: clamp(30px, 4.3vw, 68px); line-height: 1.16; letter-spacing: -0.03em; max-width: 25.5ch; margin: 0 auto; text-wrap: balance; }
.consensus { background: radial-gradient(ellipse at 50% 120%, rgba(14,124,145,.45) 0%, rgba(14,124,145,0) 60%), var(--ink-deep); }
.consensus .big { max-width: 26ch; }
.assoc { margin: 0 auto 40px; width: 84px; height: auto; border-radius: 50%; }
.after { margin-top: 38px; font-size: clamp(18px, 1.6vw, 24px); color: var(--amber); }

/* Word-by-word fill */
.fill .w { color: rgba(255,255,255,.16); transition: color .5s ease; }
.fill em .w { color: rgba(142,216,224,.16); }
.fill.in .w { color: #fff; }
.fill.in em .w { color: var(--pale); }
html:not(.js) .fill .w { color: inherit; }

/* Split: big photo one side, copy the other */
.split { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink-deep); }
.side-photo { position: relative; min-height: 100%; }
.side-photo img { position: absolute; inset: 0; }
.photo-left .side-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,30,38,0) 60%, var(--ink-deep) 100%); }
.photo-right .side-photo { order: 2; }
.photo-right .side-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(10,30,38,0) 60%, var(--ink-deep) 100%); }
.side-copy { display: flex; flex-direction: column; justify-content: center; padding: 120px var(--gut) 110px; position: relative; }
.side-copy .src { position: static; margin-top: 34px; }
#problem .side-photo img { object-position: 50% 30%; }
/* Problem: the copy side takes 57% so lines run long and type can be bigger (Jack: use the horizontal space, larger type) */
#problem { grid-template-columns: 43fr 57fr; }
#problem .side-copy { padding: 74px 40px 22px 56px; }
#problem .display { font-size: clamp(40px, 3.95vw, 66px); }
/* One spacing value S for both gaps (heading to numbers, numbers block to the T3 block), growing with screen size */
#problem { --s: clamp(22px, 2.3vw, 44px); }
#problem .lede { margin-top: 16px; font-size: clamp(17px, 1.55vw, 22px); max-width: none; }
.prob { margin-top: 20px; }
.prob + .prob { margin-top: var(--s); }
.prob h3 { font-size: clamp(20px, 1.8vw, 27px); color: var(--pale); }
#problem .figs { margin-top: var(--s); grid-template-columns: 1.15fr 1fr 1fr; gap: 18px; max-width: none; }
#problem .figs .num { font-size: clamp(34px, 3.4vw, 54px); }
#problem .figs p:not(.num):not(.pre) { font-size: clamp(14px, 1.18vw, 16px); }
#problem .note { margin-top: 12px; font-size: 14px; max-width: none; }
.pt { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; color: var(--soft); max-width: none; margin-top: 10px; }
#problem .src { margin-top: 16px; max-width: none; }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; max-width: 640px; }
.figs p:not(.num):not(.pre) { font-size: 14px; line-height: 1.45; color: var(--soft); margin-top: 12px; }

/* Charts */
.chart { width: 100%; height: auto; overflow: visible; font-family: "DM Sans", sans-serif; }
.chart .grid line { stroke: rgba(255,255,255,.08); }
.chart .floor { stroke: rgba(255,255,255,.35); stroke-width: 1.5; }
.chart .ax text { font-size: 12px; fill: #8FA6AE; }
.chart .lbl text { font-size: 15px; font-weight: 700; }
.js .chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .chart .area, .js .chart .lbl { opacity: 0; transition: opacity .9s ease 1.4s; }
.chart.in .ln { stroke-dashoffset: 0; transition: stroke-dashoffset 2s var(--ease) .2s; }
.chart.in .ln2 { transition-delay: .7s; }
.chart.in .area, .chart.in .lbl { opacity: 1; }
/* Meet PZL: chart + numbers left, molecule + patent right; columns share top and bottom edges */
.pzl2 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; column-gap: clamp(32px, 8vw, 120px); row-gap: 20px; align-content: center; padding: 86px var(--gut) 78px; background: radial-gradient(ellipse at 78% 50%, rgba(14,124,145,.24) 0%, rgba(14,124,145,0) 55%), linear-gradient(180deg, var(--ink-deep), var(--ink)); }
.pzl2 > * { min-width: 0; }
.pz-head { grid-column: 1 / -1; }
.pz-head h2 { font-size: clamp(34px, 3.6vw, 58px); }
/* Intro reads as a statement, not a slide subtitle: full width, larger, airy */
.pz-lede { max-width: none; margin-top: 18px; font-size: clamp(18px, 2vw, 30px); line-height: 1.32; letter-spacing: -0.01em; color: var(--soft); }
/* Image box is 1.5x the screen width so the climber (55% across the photo) lands at about 82% of the screen, clear of the text */
.consensus .bleed img { width: 150%; max-width: none; object-position: 50% 55%; }
/* Numbers spread evenly across the plot width (x 64 to 620 of 640) */
/* Left column: chart at the top, numbers pinned to the bottom so their last line ends level with the right column's last line */
.pz-left { display: flex; flex-direction: column; justify-content: space-between; }
.pz-figs { margin-top: 12px; max-width: none; gap: 20px; padding: 0 3.125% 0 10%; }
/* Three equal columns over the plot (x 0 to 24): centres fall at hours 4, 12 and 20, so 6 h sits under 12 */
.pz-figs > div { text-align: center; }
.pz-figs .num { font-size: clamp(38px, 4.2vw, 64px); font-weight: 700; letter-spacing: -0.03em; }
.pz-figs p:not(.num) { margin-top: 8px !important; max-width: 17ch; margin-left: auto; margin-right: auto; }
/* Facts start level with the 300 gridline: 53.2/640 of the column width (both columns are equal) */
.pz-right { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding-top: 8.3125%; }
/* Centre the first line of fact 01 on the 300 gridline (line-height 1.4, so pull up by 0.7 of the font size) */
.pz-right .facts { gap: 9px; margin-top: calc(-0.7 * clamp(18px, 1.65vw, 24px)); }
.pz-right .facts p { font-size: clamp(18px, 1.65vw, 24px); line-height: 1.4; }
.pz-right .facts span { font-size: 13px; min-width: 24px; }
.pz-right .pt { font-size: clamp(15px, 1.2vw, 17px); max-width: none; margin: 0; }
.chart-cap { display: none; }

/* Market: four tall faces */
.market { display: flex; flex-direction: column; padding: 110px var(--gut) 76px; background: var(--ink-deep); }
.mk-head h2 { max-width: 32ch; }
.faces { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; min-height: 420px; }
.face { position: relative; overflow: hidden; border-radius: 4px; }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform 1.2s var(--ease); }
.face:hover img { transform: scale(1.04); }
.face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,30,38,.95) 0%, rgba(10,30,38,.55) 38%, rgba(10,30,38,0) 62%); }
.face figcaption { position: absolute; z-index: 1; left: 22px; right: 22px; top: 60%; font-size: 14.5px; line-height: 1.4; color: var(--soft); }
.face .num { display: block; margin-bottom: 10px; }

/* Molecule and patent facts */
.molecule img { width: 100%; height: auto; }
.molecule figcaption { margin-top: 10px; font-size: 12px; color: var(--mute); }
.facts { display: grid; gap: 12px; }
.facts div { display: flex; gap: 16px; align-items: baseline; }
.facts span { font-size: 12px; letter-spacing: .15em; color: var(--bright); }
.facts p { font-size: clamp(15px, 1.25vw, 18px); line-height: 1.4; }
.facts b { font-weight: 400; }
/* Team */
.team { padding: 110px var(--gut) 60px; background: linear-gradient(180deg, var(--ink-deep), var(--ink)); display: flex; flex-direction: column; justify-content: center; }
/* Team: one row of six equal columns (even face spacing). Names and roles stay on one line and may run a little
   wider than their column; the column pitch keeps neighbours apart. Rows are a subgrid, so everything lines up across. */
.tm-head { text-align: center; }
.tm-head .lede { margin-left: auto; margin-right: auto; max-width: none; }
.people { display: grid; grid-template-columns: repeat(6, clamp(170px, 13.2vw, 205px)); justify-content: center; column-gap: 28px; row-gap: 0; margin-top: 48px; text-align: center; }
.person { display: grid; grid-row: span 4; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; min-width: 0; }
.person h3, .person .role { width: max-content; justify-self: center; }
.person img { width: 100%; height: auto; max-width: 150px; aspect-ratio: 1; border-radius: 50%; filter: grayscale(1) contrast(1.05); margin-bottom: 18px; }
.person h3 { font-size: clamp(16px, 1.25vw, 18px); letter-spacing: -0.01em; white-space: nowrap; }
.person .role { font-size: clamp(11px, .86vw, 12.5px); letter-spacing: .03em; text-transform: uppercase; color: var(--bright); margin-top: 8px; white-space: nowrap; }
.person .cred { font-size: 14px; line-height: 1.45; color: var(--soft); margin-top: 10px; width: 0; min-width: 100%; }
/* Contact */
.contact .display { font-size: clamp(40px, 4.6vw, 76px); max-width: 13ch; }
.who { margin-top: 32px; font-size: 20px; line-height: 1.6; color: var(--soft); }
.who a { color: var(--pale); text-decoration: none; border-bottom: 1px solid rgba(142,216,224,.4); }
.who a:hover { border-color: var(--pale); }
.todo { color: var(--amber); }
.contact footer { margin-top: 56px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.12); }
.contact footer img { margin-bottom: 16px; opacity: .9; }
.contact footer p { font-size: 11px; line-height: 1.55; color: var(--mute); max-width: 70ch; margin-top: 8px; }
#contact .side-photo img { object-position: 50% 30%; }

/* Reveal */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* Pager (same behaviour as v1) */
.pager { position: fixed; right: var(--gut); bottom: 26px; z-index: 30; display: flex; gap: 10px; opacity: 0; transition: opacity .4s; }
.pager.show { opacity: 1; }
.pager button { display: grid; grid-auto-flow: column; align-items: center; gap: 8px; height: 48px; min-width: 48px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: rgba(10,30,38,.6); color: #fff; font: inherit; font-size: 14px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .2s, color .2s; }
.pager button:hover { background: #fff; color: var(--ink); }
#pg-down { padding: 0 16px 0 20px; }

/* Six across needs about 1,120px of content width; below that, three across */
@media (max-width: 1240px) {
  .people { grid-template-columns: repeat(3, 1fr); justify-content: stretch; }
  .person h3, .person .role { white-space: normal; width: auto; }
  .person .cred { margin-bottom: 40px; }
}

/* Tablet */
@media (max-width: 1100px) {
  .hdr nav a:not(.pill) { display: none; }
  .people { grid-template-columns: repeat(3, 1fr); row-gap: 0; justify-content: stretch; }
  .person .cred { margin-bottom: 40px; }
  .person h3, .person .role { white-space: normal; }
  .person img { max-width: 150px; }
}

/* Phone */
@media (max-width: 760px) {
  .hdr { padding: 16px 20px; }
  .hdr .logo img { width: 128px; height: auto; }
  .screen { min-height: 0; }
  .src { position: static; margin-top: 28px; font-size: 10px; right: auto; }
  .hero { min-height: 100svh; }
  .hero-photo { width: 100%; }
  .hero-photo::after { background: linear-gradient(0deg, var(--ink-deep) 8%, rgba(10,30,38,.55) 45%, rgba(10,30,38,.1) 75%); }
  .hero-copy { padding: 0 20px 96px; }
  .mission, .consensus { min-height: 100svh; padding: 100px 0 40px; align-content: center; }
  .mission .src, .consensus .src { padding: 0 20px; }
  .split { grid-template-columns: 1fr; }
  .side-photo { height: 58svh; }
  .photo-right .side-photo { order: 0; }
  .photo-left .side-photo::after, .photo-right .side-photo::after { background: linear-gradient(0deg, var(--ink-deep) 0%, rgba(10,30,38,0) 45%); }
  .side-copy { padding: 0 20px 96px; margin-top: -40px; }
  .figs { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
  .figs .num { font-size: 34px; }
  .figs p:not(.num):not(.pre) { font-size: 12.5px; }
  .pzl2 { grid-template-columns: 1fr; padding: 96px 20px 96px; }
  .pz-figs { grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 0; }
  .pz-left { display: block; }
  .pz-right { padding-top: 0; }
  .pz-right .facts { margin-top: 0; }
  /* Phone: keep atom labels readable (about 13px) by letting the structure scroll sideways */
  .molecule { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
  .molecule img { width: 520px; max-width: none; }
  .molecule figcaption::after { content: " Swipe to see the full structure."; }
  .pz-figs .num { font-size: 30px; }
  .pz-figs p:not(.num) { font-size: 12.5px; }
  .chart .ax text { font-size: 22px; }
  .chart .ax .axt { display: none; }
  .chart .lbl text { font-size: 23px; }
  .chart-cap { display: block; margin-top: 6px; font-size: 12px; color: var(--mute); text-align: center; }
  .market { padding: 96px 20px 96px; }
  .faces { grid-template-columns: 1fr 1fr; gap: 10px; }
  .face { aspect-ratio: 3 / 4.4; }
  .face figcaption { left: 12px; right: 12px; top: 46%; font-size: 12px; }
  .face .num { font-size: 30px; margin-bottom: 6px; }
  .team { padding: 96px 20px 96px; }
  .people { grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 0; }
  .person .cred { margin-bottom: 32px; }
  .person img { max-width: 130px; }
  .person h3 { font-size: 15px; }
  .person .cred { font-size: 13px; }
  .pager { right: 16px; bottom: 16px; }
  .pager button { height: 44px; min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .rv, .kb img, .fill .w { transition: none !important; transform: none !important; opacity: 1 !important; }
  .fill .w { color: inherit !important; }
  .js .chart .ln { stroke-dashoffset: 0; }
  .js .chart .area, .js .chart .lbl { opacity: 1; transition: none; }
}

