/* ---------- Paper grain ---------- */
.grain { position: fixed; inset: 0; z-index: 230; pointer-events: none; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Hero additions ---------- */
.status { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; transition: box-shadow .3s, background-color .3s; }
.status:hover { box-shadow: inset 0 0 0 1px var(--brick); background: rgba(168, 70, 42, .06); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3E9B5F; box-shadow: 0 0 0 0 rgba(62, 155, 95, .5); animation: ping-green 2s infinite; flex: none; }
@keyframes ping-green { 70% { box-shadow: 0 0 0 9px rgba(62, 155, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 155, 95, 0); } }
.hero__cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero__cta .link { color: var(--ink); }

/* ---------- Timeline wrapper ---------- */
.tl-head { padding-bottom: clamp(40px, 6vw, 80px); }
.tl-head__title { max-width: 16ch; }
.tl-head__lede { margin-top: 24px; max-width: 560px; color: var(--ink-2); font-size: 18px; }
.tl-end { text-align: center; display: grid; justify-items: center; gap: 18px; border-top: 1px solid var(--line); }
.tl-end .mono { color: var(--ink-3); }
.tl-end__line { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 6vw, 92px); line-height: 1; letter-spacing: -.03em; }

/* Fixed chapter rail */
.rail { position: fixed; right: clamp(12px, 1.6vw, 26px); top: 50%; z-index: 70; transform: translateY(-50%); display: flex; flex-direction: column; gap: 16px; padding: 6px 14px 6px 0; color: #fff; mix-blend-mode: difference; opacity: 0; pointer-events: none; transition: opacity .5s; }
.rail.is-on { opacity: 1; pointer-events: auto; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .5; transition: opacity .3s; }
.rail a::after { content: ""; width: 12px; height: 1px; background: currentColor; transition: width .5s var(--out); }
.rail a:hover, .rail a.is-active { opacity: 1; }
.rail a.is-active::after { width: 30px; }
.rail__line { position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .25); }
.rail__line i { position: absolute; inset: 0; background: #fff; transform-origin: top; transform: scaleY(0); }

/* ---------- Chapters ---------- */
.ch { position: relative; padding: clamp(96px, 11vw, 160px) var(--gutter); }
.ch + .ch:not(.is-dark) { border-top: 1px solid var(--line); }
.ch__years { font-family: var(--serif); font-weight: 300; font-variation-settings: "opsz" 144; font-size: clamp(84px, 15vw, 250px); line-height: .84; letter-spacing: -.045em; margin: 0 0 clamp(28px, 4vw, 52px) -.05em; white-space: nowrap; }
.ch__years span { --fill: var(--ink); color: transparent; -webkit-text-stroke: 1px var(--line-2); background: linear-gradient(90deg, var(--fill) 0 50%, transparent 50% 100%); background-size: 200% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; }
.is-dark .ch__years span { --fill: var(--on-night); -webkit-text-stroke-color: var(--on-night-3); }
.reduced .ch__years span, .no-gsap .ch__years span { background-position: 0 0; }
.ch__info { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px clamp(28px, 6vw, 96px); align-items: end; }
.ch__kicker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-3); }
.ch__kicker span:first-child { color: var(--brick); }
.ch__title { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 3.6vw, 56px); line-height: 1.04; letter-spacing: -.025em; max-width: 18ch; }
.ch__summary { color: var(--ink-2); font-size: 18px; max-width: 520px; }
.is-dark .ch__kicker { color: var(--on-night-3); }
.is-dark .ch__kicker span:first-child { color: var(--brick-2); }
.is-dark .ch__summary { color: var(--on-night-2); }

/* Shared project kicker + card */
.pcard__kicker { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-3); }
.pcard__kicker span:first-child { color: var(--brick); }
.pcard__media { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); position: relative; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.4s var(--out); }
.pcard:hover .pcard__media img { transform: scale(1); }
.pcard__meta { display: grid; gap: 8px; margin-top: 18px; }
.pcard__title { font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.4vw, 38px); line-height: 1.06; letter-spacing: -.02em; }
.pcard__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .6s var(--out); }
.pcard:hover .pcard__title a, .pcard__title a:focus-visible { background-size: 100% 1px; }
.pcard__lede { color: var(--ink-2); max-width: 46ch; }

