/* RareSunday — editorial portfolio system
   Design read: creative-agency archive (Pentagram reference). UI 90% neutral, projects 100% colour.
   Dials: VARIANCE 9 / MOTION 6 / DENSITY 3
   Type: Archivo variable (wdth 62–125). Display = wide, body = normal. One family. */

:root {
  --bg: #f4f3ef;
  --bg-2: #ebeae4;
  --ink: #141414;
  --ink-2: #6b6a64;
  --line: #d6d4cc;
  --accent: #1400ff;
  --radius: 0;
  --pad: clamp(1rem, 3vw, 3rem);
  --max: 1600px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 64px;
  color-scheme: light;
}
/* Theme locked to light: the off-white canvas is part of the brand, same on every device. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem; line-height: 1.5; font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

/* ---------- type ---------- */
.display { font-weight: 700; letter-spacing: -0.03em; line-height: 0.95; font-variation-settings: "wdth" 112; text-wrap: balance; }
.display-xl { font-size: clamp(2.6rem, 7.6vw, 8.5rem); }
.display-l  { font-size: clamp(2.2rem, 5.4vw, 5.6rem); }
.display-m  { font-size: clamp(1.6rem, 3.2vw, 3.2rem); }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.4rem); line-height: 1.4; max-width: 34ch; color: var(--ink); }
.meta { font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; }
.wordmark strong { font-weight: 500; font-size: 1.25rem; letter-spacing: -0.03em; font-variation-settings: "wdth" 100; }
.wordmark small { font-size: 0.5rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); align-self: flex-end; margin-top: 1px; }
.nav { display: flex; gap: clamp(1rem, 2.5vw, 2.5rem); font-size: 0.95rem; }
.nav a { position: relative; padding: .25rem 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover::after, .nav a:focus-visible::after, .nav a[aria-current]::after { transform: scaleX(1); }

/* ---------- hero (interactive statement) ---------- */
.hero { min-height: min(calc(100dvh - var(--nav-h)), 960px); display: grid; align-items: center; padding-block: clamp(2rem, 5vh, 4rem) clamp(2rem, 6vh, 5rem); }
.hero-grid { display: grid; grid-template-columns: 8fr 4fr; gap: clamp(1.5rem, 4vw, 5rem); align-items: center; }
.statement { font-size: clamp(2.2rem, 5vw, 5.4rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; font-variation-settings: "wdth" 108; }
.statement .quiet { color: var(--ink-2); font-weight: 400; font-variation-settings: "wdth" 96; }
.word-set { display: inline; color: var(--ink-2); font-weight: 400; font-variation-settings: "wdth" 96; }
.word-set .word { font-weight: 700; font-variation-settings: "wdth" 108; }
.word { display: inline; white-space: nowrap; position: relative; padding: 0; color: var(--ink); transition: color .3s var(--ease), opacity .3s var(--ease); }
.word::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em; height: 0.06em; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.word.is-active::after { transform: scaleX(1); }
.word-set:hover .word:not(:hover), .word-set:focus-within .word:not(:focus-visible) { opacity: .35; }
.word:hover, .word:focus-visible { opacity: 1 !important; color: var(--ink); outline: none; }
.word:hover::after, .word:focus-visible::after { transform: scaleX(1); }
.hero-visual { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.hero-visual img.is-on { opacity: 1; transform: scale(1); }
.hero-visual figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: .75rem 1rem; font-size: .8rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); display: flex; justify-content: space-between; opacity: 0; transition: opacity .4s var(--ease); }
.hero-visual:hover figcaption, .hero-visual.is-labelled figcaption { opacity: 1; }
.hero-foot { display: flex; gap: 1.5rem; align-items: baseline; margin-top: clamp(1.5rem, 3vw, 2.5rem); flex-wrap: wrap; }
.hero-foot .lead { max-width: 40ch; }

/* ---------- section scaffolding ---------- */
.section { padding-block: clamp(4rem, 10vw, 10rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(1.5rem, 3vw, 3rem); flex-wrap: wrap; }
.section-head h2 { font-weight: 500; letter-spacing: -0.02em; font-size: clamp(1.6rem, 2.6vw, 2.6rem); line-height: 1; }

/* filters */
.filters { display: flex; gap: .25rem; flex-wrap: wrap; }
.chip { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-size: .875rem; transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:active { transform: scale(.97); }

/* ---------- selected work: asymmetric grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1rem, 2vw, 2rem); grid-auto-flow: dense; }
.card { position: relative; grid-column: span 12; display: block; }
.card .frame { position: relative; overflow: hidden; background: var(--bg-2); aspect-ratio: var(--ar, 4 / 3); }
.card .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .55s var(--ease), transform 1.1s var(--ease); }
.card .frame img.alt { opacity: 0; }
.card:hover .frame img.alt, .card:focus-visible .frame img.alt { opacity: 1; }
.card:hover .frame img, .card:focus-visible .frame img { transform: scale(1.025); }
.card .cap { display: flex; justify-content: space-between; gap: 1rem; padding-top: .75rem; align-items: baseline; }
.card .cap h3 { font-weight: 500; font-size: 1.05rem; letter-spacing: -0.01em; }
.card .cap .meta { text-align: right; flex-shrink: 0; }
.card.is-hidden { display: none; }
@media (min-width: 900px) {
  .card[data-span="8"] { grid-column: span 8; } .card[data-span="4"] { grid-column: span 4; }
  .card[data-span="6"] { grid-column: span 6; } .card[data-span="3"] { grid-column: span 3; }
  .card[data-span="5"] { grid-column: span 5; } .card[data-span="7"] { grid-column: span 7; }
}
.work-empty { padding: 4rem 0; color: var(--ink-2); font-size: 1.1rem; display: none; }
.work-empty.is-on { display: block; }

/* ---------- manifesto ---------- */
.manifesto { padding-block: clamp(5rem, 14vw, 14rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.manifesto p { font-size: clamp(2.2rem, 6.4vw, 7.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 0.98; font-variation-settings: "wdth" 118; max-width: 16ch; }
.manifesto p em { font-style: normal; color: inherit; opacity: .55; font-weight: 400; font-variation-settings: "wdth" 96; }

/* ---------- capabilities: accordion image rows ---------- */
.caps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cap-row { border-bottom: 1px solid var(--line); }
.cap-row > button { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 1rem; padding: clamp(1rem, 2.2vw, 1.75rem) 0; text-align: left; }
.cap-row h3 { font-size: clamp(1.8rem, 4.6vw, 4.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-variation-settings: "wdth" 110; transition: color .3s var(--ease), transform .5s var(--ease); }
.cap-row .meta { font-size: 1rem; max-width: 28ch; text-align: right; }
.cap-row .panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.cap-row .panel > div { overflow: hidden; }
.cap-row .strip { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; padding-bottom: clamp(1.25rem, 2.5vw, 2rem); }
.cap-row .strip img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cap-row.is-open .panel { grid-template-rows: 1fr; }
.cap-row.is-open h3 { transform: translateX(.25em); }
.cap-row:hover h3 { color: var(--accent); }
@media (max-width: 700px) { .cap-row .strip { grid-template-columns: 1fr 1fr; } .cap-row .strip img:nth-child(3) { display: none; } .cap-row .meta { display: none; } }

/* ---------- featured case: editorial stack ---------- */
.feature { padding-block: clamp(4rem, 8vw, 8rem); }
.feature .bleed { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.feature .intro { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; padding-block: clamp(1.5rem, 3vw, 3rem); }
.feature .pair { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1rem, 2vw, 2rem); margin-top: clamp(1rem, 2vw, 2rem); }
.feature .pair img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.feature .pair img:last-child { aspect-ratio: 3 / 2; align-self: end; }
.feature .claim { font-size: clamp(1.8rem, 3.6vw, 3.8rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; max-width: 22ch; margin-block: clamp(2.5rem, 5vw, 5rem) 1.5rem; font-variation-settings: "wdth" 106; }
.arrow-link { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: .15rem; }
.arrow-link svg { width: 1em; height: 1em; transition: transform .35s var(--ease); }
.arrow-link:hover svg { transform: translateX(.3em); }

/* ---------- curated strip: horizontal scroll-snap ---------- */
.strip-section { overflow: hidden; }
.h-strip { display: flex; gap: clamp(.75rem, 1.5vw, 1.5rem); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; scrollbar-width: none; margin-inline: calc(-1 * var(--pad)); padding-inline: var(--pad); }
.h-strip::-webkit-scrollbar { display: none; }
.h-strip figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; width: min(72vw, 420px); }
.h-strip figure.wide { width: min(90vw, 640px); }
.h-strip img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--bg-2); }
.h-strip figure.wide img { aspect-ratio: 3 / 2; }
.h-strip figcaption { padding-top: .6rem; display: flex; justify-content: space-between; font-size: .9rem; }

/* ---------- archive index ---------- */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); position: relative; }
.index li { border-bottom: 1px solid var(--line); }
.index a { display: grid; grid-template-columns: 5rem 1fr 1fr auto; gap: 1rem; padding: 1rem 0; align-items: baseline; transition: color .25s var(--ease), padding-left .35s var(--ease); }
.index a:hover, .index a:focus-visible { padding-left: .5rem; }
.index a:hover .client { color: var(--accent); }
.index .year { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.index .client { font-weight: 500; font-size: 1.15rem; letter-spacing: -0.015em; }
.index .disc, .index .sector { color: var(--ink-2); font-size: .95rem; }
.index-preview { position: fixed; z-index: 40; width: clamp(160px, 18vw, 280px); aspect-ratio: 4 / 5; object-fit: cover; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.96); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.index-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (max-width: 700px) { .index a { grid-template-columns: 3.5rem 1fr; } .index .sector { display: none; } .index .disc { grid-column: 2; } .index-preview { display: none; } }

/* ---------- studio ---------- */
.studio { border-top: 1px solid var(--line); }
.studio .cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 6rem); align-items: start; }
.studio .display-l { max-width: 14ch; }
.studio p + p { margin-top: 1rem; }
.studio .clients { margin-top: 2rem; color: var(--ink-2); line-height: 1.7; }
.studio .clients b { color: var(--ink); font-weight: 500; }

/* ---------- contact / footer ---------- */
.contact { padding-block: clamp(5rem, 12vw, 12rem) clamp(2rem, 4vw, 4rem); border-top: 1px solid var(--line); }
.contact .display-xl { max-width: 12ch; }
.contact .mail { display: inline-block; margin-top: 2rem; font-size: clamp(1.3rem, 2.6vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; border-bottom: 2px solid var(--accent); padding-bottom: .1em; transition: color .3s var(--ease); }
.contact .mail:hover { color: var(--accent); }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem; margin-top: clamp(3rem, 6vw, 6rem); border-top: 1px solid var(--line); font-size: .875rem; color: var(--ink-2); }
.footer nav { display: flex; gap: 1.25rem; }
.footer a:hover { color: var(--ink); }

/* ---------- case study page ---------- */
.case-head { padding-block: clamp(3rem, 7vw, 7rem) clamp(2rem, 4vw, 4rem); }
.case-head .display-xl { max-width: 14ch; }
.case-head .row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; margin-top: clamp(1.5rem, 3vw, 3rem); }
.case-head dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.5rem; margin: 0; font-size: .95rem; }
.case-head dt { color: var(--ink-2); } .case-head dd { margin: 0; }
.case .bleed { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.case .block { padding-block: clamp(3rem, 6vw, 6rem); }
.case .text { max-width: 60ch; font-size: clamp(1.05rem, 1.3vw, 1.25rem); line-height: 1.55; }
.case .text h2 { font-weight: 500; font-size: 1rem; color: var(--ink-2); margin-bottom: .75rem; }
.case .pull { font-size: clamp(2rem, 5vw, 5.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variation-settings: "wdth" 114; max-width: 18ch; }
.case .duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2vw, 2rem); }
.case .duo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.case .trio { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: clamp(1rem, 2vw, 2rem); }
.case .trio img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.case .offset { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(1rem, 2vw, 2rem); align-items: end; }
.case .offset img:first-child { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.case .offset img:last-child { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; }
.case .tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.case .tags span { border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; font-size: .9rem; }
.next-project { display: block; border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 6rem); }
.next-project .meta { margin-bottom: .75rem; }
.next-project .display-l { transition: color .3s var(--ease); }
.next-project:hover .display-l { color: var(--accent); }


