/* ==========================================================================
   STOMITH DESIGN — homepage
   palette: bone on graphite, with one acid-lime accent.
   type:    Instrument Serif (italic display) · JetBrains Mono (everything else)
   ========================================================================== */

:root {
  --bg:        #08090b;
  --bg-2:      #0d0f12;
  --line:      #2f3742;
  --line-2:    #4a5663;
  --fg:        #f4f3ee;
  --fg-dim:    #c6c9c2;
  --fg-faint:  #8d978a;
  --acid:      #c8ff00;
  --acid-bright: #dcff4a;
  --acid-soft: rgba(200, 255, 0, 0.16);
  --warn:      #ff4d2e;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease:    cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --pad-x: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus-visible { outline: 1px solid var(--acid); outline-offset: 3px; }

html, body { background: var(--bg); color: var(--fg); }
html { scroll-behavior: smooth; }
body {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}
body::selection, ::selection { background: var(--acid); color: #0a0b0e; }

a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: none; }
input, textarea { color: inherit; font: inherit; background: none; border: 0; cursor: none; }

/* ----- background atmospherics ----------------------------------------- */
.grain {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9998;
  mix-blend-mode: overlay; opacity: 0.35;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 9997;
  background:
    radial-gradient(120% 80% at 50% 100%, transparent 50%, rgba(0,0,0,.7) 100%),
    radial-gradient(120% 80% at 50% 0%, transparent 60%, rgba(0,0,0,.5) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}

/* three.js canvas */
#bg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  display: block;
}

/* ----- custom cursor ---------------------------------------------------- */
.cursor {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  mix-blend-mode: difference;
}
.cursor__dot {
  position: absolute; width: 4px; height: 4px; background: var(--acid);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.cursor__ring {
  position: absolute; width: 32px; height: 32px;
  border: 1px solid rgba(232, 230, 223, 0.6); border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.cursor.is-hover .cursor__ring {
  width: 54px; height: 54px; border-color: var(--acid);
}
@media (pointer: coarse) {
  body, button, input, textarea, a { cursor: auto; }
  .cursor { display: none; }
}

/* ----- nav -------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 20px var(--pad-x);
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.04em;
  text-transform: lowercase;
  background: linear-gradient(180deg, rgba(8,9,11,0.85) 0%, rgba(8,9,11,0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.nav__center { display: flex; gap: 28px; justify-self: center; }
.nav__center a { position: relative; padding: 4px 0; color: var(--fg-dim); transition: color .3s var(--ease); }
.nav__center a:hover { color: var(--fg); }
.nav__center a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--acid); transition: right .35s var(--ease);
}
.nav__center a:hover::after { right: 0; }
.nav__right { justify-self: end; display: flex; gap: 20px; color: var(--fg-dim); }
.meta { display: inline-flex; align-items: center; gap: 6px; }
.meta--blink::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acid);
  box-shadow: 0 0 8px var(--acid); animation: blink 1.6s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo__mark {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  color: var(--acid);
  animation: spin 12s linear infinite;
}
.logo__type {
  font-family: var(--mono);
  letter-spacing: 0.12em; text-transform: lowercase;
  font-weight: 500;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- HERO ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 96px var(--pad-x) 64px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  z-index: 1;
  overflow: hidden;
}

/* corner tick frame */
.hero__frame { position: absolute; inset: 80px var(--pad-x) 40px; pointer-events: none; z-index: 1; }
.tick {
  position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--line-2);
}
.tick--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.tick--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.tick--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.tick--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* huge wordmark behind the 3D */
.wordmark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(96px, 22vw, 360px);
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-align: center;
  color: var(--fg);
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: difference;
  user-select: none;
  white-space: nowrap;
}
.wordmark__line { display: block; }
.wordmark__line--italic em {
  font-style: italic;
  color: var(--acid);
  font-weight: 400;
}

/* side rails */
.rail {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
  font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--fg-faint);
  text-transform: lowercase;
  z-index: 3;
  writing-mode: vertical-rl;
}
.rail span { white-space: nowrap; }
.rail--left  { left: calc(var(--pad-x) + 6px); transform: translateY(-50%) rotate(180deg); }
.rail--right { right: calc(var(--pad-x) + 6px); }
@media (max-width: 900px) { .rail { display: none; } }