/* 01 · Now */
.now { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(48px, 7vw, 96px); align-items: start; }
.now__roles { display: grid; gap: 18px; position: sticky; top: calc(var(--nav-h) + 24px); }
.role { position: relative; padding: 28px; border-radius: var(--radius); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; justify-items: start; overflow: hidden; }
.role::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brick); }
.role__when { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-3); }
.role__title { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.2vw, 34px); line-height: 1.08; letter-spacing: -.02em; }
.role__org { font-weight: 500; }
.role__text { color: var(--ink-2); }
.role .link { color: var(--ink); margin-top: 6px; }
.role .link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.role .btn { margin-top: 8px; }
.role--free { background: var(--ink); color: var(--paper); box-shadow: none; }
.role--free .role__when, .role--free .role__text { color: var(--on-night-2); }
.role--free .btn { --b: var(--paper); --f: var(--ink); }
.role--free .btn:hover { color: var(--paper); }
.services__title { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3vw, 46px); line-height: 1.05; letter-spacing: -.02em; margin-bottom: 24px; }
.services__title em { color: var(--brick); }
.services__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.service { position: relative; padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; align-content: start; isolation: isolate; }
.service:nth-child(odd) { padding-right: 32px; border-right: 1px solid var(--line); }
.service:nth-child(even) { padding-left: 32px; }
.service::before { content: ""; position: absolute; inset: 0; background: var(--paper-2); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--out); z-index: -1; }
.service:hover::before { transform: scaleY(1); }
.service svg { width: 40px; height: 40px; fill: none; stroke: var(--brick); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; transition: transform .6s var(--out); }
.service:hover svg { transform: translateY(-4px) rotate(-4deg); }
.service h4 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; margin: 0; }
.service p { color: var(--ink-2); }
.service .service__proof { color: var(--ink-3); font-size: 11px; margin-top: 4px; }

/* 02 · Horizontal chapter */
.ch--horizontal { padding: 0; }
.ch--horizontal .work__pin { grid-template-rows: 1fr auto; padding: calc(var(--nav-h) + 12px) 0 32px; }
.ch--horizontal .work__viewport { margin-top: 0; display: flex; align-items: center; }
.ch--horizontal .work__track { align-items: center; }
.work__intro { flex: none; width: clamp(320px, 40vw, 640px); padding-right: clamp(16px, 3vw, 48px); }
.work__intro .ch__years { font-size: clamp(72px, 9.5vw, 160px); }
.work__intro .ch__info { grid-template-columns: 1fr; }
.wcard__title { font-family: var(--serif); font-weight: 300; font-size: clamp(24px, 2.3vw, 36px); line-height: 1.05; letter-spacing: -.02em; }
.wcard__lede { grid-column: 1 / -1; color: var(--on-night-2); max-width: 46ch; margin-top: 4px; }
.work__end .mono { color: var(--on-night-3); }
.work__next { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 4.4vw, 72px); line-height: .95; letter-spacing: -.03em; }
.work__next em { font-size: .42em; letter-spacing: 0; color: var(--brick-2); }
.work__bar { display: flex; align-items: center; gap: 20px; margin: 24px var(--gutter) 0; }
.work__bar .work__count { display: flex; }
.work__bar .work__progress { flex: 1; margin: 0; }

/* 03 · Grid */
.pgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); margin-top: clamp(56px, 8vw, 112px); }
.pgrid__item--1 { grid-column: 1 / 8; }
.pgrid__item--2 { grid-column: 8 / 13; margin-top: clamp(120px, 18vw, 300px); }
.pgrid__item--3 { grid-column: 3 / 10; margin-top: clamp(56px, 6vw, 96px); }
.pgrid__item--2 .pcard__media { aspect-ratio: 4 / 5; }

