@layer reset, base, layout, components, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, p, figure { margin: 0; }
  img { display: block; max-width: 100%; }
  button, a { font: inherit; }
  button { color: inherit; }
}

@layer base {
  :root {
    --ink: #171714;
    --paper: #f0eee7;
    --muted: #6f7069;
    --acid: #d7ff38;
    --line: rgba(23, 23, 20, .2);
    --pad: clamp(1.25rem, 3vw, 3.5rem);
    --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  html { background: var(--paper); color: var(--ink); }
  body { min-width: 320px; overflow-x: hidden; background: var(--paper); font-family: var(--sans); }
  body.menu-open, body:has(.lightbox[open]), body:has(.support-dialog[open]) { overflow: hidden; }
  ::selection { background: var(--acid); color: var(--ink); }
  :focus-visible { outline: 3px solid var(--acid); outline-offset: 4px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .7rem 1rem; color: var(--ink); background: var(--acid); transform: translateY(-150%); transition: transform .2s; }
  .skip-link:focus { transform: none; }
  a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
  h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.055em; line-height: .88; }
  h2 { font-size: clamp(3.2rem, 8vw, 8.6rem); }
  .section-label, .eyebrow { font-size: .69rem; font-weight: 700; letter-spacing: .2em; line-height: 1.2; text-transform: uppercase; }
}