/* hero copy */
.hero__copy {
  position: relative;
  z-index: 3;
  align-self: end;
  max-width: 640px;
  display: grid;
  gap: 22px;
}
.hero__copy::before {
  content: "";
  position: absolute;
  inset: -32px -48px -32px -48px;
  background: radial-gradient(
    ellipse at 30% 60%,
    rgba(8, 9, 11, 0.85) 0%,
    rgba(8, 9, 11, 0.55) 40%,
    transparent 80%
  );
  z-index: -1;
  pointer-events: none;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--acid); text-transform: uppercase;
}
.kicker__dot {
  width: 6px; height: 6px; background: var(--acid); border-radius: 50%;
  box-shadow: 0 0 12px var(--acid);
}
.tagline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5.5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--fg);
  max-width: 14ch;
}
.tagline em {
  font-style: italic;
  color: var(--acid);
}
.lede {
  max-width: 48ch;
  color: var(--fg-dim);
  font-size: 14.5px; line-height: 1.7;
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px;
}

/* buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.1em; text-transform: lowercase;
  border: 1px solid var(--line-2);
  background: rgba(13, 15, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
  isolation: isolate;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--acid);
  transform: translateY(102%);
  transition: transform .5s var(--ease-io);
}
.btn:hover { color: #0a0b0e; border-color: var(--acid); }
.btn:hover::before { transform: translateY(0); }
.btn__arrow { transition: transform .4s var(--ease); }
.btn:hover .btn__arrow { transform: translate(4px, -2px); }
.btn--primary { color: var(--fg); border-color: var(--acid); }
.btn--primary::before { background: var(--acid); }
.btn--ghost { color: var(--fg-dim); }
.btn--lg { padding: 18px 28px; font-size: 13px; }

/* scroll hint */
.scroll-hint {
  position: absolute; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--fg-faint);
  z-index: 3;
}
.scroll-hint__line {
  width: 1px; height: 44px;
  background: linear-gradient(180deg, var(--fg-faint), transparent);
  animation: drip 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drip {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

/* ----- section heads --------------------------------------------------- */
.section__head {
  display: grid; gap: 14px;
  padding: 0 var(--pad-x);
  margin: 0 auto;
  max-width: 1280px;
}
.section__head--center { text-align: center; justify-items: center; }
.section__num {
  font-size: 11px; letter-spacing: 0.2em; color: var(--acid); text-transform: uppercase;
}
.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.section__title--big { font-size: clamp(48px, 8vw, 120px); }
.section__title em { font-style: italic; color: var(--acid); }
.section__sub { max-width: 52ch; color: var(--fg-dim); font-size: 13.5px; }
.section__head--center .section__sub { margin-inline: auto; }

/* ----- SERVICES -------------------------------------------------------- */
.services {
  position: relative;
  background: var(--bg);
  padding: 160px 0 120px;
  z-index: 5;
  border-top: 1px solid var(--line);
}
.services::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

.svc {
  list-style: none;
  margin: 80px auto 0;
  max-width: 1280px;
  padding: 0 var(--pad-x);
  border-top: 1px solid var(--line);
}
.svc__item {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: 38px 0;
  border-bottom: 1px solid var(--line);
  transition: padding .4s var(--ease);
  cursor: none;
}
.svc__item::before {
  content: ""; position: absolute; left: -16px; right: -16px; top: 0; bottom: 0;
  background: var(--acid-soft); opacity: 0;
  transition: opacity .4s var(--ease);
  z-index: -1;
}
.svc__item:hover { padding-left: 16px; padding-right: 16px; }
.svc__item:hover::before { opacity: 1; }
.svc__num {
  font-family: var(--mono);
  font-size: 14px; letter-spacing: 0.08em; color: var(--acid);
}
.svc__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.svc__title em { font-style: italic; color: var(--acid); }
.svc__desc { color: var(--fg-dim); max-width: 56ch; font-size: 14.5px; line-height: 1.7; }
.svc__tags {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-size: 10.5px; letter-spacing: 0.1em; color: var(--fg-faint);
  text-transform: lowercase; text-align: right;
  min-width: 110px;
}
.svc__tags span::before { content: "/ "; color: var(--line-2); }

@media (max-width: 720px) {
  .svc__item { grid-template-columns: 56px 1fr; }
  .svc__tags { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-start; text-align: left; }
}

/* ----- CONTACT --------------------------------------------------------- */
.contact {
  position: relative;
  padding: 160px var(--pad-x) 140px;
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.contact::before {
  content: ""; position: absolute;
  left: 50%; top: 30%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--acid-soft), transparent 60%);
  transform: translate(-50%, -50%);
  filter: blur(40px);
  z-index: -1;
}
.contact__inner { max-width: 880px; margin: 0 auto; }
.contact .section__head { padding: 0; }

.form {
  display: grid;
  gap: 36px;
  margin-top: 80px;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }

.field {
  position: relative;
  display: grid;
  gap: 8px;
}
.field__label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  text-transform: uppercase;
}
.field input,
.field textarea {
  width: 100%;
  padding: 10px 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--fg);
  resize: none;
}
.field textarea { font-family: var(--mono); font-size: 14.5px; line-height: 1.55; padding-top: 4px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-faint); font-style: italic; }
.field__line {
  display: block;
  position: relative;
  height: 1px; background: var(--line-2);
}
.field__line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--acid);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-io);
}
.field:focus-within .field__line::after { transform: scaleX(1); }
.field:focus-within .field__label { color: var(--acid); }

