/* =====================================================================
   STONE TO CODE — v2 "TRANSMUTATION"
   One WebGL particle field behind the page performs the studio's name:
   raw stone mass → fracture → order → proof → signal.
   Ground: obsidian. Stone state: ember copper. Code state: ultraviolet ice.
   Type: Clash Display (monument) · Satoshi (reading) · JetBrains Mono (labels).
   ===================================================================== */

:root{
  --void:      #1E212A;
  --void-2:    #191C23;
  --bone:      #E9E4DA;   /* reading light on slate */
  --bone-dim:  rgba(233,228,218,.62);
  --bone-faint:rgba(233,228,218,.28);
  --ink-halo:  0 1px 18px rgba(20,22,28,.85), 0 0 42px rgba(20,22,28,.55);
  --copper:    #77747C;   /* quiet slate-gray marks */
  --copper-hot:#E6C79E;   /* the one warm lamp accent */
  --violet:    #E6C79E;
  --violet-pale:#F2DFC2;

  --f-disp: 'Clash Display', 'Arial Narrow', sans-serif;
  --f-body: 'Satoshi', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --pad: clamp(1.4rem, 4vw, 4.5rem);
  --ease-out: cubic-bezier(.19, 1, .22, 1);
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ scrollbar-color: rgba(233,228,218,.25) #1E212A; }

body{
  background: linear-gradient(165deg, #23262F 0%, #1E212A 55%, #191C23 100%);
  color: var(--bone);
  font-family: var(--f-body);
  font-weight: 400;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection{ background: rgba(230,199,158,.28); color: #fff; }

a{ color: inherit; }

/* ---- the field: fixed scene behind everything ------------------------- */
.field{
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100dvh;
  pointer-events: none;
}
.field-poster{
  position: fixed; inset: 0; z-index: 0; display: none;
  background: var(--void) url("../assets/field-poster.webp") center / cover no-repeat;
}
body.static .field{ display:none; }
body.static .field-poster{ display:block; }

/* filmic grain above the scene, below the type */
.grain{
  position: fixed; inset: -60px; z-index: 1; pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- preloader --------------------------------------------------------- */
.loader{
  position: fixed; inset: 0; z-index: 50;
  background: var(--void);
  display: grid; place-content: center; justify-items: center;
  gap: 1.1rem;
  transition: opacity .8s ease .1s, visibility 0s .95s;
}
body[data-state="ready"] .loader{ opacity: 0; visibility: hidden; }
.loader__mark{
  font-family: var(--f-disp); font-weight: 600; font-size: 1.15rem;
  letter-spacing: .3em; color: var(--bone);
}
.loader__mark span{ color: var(--copper); padding-inline: .15em; }
.loader__count{
  font-family: var(--f-mono); font-size: .8rem; color: var(--bone-dim);
  font-variant-numeric: tabular-nums;
}
.loader__bar{ width: 132px; height: 1px; background: rgba(233,228,218,.14); overflow: hidden; }
.loader__bar i{
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, rgba(232,179,107,.55), rgba(217,138,138,.55),
    rgba(169,123,214,.55), rgba(111,143,217,.55), rgba(127,198,217,.55));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.loader__word{
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .42em;
  color: var(--bone-faint);
}

/* ---- custom cursor ------------------------------------------------------ */
.cursor{ display: none; }
@media (pointer:fine){
  .cursor{
    display: block; position: fixed; z-index: 60; top: 0; left: 0;
    pointer-events: none; mix-blend-mode: difference;
    opacity: 0; transition: opacity .4s ease;
  }
  .cursor.is-live{ opacity: 1; }
  .cursor i{
    display: block; width: 28px; height: 28px;
    margin: -14px 0 0 -14px;
    border: 1px solid rgba(255,255,255,.85); border-radius: 50%;
    transition: transform .35s var(--ease-out), background .35s ease;
  }
  .cursor.is-on i{
    transform: scale(1.9);
    background: rgba(255,255,255,.92);
  }
  body.has-cursor, body.has-cursor a{ cursor: none; }
}

/* ---- depth rail --------------------------------------------------------- */
.rail{
  position: fixed; right: calc(var(--pad) * .5); top: 50%; z-index: 10;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1.35rem;
}
.rail a{
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none;
  font-family: var(--f-mono); font-size: .56rem; letter-spacing: .3em;
  color: var(--bone-faint);
  transition: color .4s ease;
}
.rail a::before{
  content: ""; width: 14px; height: 1px;
  background: currentColor;
  transition: width .4s var(--ease-out);
}
.rail a span{ opacity: 0; transform: translateX(4px); transition: opacity .35s ease, transform .35s var(--ease-out); }
.rail a:hover span, .rail a:focus-visible span, .rail a.on span{ opacity: 1; transform: none; }
.rail a.on{ color: var(--copper-hot); }
.rail a.on::before{ width: 26px; }
.rail a.on ~ a.on{ color: var(--bone-faint); }
@media (max-width: 900px){ .rail{ display: none; } }

/* ---- top bar ------------------------------------------------------------ */
.top{
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(1rem, 2.2vw, 1.8rem) var(--pad);
}
.top::before{ /* scrim: content fades before it reaches the wordmark */
  content: ""; position: absolute; inset: 0; bottom: -55%;
  background: linear-gradient(rgba(20,22,28,.92) 30%, transparent);
  pointer-events: none; z-index: -1;
}
.top__mark{
  font-family: var(--f-disp); font-weight: 600; font-size: .92rem;
  letter-spacing: .22em; text-decoration: none; color: var(--bone);
}
.top__mark i{
  font-style: normal; color: var(--copper); padding-inline: .3em;
  transition: color .5s ease;
}
.top__nav{ display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); align-items: center; }
.top__nav a{
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .22em;
  text-transform: uppercase; text-decoration: none;
  color: var(--bone-dim);
  transition: color .3s ease;
}
.top__nav a:hover, .top__nav a:focus-visible{ color: var(--bone); }

/* ---- acts ---------------------------------------------------------------- */
main{ position: relative; z-index: 2; }
.act{
  position: relative;
  min-height: 100lvh;
  padding: clamp(6rem, 14vh, 9rem) var(--pad);
  display: flex; flex-direction: column; justify-content: center;
}

.label{
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--bone-dim);
  margin-bottom: clamp(2rem, 5vh, 3.6rem);
}
.kicker{
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--bone-dim);
}

/* ---- ACT I · MASS -------------------------------------------------------- */
.mass{ justify-content: space-between; padding-top: clamp(6rem, 16vh, 11rem); }

.mono-h{
  font-family: var(--f-disp);
  font-weight: 600;
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.015em;
  margin-block: auto;
  user-select: none;
}
.mono-h__row{ display: block; }
.mono-h__word{ display: inline-block; font-size: clamp(4.6rem, 16.5vw, 15.5rem); }
.mono-h__word--fill{ color: var(--bone); }
.mono-h__word--hollow{
  color: transparent;
  -webkit-text-stroke: clamp(1px, .14vw, 2px) var(--bone);
  margin-left: clamp(2.2rem, 12vw, 13rem);   /* the shifted seam */
}
.mono-h__row--mid{
  display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.4rem);
  padding-block: clamp(.7rem, 1.6vw, 1.4rem);
  margin-left: clamp(.3rem, 1.4vw, 1.2rem);
}
.mono-h__to{
  font-family: var(--f-mono); font-weight: 400;
  font-size: clamp(.7rem, 1.1vw, .95rem); letter-spacing: .55em;
  color: var(--copper-hot);
}
.mono-h__rule{
  height: 1px; width: clamp(6rem, 22vw, 22rem);
  background: linear-gradient(90deg, rgba(232,179,107,.55), rgba(217,138,138,.55),
    rgba(169,123,214,.55), rgba(111,143,217,.55), rgba(127,198,217,.55), transparent);
}

.mass__foot{
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 2rem; flex-wrap: wrap;
}
.mass__lead{
  max-width: 44ch;
  font-size: clamp(1rem, 1.25vw, 1.18rem); line-height: 1.65;
  font-weight: 400; color: var(--bone-dim);
  text-shadow: var(--ink-halo);
}
.mass__cue{
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  font-family: var(--f-mono); font-size: .58rem; letter-spacing: .32em;
  text-transform: uppercase; color: var(--bone-faint);
}
.mass__cue i{
  width: 1px; height: 54px;
  background: linear-gradient(var(--copper), transparent);
  animation: cue 2.6s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes cue{
  0%{ transform: scaleY(0); opacity: 0; }
  30%{ opacity: 1; }
  100%{ transform: scaleY(1); opacity: 0; }
}

/* ---- big editorial lines -------------------------------------------------- */
.bigline{
  font-family: var(--f-disp); font-weight: 500;
  font-size: clamp(1.7rem, 4.6vw, 4.3rem);
  line-height: 1.06; letter-spacing: -.01em;
  max-width: 22ch;
  color: var(--bone);
}
.bigline--turn{ color: var(--violet-pale); }
.bigline--dim{ color: var(--bone-dim); }

/* ---- ACT II · FRACTURE ----------------------------------------------------- */
.fracture__lines .bigline{ margin-bottom: clamp(.6rem, 1.6vw, 1.3rem); }
.fracture__body{
  margin-top: clamp(2.4rem, 6vh, 4rem);
  max-width: 46ch;
  font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.7;
  color: var(--bone-dim);
  text-shadow: var(--ink-halo);
}

/* ---- ACT III · ORDER · WORK ------------------------------------------------- */
.order__head{
  font-family: var(--f-disp); font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 4rem); line-height: 1.04;
  letter-spacing: -.01em; max-width: 18ch;
  margin-bottom: clamp(3.5rem, 9vh, 6.5rem);
}
.works{ list-style: none; display: flex; flex-direction: column; gap: clamp(5rem, 13vh, 9rem); }

.work{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: end;
}
.work:nth-child(2){ grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.work:nth-child(2) .work__media{ order: 2; }
.work:nth-child(2) .work__body{ order: 1; justify-self: end; text-align: left; }

.work__num{
  position: absolute; top: -0.55em; left: -.02em; z-index: -1;
  font-family: var(--f-disp); font-weight: 600;
  font-size: clamp(7rem, 17vw, 16rem); line-height: 1;
  color: rgba(233,228,218,.05);
  -webkit-text-stroke: 1.5px rgba(233,228,218,.34);
  pointer-events: none; user-select: none;
}
.work:nth-child(2) .work__num{ left: auto; right: -.02em; }

.work__media{
  display: block; position: relative; overflow: hidden;
  border: 1px solid rgba(233,228,218,.14);
  border-radius: 6px;
  background: rgba(16,16,24,.55);
  backdrop-filter: blur(6px);
  transform: perspective(1200px) rotateX(0) rotateY(0);
  transition: transform .8s var(--ease-out), border-color .5s ease;
}
.work__media img,
.work__media video{
  display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top;
  transform: scale(1.02);
  transition: transform 1.2s var(--ease-out), filter .8s ease;
  filter: saturate(.92) contrast(1.01);
}
.work__media.tilting{ transition: border-color .5s ease; } /* live tilt, smooth reset */
.work__media:hover, .work__media:focus-visible{ border-color: rgba(230,199,158,.55); }
.work__media:hover img, .work__media:focus-visible img,
.work__media:hover video, .work__media:focus-visible video{ transform: scale(1.06); filter: saturate(1.05); }

.work__name{
  font-family: var(--f-disp); font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.9rem); letter-spacing: -.01em;
}
.work__kind{
  margin-top: .5rem;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--copper-hot);
}
.work__story{
  margin-top: 1.2rem; max-width: 42ch;
  font-size: clamp(.96rem, 1.1vw, 1.06rem); line-height: 1.7;
  color: var(--bone-dim);
  text-shadow: var(--ink-halo);
}