@layer layout {
  .scroll-progress { position: fixed; z-index: 90; inset: 0 0 auto; height: 3px; pointer-events: none; }
  .scroll-progress span { display: block; width: 100%; height: 100%; background: var(--acid); transform: scaleX(0); transform-origin: left; }

  .site-header { position: fixed; z-index: 80; top: 0; left: 0; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 1.25rem var(--pad); color: white; transition: color .25s, background .25s, padding .25s; }
  .site-header::after { position: absolute; right: var(--pad); bottom: 0; left: var(--pad); height: 1px; background: currentColor; opacity: .24; content: ""; }
  .site-header.is-scrolled { padding-block: .8rem; color: var(--ink); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(16px); }
  .brand { display: flex; align-items: baseline; gap: .65rem; text-decoration: none; }
  .brand span { font-family: var(--serif); font-size: 1.35rem; font-style: italic; letter-spacing: -.06em; }
  .brand strong { font-size: .66rem; letter-spacing: .19em; }
  nav { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 3.5rem); }
  nav a { position: relative; font-size: .73rem; font-weight: 700; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
  nav a::after { position: absolute; right: 0; bottom: -.4rem; left: 0; height: 1px; background: currentColor; content: ""; transform: scaleX(0); transform-origin: right; transition: transform .25s; }
  nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
  .menu-toggle { display: none; border: 0; background: none; }

  .hero { position: relative; min-height: 100svh; overflow: hidden; color: white; background: #101c17; }
  .hero > picture, .hero > picture img, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
  .hero img { object-fit: cover; object-position: center 55%; scale: 1.02; }
  .hero-shade { background: linear-gradient(90deg, rgba(6, 12, 10, .68) 0%, rgba(6, 12, 10, .15) 58%, rgba(6, 12, 10, .36)), linear-gradient(0deg, rgba(4, 8, 7, .55), transparent 45%); }
  .hero-copy { position: absolute; z-index: 1; bottom: clamp(7rem, 13vh, 10rem); left: var(--pad); max-width: 72rem; }
  .hero-copy .eyebrow { margin-bottom: clamp(1.2rem, 2.5vw, 2.3rem); color: var(--acid); }
  .hero h1 { max-width: 10ch; font-size: clamp(5.4rem, 13.2vw, 13rem); }
  .hero-copy > p:not(.eyebrow) { max-width: 39rem; margin-top: 1.6rem; font-size: clamp(1rem, 1.7vw, 1.35rem); line-height: 1.5; }
  .support-cta { min-height: 3rem; margin-top: 1.4rem; padding: .8rem 1.15rem; border: 1px solid var(--acid); color: var(--ink); cursor: pointer; background: var(--acid); box-shadow: .35rem .35rem 0 rgba(0,0,0,.45); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
  .support-cta:hover { color: white; background: var(--ink); }
  .hero-scroll { position: absolute; z-index: 2; bottom: 2.5rem; left: var(--pad); display: flex; align-items: center; gap: .75rem; font-size: .65rem; font-weight: 700; letter-spacing: .18em; text-decoration: none; text-transform: uppercase; }
  .hero-scroll i { position: relative; width: 4rem; height: 1px; overflow: hidden; background: rgba(255,255,255,.45); }
  .hero-scroll i::after { position: absolute; inset: 0; background: white; content: ""; animation: scan 2.5s infinite ease-in-out; }
  .hero-index { position: absolute; z-index: 1; right: var(--pad); bottom: 2.4rem; font-size: .7rem; letter-spacing: .18em; }

  .manifesto { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 4fr); gap: 2rem; padding: clamp(8rem, 15vw, 15rem) var(--pad); border-bottom: 1px solid var(--line); }
  .manifesto h2 { max-width: 12ch; }
  .manifesto div > p { max-width: 42rem; margin-top: 2.4rem; margin-left: min(18vw, 16rem); color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.45rem); line-height: 1.6; }

  .work-section { padding: clamp(7rem, 12vw, 12rem) var(--pad); }
  .section-head { display: grid; grid-template-columns: 1fr 3fr; align-items: end; gap: 1.5rem; margin-bottom: clamp(5rem, 10vw, 10rem); }
  .section-head h2 { grid-column: 2; max-width: 10ch; font-size: clamp(4rem, 9vw, 9.5rem); }
  .section-head > p:last-child { grid-column: 2; color: var(--muted); font-size: .82rem; }
  .gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(5rem, 10vw, 10rem) clamp(1rem, 2vw, 2.2rem); align-items: start; }
  .frame { grid-column: span 5; }
  .frame--wide { grid-column: span 7; }
  .frame--portrait { grid-column: span 5; }
  .frame--tall { grid-column: span 4; }
  .frame--offset { margin-top: clamp(4rem, 12vw, 11rem); }
  .frame--lower { margin-top: clamp(7rem, 18vw, 16rem); }
  .frame:nth-child(7) { grid-column-start: 2; }
  .frame:nth-child(8) { grid-column: 7 / span 6; margin-top: 12vw; }
  .frame:nth-child(11) { grid-column: 1 / span 8; }
  .frame:nth-child(12) { grid-column: 9 / span 4; }
  .frame:nth-child(13) { grid-column: 1 / span 7; }
  .frame:nth-child(14) { grid-column: 9 / span 4; }
  .photo-open { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; cursor: zoom-in; background: #d2d0c9; }
  .photo-open picture, .photo-open img { display: block; width: 100%; height: 100%; }
  .photo-open img { object-fit: cover; transition: scale .7s cubic-bezier(.2,.7,.2,1), filter .4s; }
  .frame--wide .photo-open { aspect-ratio: 5 / 3.35; }
  .frame--portrait .photo-open { aspect-ratio: 4 / 5; }
  .frame--tall .photo-open { aspect-ratio: 3 / 4; }
  .frame:not(.frame--wide):not(.frame--portrait):not(.frame--tall) .photo-open { aspect-ratio: 4 / 3; }
  .photo-open:hover img, .photo-open:focus-visible img { scale: 1.035; filter: saturate(1.06); }
  .expand { position: absolute; right: .8rem; bottom: .8rem; display: grid; width: 2.7rem; height: 2.7rem; place-items: center; border-radius: 50%; color: var(--ink); background: var(--acid); opacity: 0; translate: 0 .5rem; transition: opacity .25s, translate .25s; }
  .photo-open:hover .expand, .photo-open:focus-visible .expand { opacity: 1; translate: 0; }
  figcaption { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
  figcaption span { font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.55rem); }
  figcaption small { padding-top: .35rem; color: var(--muted); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; }

  .journal { display: grid; grid-template-columns: 1.25fr 1fr; min-height: 90vh; color: #f4f2ea; background: var(--ink); }
  .journal-image { min-height: 65vh; overflow: hidden; }
  .journal-image picture, .journal-image img { width: 100%; height: 100%; }
  .journal-image img { object-fit: cover; }
  .journal-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(4rem, 8vw, 9rem); }
  .journal-copy .section-label { margin-bottom: 2.5rem; color: var(--acid); }
  .journal-copy h2 { max-width: 7ch; font-size: clamp(4rem, 7vw, 8rem); }
  .journal-copy p:not(.section-label) { max-width: 34rem; margin-top: 2rem; color: #bdbdb4; font-size: clamp(1rem, 1.4vw, 1.22rem); line-height: 1.7; }

  .about { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 4fr); gap: 2rem; padding: clamp(8rem, 16vw, 16rem) var(--pad); }
  .about h2 { max-width: 10ch; }
  .about div > p { max-width: 42rem; margin-top: 2.2rem; color: var(--muted); font-size: clamp(1.1rem, 1.8vw, 1.5rem); line-height: 1.55; }
  .text-link { display: inline-block; margin-top: 2.3rem; padding-bottom: .35rem; border-bottom: 1px solid var(--ink); font-size: .76rem; font-weight: 700; letter-spacing: .15em; text-decoration: none; text-transform: uppercase; }

  footer { display: grid; grid-template-columns: 1.3fr 2fr 1fr auto; align-items: end; gap: 2rem; padding: 2.4rem var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; line-height: 1.55; }
  footer p { max-width: 31rem; }
  footer a { color: var(--ink); }
  .footer-brand { color: var(--ink); }
}