.form__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.form__note {
  font-size: 11px; color: var(--fg-faint); max-width: 36ch; line-height: 1.6;
}

/* ----- FOOTER ---------------------------------------------------------- */
.foot {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px;
  padding: 56px var(--pad-x) 40px;
  border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--fg-faint);
  background: var(--bg-2);
  position: relative; z-index: 5;
}
.foot__col p { margin-top: 6px; }
.foot__col a { color: var(--fg); border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.foot__col a:hover { color: var(--acid); border-color: var(--acid); }
.foot__col--right { text-align: right; }
@media (max-width: 720px) {
  .foot { grid-template-columns: 1fr; }
  .foot__col--right { text-align: left; }
}

/* ----- reveal on load -------------------------------------------------- */
.hero__copy > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .9s var(--ease) forwards;
}
.hero__copy > *:nth-child(1) { animation-delay: 0.40s; }
.hero__copy > *:nth-child(2) { animation-delay: 0.55s; }
.hero__copy > *:nth-child(3) { animation-delay: 0.75s; }
.hero__copy > *:nth-child(4) { animation-delay: 0.95s; }
.wordmark { opacity: 0; animation: rise 1.4s var(--ease) 0.15s forwards; }
.rail { opacity: 0; animation: rise 1s var(--ease) 1.1s forwards; }
.nav    { opacity: 0; animation: rise .8s var(--ease) 0.05s forwards; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----- mobile (<=640px) ------------------------------------------------- */
@media (max-width: 640px) {
  /* nav: collapse to logo + section links; hide decorative meta */
  .nav { grid-template-columns: auto 1fr; gap: 16px; padding: 14px var(--pad-x); }
  .nav__center { justify-self: end; gap: 18px; }
  .nav__right { display: none; }

  /* wordmark: allow wrap, smaller floor, slightly less negative tracking */
  .wordmark {
    font-size: clamp(64px, 19vw, 360px);
    letter-spacing: -0.03em;
    white-space: normal;
    line-height: 0.88;
    padding: 0 8px;
  }

  /* hero: tighten top padding so the wordmark sits under the nav cleanly */
  .hero { padding-top: 84px; }

  /* hero copy: drop the bleeding ellipse to keep clear of the gutter */
  .hero__copy::before { inset: -20px -16px -20px -16px; }

  /* services / contact: trim the very large section padding */
  .services { padding: 100px var(--pad-x); }
  .contact  { padding: 110px var(--pad-x) 90px; }
}