/* 04 · Feature with expanding panels */
.feature { margin-top: clamp(48px, 7vw, 96px); }
.panels { display: flex; gap: 10px; height: clamp(320px, 62vh, 640px); }
.panel { position: relative; flex: 1 1 0; min-width: 0; border-radius: 12px; overflow: hidden; background: var(--paper-2); transition: flex-grow .9s var(--out); }
.panel.is-active { flex-grow: 5; }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--out), filter .6s; filter: saturate(.75); }
.panel.is-active img { filter: none; }
.panel:hover img { transform: scale(1.03); }
.panel__label { position: absolute; left: 14px; bottom: 14px; padding: 6px 10px; border-radius: 999px; background: rgba(22, 21, 18, .65); color: var(--on-night); white-space: nowrap; font-size: 10.5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
.feature__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px clamp(28px, 6vw, 96px); margin-top: 32px; align-items: start; }
.feature__meta .pcard__kicker { grid-column: 1 / -1; }
.feature__title { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 3.4vw, 52px); line-height: 1.02; letter-spacing: -.025em; }
.feature__lede { color: var(--ink); font-size: 19px; }
.feature__text { color: var(--ink-2); grid-column: 2; }
.feature__meta .btn { grid-column: 2; justify-self: start; }

/* 05 · Process (sticky scrollytelling) */
.ch--process { background: var(--paper-2); }
.process { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(48px, 7vw, 96px); align-items: start; }
.process__media { position: sticky; top: calc(var(--nav-h) + 6vh); aspect-ratio: 16 / 10; border-radius: var(--radius); background: var(--paper); box-shadow: 0 30px 60px rgba(26, 25, 22, .1), inset 0 0 0 1px var(--line); overflow: hidden; }
.process__frame { position: absolute; inset: 0; padding: 4%; opacity: 0; transform: scale(1.04); transition: opacity .7s, transform 1.1s var(--out); }
.process__frame.is-active { opacity: 1; transform: none; }
.process__frame img { width: 100%; height: 100%; object-fit: contain; }
.process__count { position: absolute; right: 14px; bottom: 12px; color: var(--ink-3); }
.process__count span { color: var(--brick); }
.step { min-height: 68vh; display: flex; flex-direction: column; justify-content: center; gap: 12px; opacity: .3; transition: opacity .5s; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step.is-active { opacity: 1; }
.step__no { color: var(--brick); }
.step__title { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3vw, 46px); line-height: 1.04; letter-spacing: -.02em; }
.step__text { color: var(--ink-2); font-size: 18px; max-width: 40ch; }
.step__img { display: none; }
.ch__project { display: grid; gap: 12px; justify-items: start; margin-top: clamp(32px, 5vw, 64px); padding-top: 28px; border-top: 1px solid var(--line-2); max-width: 760px; }
.ch__project-title { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3vw, 46px); line-height: 1.05; letter-spacing: -.02em; }
.ch__project p:not(.mono) { color: var(--ink-2); }

/* 06 · Frame + housing duo */
.ch--frame .frame-bleed { margin: clamp(56px, 7vw, 100px) calc(var(--gutter) * -1); }
.frame__title { font-family: var(--serif); font-weight: 300; font-size: clamp(48px, 9vw, 150px); line-height: .9; letter-spacing: -.04em; }
.frame__title em { color: var(--brick-2); }
.frame__lede { color: var(--on-night-2); max-width: 46ch; }
.duo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.duo__main { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.duo__main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s, transform 1.2s var(--out); }
.duo__main:hover img { transform: scale(1.03); }
.duo__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.duo__thumbs::-webkit-scrollbar { display: none; }
.duo__thumbs button { flex: none; width: 84px; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; opacity: .55; box-shadow: inset 0 0 0 1px var(--line); transition: opacity .3s, transform .4s var(--out); }
.duo__thumbs button:hover, .duo__thumbs button.is-active { opacity: 1; }
.duo__thumbs button.is-active { box-shadow: 0 0 0 2px var(--brick); }
.duo__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.duo__meta { display: grid; gap: 12px; justify-items: start; }
.duo__title { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 3.4vw, 52px); line-height: 1.02; letter-spacing: -.025em; }
.duo__lede { font-size: 19px; }
.duo__meta p:not(.mono):not(.duo__lede) { color: var(--ink-2); }

