/* ============================================================================
   Kirkton Labs — "Carbon & ember"
   A dark, machined, engineering-lab aesthetic. True-black substrate, a single
   warm ember accent, a characterful grotesque display over an engineered
   Plex sans/mono system. Restraint is the point.
   ========================================================================== */

:root {
  /* Substrate + surfaces */
  --void:        #08080a;
  --ink-900:     #0c0c0f;
  --surface:     #121216;
  --surface-2:   #17171c;
  --line:        #25252b;
  --line-bright: #34343d;

  /* Ink */
  --text:        #f4f1ea;
  --text-muted:  #9a978d;
  --text-faint:  #65635c;

  /* Ember accent */
  --ember:       #e8833a;
  --ember-hot:   #ff9d4d;
  --ember-deep:  #b5611f;
  --ember-glow:  rgba(232, 131, 58, 0.16);
  --error:       #e2635a;

  /* Type */
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --radius: 5px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }

::selection { background: var(--ember); color: #0a0a0b; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Ambient background layers ------------------------------------------- */
/* Faint engineering grid + an ember glow bleeding from the top-right. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 0%, transparent 75%);
}
.backdrop::before {
  content: "";
  position: absolute;
  top: -25vh;
  right: -10vw;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, var(--ember-glow) 0%, transparent 62%);
  filter: blur(20px);
}
/* Fine grain over everything to kill the digital flatness. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}
.section { padding-block: clamp(4.5rem, 11vw, 9rem); }

/* --- Mono kicker / labels ------------------------------------------------ */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.kicker::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--ember);
}
.kicker--bare::before { display: none; }

/* --- Navigation ---------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 3.5rem);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.wordmark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.wordmark .slash { color: var(--ember); margin-inline: 0.15em; }
.nav__links { display: flex; gap: 2rem; align-items: center; }
.nav__link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  padding-block: 0.2rem;
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--ember);
  transition: width 0.25s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__link.is-active { color: var(--text); }
.nav__cta { display: none; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 7rem;
  padding-bottom: 3rem;
}
.hero__eyebrow { margin-bottom: 2rem; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.7rem, 7.5vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--text);
  max-width: 16ch;
  margin-bottom: 1.8rem;
}
.hero__title .dot { color: var(--ember); }
.hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 2.6rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--ember);
  color: #0a0a0b;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--ember-hot);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px var(--ember-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-bright);
}
.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }

/* Index strip — the system manifest under the hero */
.manifest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.manifest__item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.2s var(--ease);
}
.manifest__item span { color: var(--ember); margin-right: 0.5em; }
.manifest__item:hover { color: var(--text); }

/* --- Studio intro -------------------------------------------------------- */
.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.studio__statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--text);
}
.studio__statement em { color: var(--ember); font-style: normal; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--ink-900); padding: 1.6rem 1.4rem; }
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat__num .u { color: var(--ember); }
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- Services ------------------------------------------------------------ */
.services__head { margin-bottom: clamp(2rem, 5vw, 4rem); }
.services__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 1.2rem;
}
.svc {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 2fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2.75rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.svc__index {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-bright);
  transition: -webkit-text-stroke-color 0.35s var(--ease), color 0.35s var(--ease);
}
.svc:hover .svc__index {
  -webkit-text-stroke-color: var(--ember);
  color: var(--ember-glow);
}
.svc__label { margin-bottom: 1rem; }
.svc__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.9rem;
}
.svc__pitch {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text);
  max-width: 48ch;
  margin-bottom: 1.8rem;
}
.svc__bullets {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 2rem;
  margin-bottom: 1.8rem;
}
.svc__bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.55;
}
.svc__bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--ember);
  font-size: 0.85em;
}
.svc__detail {
  border-left: 2px solid var(--ember);
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: 56ch;
}
.svc__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ember);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.svc__link:hover {
  color: var(--ember-hot);
  border-bottom-color: var(--ember-hot);
}
.svc__link:hover .arrow { transform: translateX(4px); }

/* --- Contact ------------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 1.2rem;
}
.contact__lede { margin-top: 1.4rem; max-width: 38ch; }
.contact__meta {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.contact__meta a { color: var(--ember); }
.contact__meta a:hover { color: var(--ember-hot); }
.contact__meta .label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.3rem;
}

/* Form */
.form {
  background: linear-gradient(180deg, var(--surface) 0%, var(--ink-900) 100%);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ember);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.field { margin-bottom: 1.5rem; }
.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.field__input,
.field textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field__input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field__input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-glow);
}
.field__error {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--error);
}

/* Segmented channel control */
.channel { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.channel__chip { position: relative; cursor: pointer; }
.channel__chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.channel__chip span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.18s var(--ease);
}
.channel__chip:hover span { border-color: var(--text-faint); color: var(--text); }
.channel__chip input:checked + span {
  border-color: var(--ember);
  color: var(--ember);
  background: var(--ember-glow);
}
.channel__chip input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }

.form__error-banner {
  background: rgba(226, 99, 90, 0.1);
  border: 1px solid rgba(226, 99, 90, 0.4);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: var(--error);
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}
.form__submit { width: 100%; justify-content: center; margin-top: 0.5rem; }
.form__note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
}

/* Honeypot — kept off-screen, hidden from AT + tab order */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 5rem) 2rem; }
.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.footer__contact { display: flex; flex-direction: column; gap: 0.4rem; }
.footer__contact a { color: var(--text); font-family: var(--font-mono); font-size: 0.9rem; }
.footer__contact a:hover { color: var(--ember); }
.footer__addr {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-faint);
  text-align: right;
}
/* Oversized ghost wordmark — the signature */
.footer__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 16vw, 13rem);
  line-height: 0.8;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  user-select: none;
  white-space: nowrap;
  margin-bottom: 2.5rem;
}
.footer__legal {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  line-height: 1.7;
}
.footer__legal .sep { color: var(--line-bright); }

/* --- Thanks page --------------------------------------------------------- */
.thanks {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
}
.thanks__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 1.5rem 0 1rem;
}
.thanks__lede { max-width: 44ch; margin-bottom: 2.4rem; }

/* --- Scroll reveal ------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Hero load stagger --------------------------------------------------- */
.load { opacity: 0; transform: translateY(16px); animation: rise 0.8s var(--ease) forwards; }
.load-1 { animation-delay: 0.05s; }
.load-2 { animation-delay: 0.15s; }
.load-3 { animation-delay: 0.25s; }
.load-4 { animation-delay: 0.35s; }
.load-5 { animation-delay: 0.45s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 820px) {
  .studio__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .svc { grid-template-columns: 1fr; gap: 0.5rem; }
  .svc__index { font-size: 3.2rem; }
  .svc__bullets { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__addr { text-align: left; }
}
@media (max-width: 520px) {
  .nav__links { gap: 1.2rem; }
  .stats { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .load { opacity: 1; transform: none; }
}