@layer components {
  .support-dialog { width: min(92vw, 27rem); padding: 1.75rem; border: 1px solid var(--acid); color: var(--paper); background: var(--ink); box-shadow: 0 2rem 7rem rgba(0,0,0,.7); text-align: center; }
  .support-dialog::backdrop { background: rgba(7,8,8,.88); backdrop-filter: blur(6px); }
  .support-dialog form { margin: 0; }
  .support-close { position: absolute; top: .55rem; right: .8rem; border: 0; color: var(--paper); cursor: pointer; background: transparent; font-size: 1.8rem; }
  .support-kicker { margin: 0; color: var(--acid); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
  .support-dialog h2 { margin: .75rem 0 .6rem; color: var(--paper); font: 400 2.6rem/1 var(--serif); letter-spacing: -.04em; }
  .support-dialog > p:not(.support-kicker) { margin: 0 auto; color: #bdbdb4; }
  .support-dialog img { display: block; width: min(76vw,20rem); height: auto; margin: 1rem auto; border-radius: .7rem; background: white; }
  .support-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
  .support-actions a, .support-actions button { min-height: 2.75rem; padding: .7rem 1rem; border: 1px solid var(--acid); color: var(--ink); cursor: pointer; background: var(--acid); font-weight: 800; text-decoration: none; }
  .support-actions button { color: var(--paper); background: transparent; }
  .support-status { min-height: 1.3em; margin: .75rem 0 0!important; color: #bdbdb4; font-size: .75rem; }
  .lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; padding: 0; overflow: hidden; border: 0; color: white; background: rgba(7, 8, 8, .96); }
  .lightbox::backdrop { background: rgba(7, 8, 8, .96); }
  .lightbox figure { display: grid; width: 100%; height: 100%; place-items: center; padding: clamp(3rem, 7vw, 6rem); }
  .lightbox img { width: auto; max-width: 88vw; height: auto; max-height: 78vh; object-fit: contain; box-shadow: 0 2rem 7rem rgba(0,0,0,.45); }
  .lightbox figcaption { position: absolute; bottom: 1.5rem; left: 50%; display: block; margin: 0; color: #d6d6cf; font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-align: center; text-transform: uppercase; translate: -50% 0; }
  .lightbox-close, .lightbox-nav { position: absolute; z-index: 2; display: grid; width: 3.3rem; height: 3.3rem; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: white; cursor: pointer; background: rgba(0,0,0,.25); transition: color .2s, background .2s; }
  .lightbox-close:hover, .lightbox-nav:hover { color: var(--ink); background: var(--acid); }
  .lightbox-close { top: 1.2rem; right: 1.2rem; font-size: 1.6rem; }
  .lightbox-nav { top: 50%; font-size: 1.2rem; translate: 0 -50%; }
  .lightbox-prev { left: 1.2rem; }
  .lightbox-next { right: 1.2rem; }
}

@layer motion {
  .js .reveal { opacity: 0; translate: 0 2.5rem; transition: opacity .8s ease, translate .9s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.is-visible { opacity: 1; translate: 0; }
  @keyframes scan { 0% { transform: translateX(-105%); } 55%, 100% { transform: translateX(105%); } }
}

@media (max-width: 800px) {
  .site-header { padding-block: 1rem; }
  .menu-toggle { position: relative; z-index: 2; display: grid; width: 2.6rem; height: 2.6rem; padding: .65rem; place-content: center; gap: .34rem; border: 1px solid currentColor; border-radius: 50%; }
  .menu-toggle span:not(.sr-only) { display: block; width: 1.05rem; height: 1px; background: currentColor; transition: rotate .2s, translate .2s; }
  .menu-toggle[aria-expanded="true"] span:first-child { translate: 0 .2rem; rotate: 45deg; }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { translate: 0 -.2rem; rotate: -45deg; }
  nav { position: fixed; inset: 0; display: grid; align-content: center; justify-items: center; gap: 1.8rem; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: opacity .2s; }
  nav a { font-family: var(--serif); font-size: clamp(3rem, 15vw, 5rem); font-weight: 400; letter-spacing: -.04em; text-transform: none; }
  .menu-open nav { opacity: 1; pointer-events: auto; }
  .menu-open .site-header { color: white; }

  .hero h1 { font-size: clamp(4.7rem, 23vw, 8.2rem); }
  .hero-copy { bottom: 8rem; }
  .hero-copy > p:last-child { max-width: 24rem; }

  .manifesto, .about { grid-template-columns: 1fr; }
  .manifesto div > p { margin-left: 0; }
  .section-label { margin-bottom: 1.4rem; }
  .section-head { grid-template-columns: 1fr; }
  .section-head h2, .section-head > p:last-child { grid-column: 1; }

  .gallery { display: block; }
  .frame, .frame--wide, .frame--portrait, .frame--tall, .frame:nth-child(n) { width: 100%; margin: 0 0 5.5rem; }
  .frame:nth-child(3n + 2) { width: 83%; margin-left: auto; }
  .frame:nth-child(4n) { width: 88%; }
  .frame--wide .photo-open { aspect-ratio: 4 / 3; }
  .expand { opacity: 1; translate: 0; }

  .journal { grid-template-columns: 1fr; }
  .journal-image { min-height: 62vh; }
  .journal-copy { min-height: 70vh; }
  footer { grid-template-columns: 1fr 1fr; align-items: start; }
  footer p:nth-of-type(1) { grid-column: 1 / -1; }
  .lightbox-nav { top: auto; bottom: 1rem; }
  .lightbox-prev { left: 1rem; }
  .lightbox-next { right: 1rem; }
  .lightbox figcaption { bottom: 1.8rem; max-width: calc(100vw - 9rem); }
}

@media (max-width: 480px) {
  .hero-copy { bottom: 7.4rem; }
  .hero h1 { font-size: clamp(4rem, 22vw, 6.4rem); }
  .hero-index { display: none; }
  .manifesto, .about, .work-section { padding-block: 6.5rem; }
  .manifesto h2, .about h2 { font-size: clamp(3.4rem, 17vw, 5.5rem); }
  .section-head h2 { font-size: clamp(4rem, 19vw, 6.2rem); }
  .frame:nth-child(n) { width: 100%; }
  .journal-copy { padding: 4.5rem var(--pad); }
  footer { grid-template-columns: 1fr; }
  footer p:nth-of-type(1) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; translate: 0; }
}