/* 07 · Triptych + street */
.tri { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(48px, 7vw, 96px); align-items: center; }
.tri__meta { display: grid; gap: 12px; justify-items: start; }
.tri__title { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 3.4vw, 52px); line-height: 1.02; letter-spacing: -.025em; }
.tri__meta p:not(.mono) { color: var(--ink-2); }
.tri__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: tri; }
.tri__step { position: relative; display: grid; gap: 10px; }
.tri__step:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 40%; width: 14px; text-align: center; color: var(--brick); font-family: var(--mono); }
.tri__step button { display: block; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.tri__step img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--out); }
.tri__step button:hover img { transform: scale(1.05); }
.tri__step.is-sketch button { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.tri__step.is-sketch img { object-fit: contain; padding: 10%; mix-blend-mode: multiply; }
.tri__step .mono { color: var(--ink-3); }
.ch .street { margin-top: clamp(96px, 12vw, 170px); }
.street__title { margin-top: 10px; }

/* ---------- Index tools ---------- */
.index__tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.sort { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 11.5px; transition: box-shadow .3s; }
.sort:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.sort span { display: inline-block; color: var(--brick); transition: transform .5s var(--out); }
.sort.is-asc span { transform: rotate(180deg); }

/* ---------- FAQ ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq__intro { position: sticky; top: calc(var(--nav-h) + 32px); display: grid; gap: 20px; }
.faq__intro p { color: var(--ink-2); max-width: 36ch; }
.faq__list { border-top: 1px solid var(--line-2); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; cursor: pointer; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; letter-spacing: -.01em; margin: 0; transition: color .3s; }
.qa summary:hover h3 { color: var(--brick); }
.qa summary i { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .5s var(--out), background-color .3s; }
.qa summary i::before, .qa summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -.75px 0 0 -6px; background: currentColor; }
.qa summary i::after { transform: rotate(90deg); transition: transform .5s var(--out); }
.qa[open] summary i { background: var(--ink); color: var(--paper); }
.qa[open] summary i::after { transform: rotate(0); }
.qa__a { padding: 0 64px 26px 0; color: var(--ink-2); font-size: 17px; max-width: 64ch; }

/* ---------- Misc ---------- */
.contact__lede { margin-top: clamp(28px, 4vw, 44px); max-width: 560px; color: var(--on-night-2); font-size: 19px; }
.job__link { color: var(--brick-2); text-decoration: underline; text-underline-offset: 3px; }
.footer__row a:hover { color: var(--on-night); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .rail { display: none; }
}
@media (max-width: 1080px) {
  .now { grid-template-columns: 1fr; }
  .now__roles { position: relative; top: auto; grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .ch { padding-top: 88px; padding-bottom: 88px; }
  .ch__years { font-size: 23vw; }
  .ch__info, .feature__meta, .duo, .tri, .faq__grid, .now, .process { grid-template-columns: minmax(0, 1fr); }
  .feature__text, .feature__meta .btn { grid-column: auto; }
  .now__roles { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .service, .service:nth-child(odd), .service:nth-child(even) { padding: 24px 0; border-right: 0; }
  .ch--horizontal .work__pin { padding-top: 72px; }
  .work__intro { width: 84vw; scroll-snap-align: start; padding-right: 0; }
  .work__intro .ch__years { font-size: 20vw; }
  .work__bar { display: none; }
  .pgrid { display: grid; grid-template-columns: 1fr; gap: 48px; }
  .pgrid__item--1, .pgrid__item--2, .pgrid__item--3 { grid-column: auto; margin-top: 0; }
  .pgrid__item--2 .pcard__media { aspect-ratio: 16 / 10; }
  .panels { height: 300px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .panels::-webkit-scrollbar { display: none; }
  .panel, .panel.is-active { flex: 0 0 78vw; scroll-snap-align: center; }
  .panel img { filter: none; }
  .process { grid-template-columns: 1fr; }
  .process__media { display: none; }
  .step { min-height: 0; opacity: 1; padding: 32px 0; }
  .step__img { display: block; margin-top: 8px; border-radius: 10px; overflow: hidden; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
  .step__img img { width: 100%; }
  .duo__media { order: -1; }
  .tri__steps { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .tri__step:not(:last-child)::after { display: none; }
  .tri__step button { aspect-ratio: 3 / 4; }
  .faq__intro { position: relative; top: auto; }
  .qa__a { padding-right: 0; }
}

/* Leave room for the fixed rail on wide screens */
@media (min-width: 1181px) {
  .timeline > .tl-head, .timeline > .ch:not(.ch--horizontal) { padding-right: calc(var(--gutter) + 72px); }
  .ch--frame .frame-bleed { margin-right: calc((var(--gutter) + 72px) * -1); }
}
.link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--out); }
.link:hover svg { transform: translateX(4px); }