/* reading glass: long copy gets a whisper of depth-of-field so it stays
   legible at ANY particle density — same material as the media cards */
.work__body, .fracture__body, .proof__body{
  background: rgba(16, 18, 26, .38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-left: -1.3rem;
  width: fit-content;
}
.work__link{
  display: inline-block; margin-top: 1.4rem;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--bone); text-decoration: none;
  padding-bottom: .35em;
  background: linear-gradient(90deg, rgba(232,179,107,.55), rgba(217,138,138,.55),
    rgba(169,123,214,.55), rgba(111,143,217,.55), rgba(127,198,217,.55))
    bottom left / 100% 1px no-repeat;
  transition: color .35s ease, background-size .5s var(--ease-out);
}
.work__link:hover, .work__link:focus-visible{ color: var(--violet-pale); }
.work__link--still{ background: none; color: var(--bone-faint); }

.work--text{ grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
.work--text .work__body{ grid-column: 1; }
.work--text .work__num{ left: auto; right: -.02em; }

/* ---- ACT IV · PROOF · STUDIO -------------------------------------------------- */
.proof__thesis{ margin-bottom: clamp(3.5rem, 9vh, 6rem); }
.proof__thesis .bigline{ max-width: 26ch; }

.proof__grid{
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2.4rem, 6vw, 6rem); align-items: start;
}
.proof__portrait{ max-width: 340px; }
.proof__portrait img{
  width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block;
  border-radius: 6px;
  filter: grayscale(1) contrast(1.04) brightness(.94);
  border: 1px solid rgba(233,228,218,.14);
}
.proof__portrait figcaption{ margin-top: 1.1rem; display: grid; gap: .35rem; }
.proof__name{ font-family: var(--f-disp); font-weight: 600; font-size: 1.12rem; }
.proof__role{
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .26em;
  text-transform: uppercase; color: var(--bone-dim);
}