/* ---------- kinetic type: scroll-scrubbed, off main thread (CSS scroll-driven animations) ----------
   Purpose: explanation/delight on a marketing page, rare-tier. Words fill from faint to ink and widen as they enter.
   Browsers without animation-timeline see the final static state. Reduced motion: colour only, no movement. */
.kinetic .w { display: inline-block; white-space: pre; }
@supports (animation-timeline: view()) {
  .kinetic .w {
    animation: word-in linear both;
    animation-timeline: view();
    animation-range: entry calc(55% + var(--i, 0) * 2.5%) cover calc(30% + var(--i, 0) * 2%);
  }
  @keyframes word-in {
    from { opacity: .16; transform: translateY(.28em); font-variation-settings: "wdth" 88; }
    to   { opacity: 1;   transform: none;              font-variation-settings: "wdth" 116; }
  }
  .manifesto .kinetic .w { animation-range: entry calc(20% + var(--i, 0) * 2%) cover calc(22% + var(--i, 0) * 1.6%); }
  /* the one colour-block moment on the page: manifesto turns accent while it is centred */
  .manifesto { animation: block linear both; animation-timeline: view(); animation-range: entry 35% exit 65%; border-color: transparent; }
  @keyframes block {
    0%, 100% { background: var(--bg); color: var(--ink); }
    38%, 62% { background: var(--accent); color: #f4f3ef; }
  }
  /* hero recedes as you scroll into the work */
  .hero-grid { animation: hero-out linear both; animation-timeline: view(); animation-range: exit 0% exit 70%; }
  @keyframes hero-out { to { opacity: 0; transform: translateY(-4%) scale(.97); } }
  @media (prefers-reduced-motion: reduce) {
    .kinetic .w { animation-name: word-in-still; }
    @keyframes word-in-still { from { opacity: .3; } to { opacity: 1; } }
    .hero-grid { animation: none; }
  }
}

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; } .reveal[data-delay="2"] { transition-delay: .16s; } .reveal[data-delay="3"] { transition-delay: .24s; }

/* ---------- responsive collapse ---------- */
@media (max-width: 900px) {
  .hero-grid, .feature .intro, .feature .pair, .studio .cols, .case-head .row, .case .duo, .case .trio, .case .offset { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 2rem; }
  .hero-visual { aspect-ratio: 4 / 3; order: 2; }
  .feature .pair img, .feature .pair img:last-child { aspect-ratio: 4 / 3; }
  .case .trio img:first-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
  .cap-row > button { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .nav { gap: 1rem; font-size: .9rem; } .wordmark small { display: none; } }

/* ---------- focus + reduced motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-visual img { transform: none; }
}
