/* =========================================================
   SONCE — A Cohesive Design Studio
   Monochrome Swiss. Hairline grid, disciplined typography,
   one floating image preview. No colour, no noise.
   ========================================================= */

:root {
  --paper:  #f2f0ea;   /* warm bone */
  --paper-2:#e9e5dc;   /* deeper bone — image placeholders */
  --ink:    #15120e;   /* near-black */
  --muted:  #7c766b;
  --faint:  #b3ab9d;
  --amber:  #bf5411;   /* the sun — used sparingly, accents only */
  --line:   rgba(21, 18, 14, 0.16);
  --line-2: rgba(21, 18, 14, 0.08);

  --sans: "Inter Tight", -apple-system, sans-serif;
  --display: var(--sans);
  --mono: "JetBrains Mono", monospace;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --maxw: 1480px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv05";
}
body.is-loading { opacity: 0; }

/* Scroll background backdrop + cursor particle field */
#bg {
  position: fixed; inset: 0; z-index: 0;
  background: #07070a;            /* dark at the top; JS scrubs opacity → bone shows */
  pointer-events: none;
}
#cursorfx {
  position: fixed; inset: 0; z-index: 35;   /* above content, below header */
  pointer-events: none;
}
/* The orb sits on top and inverts whatever it covers (unseen.co-style),
   so it never clips at a section edge and always keeps text legible. */