.offers__label{
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--bone-dim);
  margin-bottom: .4rem;
}
.offers{ list-style: none; border-top: 1px solid rgba(233,228,218,.14); }
.offers__row{
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: baseline; gap: clamp(.9rem, 2.4vw, 2rem);
  padding-block: clamp(1rem, 2.2vh, 1.5rem);
  border-bottom: 1px solid rgba(233,228,218,.14);
}
.offers__row strong{
  font-family: var(--f-disp); font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.7rem); letter-spacing: -.005em;
  color: var(--bone);
}
.offers__row span{
  font-size: clamp(.94rem, 1.1vw, 1.05rem); line-height: 1.6;
  color: var(--bone-dim);
  text-shadow: var(--ink-halo);
}
.offers__how{
  margin-top: 1.3rem;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; line-height: 2;
  color: var(--copper-hot);
}

.proof__body{
  margin-top: clamp(2rem, 4.5vh, 3rem); max-width: 48ch;
  font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.7;
  color: var(--bone-dim);
  text-shadow: var(--ink-halo);
}

/* ---- ACT V · SIGNAL · CONTACT --------------------------------------------------- */
.signal{ justify-content: center; }
.signal__ask{
  font-family: var(--f-disp); font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 3.2rem); line-height: 1.08;
  letter-spacing: -.01em; max-width: 20ch;
  color: var(--bone);
}
.signal__mail{
  display: inline-block; width: fit-content;
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  font-family: var(--f-disp); font-weight: 600;
  font-size: clamp(1.7rem, 4.9vw, 4.6rem);
  letter-spacing: -.015em;
  color: var(--bone); text-decoration: none;
  padding-bottom: .12em;
  background: linear-gradient(90deg, rgba(232,179,107,.55), rgba(217,138,138,.55),
    rgba(169,123,214,.55), rgba(111,143,217,.55), rgba(127,198,217,.55))
    bottom left / 0% 2px no-repeat;
  transition: background-size .7s var(--ease-out), color .5s ease;
}
.signal__mail:hover, .signal__mail:focus-visible{
  background-size: 100% 2px;
  color: #fff;
}
.signal__note{
  margin-top: 1.4rem;
  font-size: clamp(.95rem, 1.1vw, 1.05rem); color: var(--bone-dim);
}