.hero__thermal {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 50;
  pointer-events: none; mix-blend-mode: difference; display: block;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

/* The sun, expressed once: a single precise disc. */
.dot {
  display: inline-block; width: 0.34em; height: 0.34em; border-radius: 50%;
  background: var(--ink); vertical-align: 0.18em; margin-left: 0.18em;
}

/* Micro label — the recurring technical detail */
.label {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Header ---------- */
.head {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem var(--pad);
  color: var(--ink);
  transition: color 0.5s var(--ease);
}
.head.on-dark { color: #f3f0e9; }   /* light over the dark hero; orb inverts it where it covers */
.head__brand { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; color: inherit; }
.head.on-dark .dot { background: #f3f0e9; }
.head__right { display: flex; align-items: center; gap: 1.8rem; }
.head__nav { display: flex; gap: 1.8rem; }
.head__nav a {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; color: inherit;
  position: relative; padding-bottom: 2px;
}
.head__nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.head__nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Sound toggle — animated equaliser */
.head__sound {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em;
}
.head__sound-bars { display: inline-flex; align-items: center; gap: 2px; height: 12px; }
.head__sound-bars i { display: block; width: 2px; height: 30%; background: currentColor; transition: height 0.3s var(--ease), opacity 0.3s; }
.head__sound[aria-pressed="true"] .head__sound-bars i { animation: eq 0.9s ease-in-out infinite; }
.head__sound[aria-pressed="true"] .head__sound-bars i:nth-child(2) { animation-delay: 0.18s; }
.head__sound[aria-pressed="true"] .head__sound-bars i:nth-child(3) { animation-delay: 0.36s; }
.head__sound[aria-pressed="false"] .head__sound-bars i { height: 22%; opacity: 0.45; }
@keyframes eq { 0%,100% { height: 25%; } 50% { height: 95%; } }

@media (max-width: 640px) {
  .head__right { gap: 1.1rem; }
  .head__nav { gap: 1.1rem; }
  .head__nav a:nth-child(2) { display: none; }
  .head__sound-label { display: none; }
}

/* ---------- Layout primitives ---------- */
main { position: relative; z-index: 1; }
section { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

.sect-head {
  position: relative; display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 1rem; margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.sect-head .rule {
  position: absolute; top: 0; left: 0; width: 100%; height: 1px;
  background: var(--ink); transform: scaleX(1); transform-origin: left;
}

/* ---------- Hero ---------- */
/* Full-bleed section; content stays on the shared max-width grid via __inner */
.hero {
  max-width: none; margin: 0; padding-left: 0; padding-right: 0;
  min-height: 100svh; display: flex;
}
.hero__inner {
  position: relative;
  flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(6rem, 14vh, 9rem) var(--pad) clamp(2rem, 5vh, 3.5rem);
  display: flex; flex-direction: column; justify-content: space-between;
}

/* Dark thermal hero — plain light text; the orb on top inverts it where it covers */
.hero--dark { color: #f3f0e9; position: relative; }
.hero--dark .hero__meta { color: rgba(243,240,233,0.62); border-top-color: rgba(243,240,233,0.22); }
.hero--dark .hero__avail { color: #f3f0e9; }
.hero--dark .hero__title { color: #f3f0e9; }
.hero--dark .hero__lead { color: rgba(243,240,233,0.66); }
.hero--dark .hero__cue { color: rgba(243,240,233,0.72); }
.hero__meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 0.9rem;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em; color: var(--muted);
}
.hero__avail { color: var(--ink); }
.hero__avail::before { content: "● "; font-size: 0.7em; vertical-align: 0.15em; }

.hero__title {
  font-weight: 500; font-size: clamp(2.4rem, 7.4vw, 7.2rem);
  line-height: 0.98; letter-spacing: -0.03em; max-width: 18ch;
  padding: clamp(2rem, 6vh, 4rem) 0;
}
.hero__title .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.16em; margin-bottom: -0.16em; }
.hero__title .word > span { display: inline-block; }

.hero__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.hero__lead { max-width: 44ch; color: var(--muted); font-size: clamp(0.98rem, 1.2vw, 1.15rem); line-height: 1.5; }
.hero__cue { display: inline-flex; align-items: baseline; gap: 0.6rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }
.hero__cue-no { transition: transform 0.5s var(--ease); }
.hero__cue:hover .hero__cue-no { transform: translateY(4px); }
@media (max-width: 640px) {
  .hero__meta { grid-template-columns: 1fr 1fr; gap: 0.7rem 1rem; }
}

/* ---------- Work index ---------- */
.work { padding-top: clamp(5rem, 12vh, 9rem); }
.index { list-style: none; }
.index:hover .row { opacity: 0.4; }      /* focus effect: dim the rest */
.index:hover .row:hover { opacity: 1; }
.index__item { border-top: 1px solid var(--line); }
.index__item:last-child { border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 22ch) 5rem;
  align-items: baseline; gap: 1.5rem;
  padding: clamp(1.1rem, 2.6vh, 1.9rem) 0;
  transition: opacity 0.4s var(--ease), padding-left 0.5s var(--ease);
}
.row:hover { padding-left: clamp(0.5rem, 1.5vw, 1.5rem); }
.row__no { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em; }
.row__name { font-size: clamp(1.4rem, 3.4vw, 2.7rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.row__disc { color: var(--muted); font-size: clamp(0.82rem, 1vw, 0.95rem); }
.row__status {
  justify-self: end; text-align: right; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink);
}
.row__status:empty::before { content: "→"; color: var(--muted); }
.row__thumb { display: none; }

@media (max-width: 820px) {
  .row {
    grid-template-columns: 2.5rem 1fr auto; grid-template-areas:
      "no name status" "thumb thumb thumb" "disc disc disc";
    row-gap: 0.9rem;
  }
  .row__no { grid-area: no; }
  .row__name { grid-area: name; font-size: clamp(1.3rem, 6vw, 2rem); }
  .row__status { grid-area: status; }
  .row__disc { grid-area: disc; }
  .row__thumb { grid-area: thumb; display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
  .index:hover .row { opacity: 1; }   /* no dim on touch */
}

/* Floating preview (desktop only) */
.preview {
  position: fixed; top: 0; left: 0; z-index: 30; pointer-events: none;
  width: clamp(240px, 24vw, 380px); aspect-ratio: 4/5;
  opacity: 0; will-change: transform;
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 820px) { .preview { display: none; } }

/* ---------- Capabilities ---------- */
.cap { padding-top: clamp(5rem, 12vh, 9rem); }
.cap__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.cap__lead { font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 400; line-height: 1.2; letter-spacing: -0.02em; max-width: 22ch; }
.cap__list { list-style: none; }
.cap__list li {
  display: flex; align-items: baseline; gap: 1rem; padding: clamp(0.9rem, 2vh, 1.4rem) 0;
  border-top: 1px solid var(--line); font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.01em;
}
.cap__list li:last-child { border-bottom: 1px solid var(--line); }
.cap__no { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
@media (max-width: 760px) { .cap__grid { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------- Approach ---------- */
.approach { padding-top: clamp(5rem, 12vh, 9rem); }
.approach__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 4rem); }
.appr { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.appr__no { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.appr h3 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); font-weight: 500; letter-spacing: -0.02em; margin: 1.4rem 0 0.7rem; }
.appr p { color: var(--muted); font-size: 0.98rem; line-height: 1.5; max-width: 32ch; }
@media (max-width: 760px) { .approach__grid { grid-template-columns: 1fr; gap: 2.2rem; } }

/* ---------- Words ---------- */
.words { padding-top: clamp(5rem, 12vh, 9rem); }
.quotes { list-style: none; }
.quote {
  display: grid; grid-template-columns: 1fr minmax(0, 18rem); gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start; padding: clamp(1.8rem, 4vh, 3rem) 0; border-top: 1px solid var(--line);
}
.quote:last-child { border-bottom: 1px solid var(--line); }
.quote blockquote { font-size: clamp(1.3rem, 2.6vw, 2.3rem); font-weight: 400; line-height: 1.22; letter-spacing: -0.02em; }
.quote cite { display: flex; flex-direction: column; gap: 0.2rem; font-style: normal; padding-top: 0.5rem; }
.quote cite span:first-child { font-family: var(--mono); font-size: 0.82rem; }
.quote cite span:last-child { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
@media (max-width: 760px) { .quote { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- Contact ---------- */
.contact { padding-top: clamp(5rem, 12vh, 9rem); padding-bottom: clamp(4rem, 10vh, 7rem); }
.contact__head { font-size: clamp(2.4rem, 7vw, 6.5rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.03em; margin: clamp(2rem, 5vh, 3rem) 0; max-width: 14ch; }
.contact__head .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.16em; margin-bottom: -0.16em; }
.contact__head .word > span { display: inline-block; }
.contact__mail {
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  font-size: clamp(1.3rem, 3vw, 2.4rem); font-weight: 400; letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line); padding-bottom: 0.3rem;
}
.contact__mail span { transition: transform 0.5s var(--ease); }
.contact__mail:hover span { transform: translateX(6px); }

.contact__meta { display: flex; gap: clamp(2rem, 8vw, 7rem); margin-top: clamp(3rem, 8vh, 5rem); flex-wrap: wrap; }
.contact__col { display: flex; flex-direction: column; gap: 0.4rem; }
.contact__col .label { margin-bottom: 0.5rem; }
.contact__col a, .contact__col p { font-size: 0.98rem; }
.contact__col a { width: fit-content; border-bottom: 1px solid transparent; transition: border-color 0.4s; }
.contact__col a:hover { border-color: var(--ink); }
.contact__col p { color: var(--muted); line-height: 1.5; }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.4rem var(--pad); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em; color: var(--muted);
}
.foot__brand { color: var(--ink); }
.foot a:hover { color: var(--ink); }

/* ---------- Reveal defaults ---------- */
[data-fade] { will-change: transform, opacity; }

/* =========================================================
   PROJECT (CASE) PAGES — same language as the landing page
   ========================================================= */

/* ---- Hero: same structure as the landing hero (light), then a clean full-width image ---- */
/* Project hero reuses .hero / .hero__inner / .hero__meta / .hero__title / .hero__foot. */
.case-back { color: var(--ink); }
.case-back:hover { color: var(--amber); }
.case-figure { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.case-figure__inner { overflow: hidden; background: var(--paper-2); }   /* sharp corners */
.case-figure img { width: 100%; height: auto; max-height: 82vh; object-fit: cover; display: block; }

/* Italic serif accent inside big statements — the one editorial flourish */
.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: 0; }

/* ---- Overview: big statement + facts ---- */
.case-overview { max-width: var(--maxw); margin: 0 auto; padding: clamp(4.5rem, 12vh, 8rem) var(--pad) 0; }
.case-overview__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.case-lead { font-size: clamp(1.4rem, 2.8vw, 2.4rem); font-weight: 400; line-height: 1.22; letter-spacing: -0.02em; }
.case-facts { display: flex; flex-direction: column; }
.case-facts > div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.case-facts > div:last-child { border-bottom: 1px solid var(--line); }
.case-facts dt { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.case-facts dd { font-size: 0.98rem; }
@media (max-width: 820px) { .case-overview__grid { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---- Problem / Solution (numbered two-column) ---- */
.case-text { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 10vh, 7rem) var(--pad) 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.case-block { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.case-block .label { display: block; margin-bottom: 1.2rem; }
.case-block p { font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.45; color: var(--ink); max-width: 42ch; }
@media (max-width: 760px) { .case-text { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---- Takeaways: a big closing statement ---- */
.case-take { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 10vh, 7rem) var(--pad) 0; }
.case-take .sect-head { margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }
.case-take__body { font-family: var(--display); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 3rem); line-height: 1.18; letter-spacing: -0.02em; max-width: 22ch; }
.case-take__body .serif { color: var(--amber); }

/* ---- Shots: alternating full-width / 2-col, clip-reveal + hover zoom ---- */
.shots { max-width: var(--maxw); margin: 0 auto; padding: clamp(4.5rem, 12vh, 8rem) var(--pad) 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }
.shot { overflow: hidden; background: var(--paper-2); }
.shot--full { grid-column: 1 / -1; }
.shot img:not(.shot__overlay) { width: 100%; height: auto; display: block; transition: transform 0.7s var(--ease); }
/* Paired shots share one module ratio so rows always align */
.shot:not(.shot--full) { aspect-ratio: 4 / 3; }
.shot:not(.shot--full) img:not(.shot__overlay) { height: 100%; object-fit: cover; }
.shot:hover img:not(.shot__overlay) { transform: scale(1.04); }

/* Layered shot: a photo with a typographic overlay image on top
   (reproduces the reference site's collage bands) */
.shot--layer { position: relative; }
.shot--crop { aspect-ratio: 16 / 10; }
.shot--crop img:not(.shot__overlay) { height: 100%; object-fit: cover; }
.shot__overlay {
  position: absolute; z-index: 1; pointer-events: none; height: auto; display: block;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.35));
}
.shot__overlay--left   { left: clamp(1rem, 6%, 4rem); top: 50%; transform: translateY(-50%); width: clamp(110px, 34%, 320px); }
.shot__overlay--right  { right: clamp(1rem, 6%, 4rem); top: 50%; transform: translateY(-50%); width: clamp(130px, 42%, 400px); }
.shot__overlay--center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(42%, 560px); }
.shot__overlay--mark   { left: 50%; top: 50%; transform: translate(-50%, -50%); width: clamp(140px, 26%, 380px); }  /* logotype / wordmark */
.shot__overlay--card   { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(71%, 980px);            /* browser screenshot card */
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.3)); }
@media (max-width: 720px) {
  .shot--crop { aspect-ratio: 4 / 3; }          /* taller bands so overlays stay readable */
  .shot__overlay--center { width: min(72%, 560px); }
  .shot__overlay--card { width: 86%; }
  .shot__overlay--mark { width: clamp(120px, 38%, 380px); }
}
@media (max-width: 720px) { .shots { grid-template-columns: 1fr; } .shot--full { grid-column: auto; } }

/* ---- CTA band ---- */
.case-cta { text-align: center; max-width: var(--maxw); margin: clamp(4rem, 12vh, 8rem) auto 0;
  padding: clamp(4rem, 10vh, 7rem) var(--pad); border-top: 1px solid var(--line); }
.case-cta .sect-head { text-align: left; }              /* labels keep the grid, only the copy centres */
.case-cta .contact__head { margin-left: auto; margin-right: auto; }

/* ---- Next project (image reveals faintly on hover) ---- */
.case-next {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 0.6rem; align-items: center; text-align: center;
  padding: clamp(4rem, 11vh, 7rem) var(--pad); border-top: 1px solid var(--line);
}
.case-next__img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; filter: grayscale(1); transform: scale(1.05); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
.case-next:hover .case-next__img { opacity: 0.22; transform: scale(1); }
.case-next .label { color: var(--muted); }
.case-next__name { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 6vw, 5rem); letter-spacing: -0.03em; transition: color 0.4s; }
.case-next:hover .case-next__name { color: var(--amber); }

/* Coming-soon page */
.soon { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--pad); gap: 1.5rem; }
.soon h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 8vw, 6rem); letter-spacing: -0.03em; line-height: 1; }
.soon p { color: var(--muted); max-width: 40ch; }
.soon__links { display: flex; gap: clamp(1.5rem, 4vw, 3rem); margin-top: 1rem; font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.02em; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