.foot{
  margin-top: clamp(5rem, 14vh, 9rem);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.2rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bone-faint);
}
.foot a{ color: var(--bone-dim); text-decoration: none; transition: color .3s ease; }
.foot a:hover, .foot a:focus-visible{ color: var(--violet-pale); }

/* ---- reveals ------------------------------------------------------------------ */
.reveal{
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.in{ opacity: 1; transform: none; }

/* split elements animate through their word masks only — no wrapper motion */
.reveal[data-split]{ opacity: 1; transform: none; }

/* word-split rows: each word slides out of its own mask */
[data-split] .w{
  display: inline-block; overflow: clip;
  vertical-align: bottom;
}
[data-split] .w > span{
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--wi) * 70ms);
}
[data-split].in .w > span{ transform: none; }

/* ---- keyboard focus ------------------------------------------------------------ */
a:focus-visible{
  outline: 1.5px solid var(--violet);
  outline-offset: 5px; border-radius: 2px;
}

/* ---- responsive ----------------------------------------------------------------- */
@media (max-width: 900px){
  .work, .work:nth-child(2), .work--text{
    grid-template-columns: 1fr;
    align-items: start;
  }
  .work:nth-child(2) .work__media{ order: 0; }
  .work:nth-child(2) .work__body{ justify-self: start; }
  .work__num{ font-size: clamp(6rem, 26vw, 9rem); top: -.5em; }
  .proof__grid{ grid-template-columns: 1fr; }
  .proof__portrait{ max-width: 280px; }
  .mono-h__word--hollow{
    margin-left: clamp(1.4rem, 9vw, 5rem);
    color: rgba(233,228,218,.09);   /* faint fill keeps the outline legible on particles */
  }
}
@media (max-width: 560px){
  .top__nav{ display: none; }
  .mass__cue{ display: none; }
  .bigline{ font-size: clamp(1.55rem, 7.4vw, 2.2rem); }
  .signal__mail{ font-size: clamp(1.05rem, 6vw, 2.4rem); overflow-wrap: anywhere; }
}

/* ---- reduced motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  .reveal, [data-split] .w > span{ opacity: 1; transform: none; transition: none; }
  .mass__cue i{ animation: none; }
  .loader{ transition: none; }
}
