/*
  workwithcrte.com — styled to the CRTE brand system used on crteagency.com.
  Tokens mirror crteagency.com (styles.css :root): paper #f7f6f2, surface #fff,
  ink #191817, cream-deep #edece7, error #8a3d36 / #d4a39d on ink.
  Type: Archivo (display), Inter (UI + body), Fraunces italic (accent).
*/
:root {
  --paper: #f7f6f2;
  --surface: #ffffff;
  --ink: #191817;
  --ink-raised: #211f1d;
  --cream-deep: #edece7;
  --wordmark-cream: #efeadf;

  --muted: rgba(25, 24, 23, 0.62);          /* muted-on-paper, 4.8:1 */
  --hairline: rgba(25, 24, 23, 0.14);       /* hairline-on-paper */
  --hairline-strong: rgba(25, 24, 23, 0.28);
  --control-border: rgba(25, 24, 23, 0.5);  /* 3.3:1 against paper */

  --on-ink: #f7f6f2;
  --muted-on-ink: rgba(247, 246, 242, 0.62);
  --hairline-on-ink: rgba(247, 246, 242, 0.18);

  --error: #8a3d36;
  --error-on-ink: #d4a39d;

  --font-display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-accent: "Fraunces", ui-serif, Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(28px, 5vw, 64px);
  --content: 1120px;
  --bar-h: 96px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 350ms var(--ease);
}
@media (min-width: 768px) { body { font-size: 17px; } }
body.in-form, body.is-done { background: var(--ink); }
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  border: 1px solid var(--hairline-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
}
[hidden] { display: none !important; }

/* Focus: 2px outline in the current text colour, as on crteagency.com */
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
a[href]:focus-visible, button:focus-visible { border-radius: 2px; }
.btn:focus-visible { border-radius: 999px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 60; background: var(--paper); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
}

/* ---------- Top bar: centered CRTE wordmark ---------- */
.shell {
  width: min(var(--content), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: center;
  padding-inline: var(--gutter);
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 1px solid var(--hairline-on-ink);
}
/* Full CRTE letters are 811×169. The old asset was cropped through the
   middle of the strokes, so a 42px box still showed only the top half. */
.wordmark {
  display: block;
  flex: 0 0 auto;
  align-self: center;
  width: calc(42px * 811 / 169);
  max-width: 100%;
  height: 42px;
  min-width: 0;
  min-height: 0;
  line-height: 0;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.wordmark img {
  display: block;
  width: 100%;
  height: 42px;
  max-width: none;
  object-fit: contain;
  object-position: center;
}
.wordmark:hover { opacity: 0.72; }

/* Progress: hairline track along the bottom edge of the ink bar */
.progress {
  position: fixed; left: 0; right: 0; top: calc(var(--bar-h) - 2px); height: 2px;
  z-index: 51; background: transparent; pointer-events: none;
}
body.is-done .progress { display: none; }
.progress-bar { height: 100%; width: 0; background: var(--on-ink); transition: width 0.5s var(--ease); }

/* ---------- Stage ---------- */
.stage {
  flex: 1; display: flex; flex-direction: column;
  justify-content: flex-start;
  container-type: inline-size;
  padding-top: clamp(28px, 4vh, 40px);
  padding-bottom: clamp(56px, 7vh, 88px);
}
.screen { width: 100%; }
#services, #studio, #contact { scroll-margin-top: calc(var(--bar-h) + 16px); }

/* Eyebrows and labels (t-eyebrow / t-label) */
.eyebrow, .split-label, .q-kicker {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500; line-height: 1;
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px;
}

/* ---------- Opener ---------- */
.intro, .thanks { text-align: center; }
.intro { padding-top: clamp(40px, 5vh, 56px); }
.intro .eyebrow { padding-left: 0.4em; margin-bottom: 36px; }
.intro-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(3.15rem, 11cqi, 7.25rem); line-height: 0.92; letter-spacing: -0.035em;
  text-wrap: balance; margin: 0 0 36px;
}
.intro-title em {
  font-family: var(--font-accent); font-style: italic; font-weight: 400; letter-spacing: -0.01em;
}
.intro-lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.6; font-weight: 400;
  color: var(--muted); max-width: 38rem; margin: 0 auto 48px; text-wrap: pretty;
}
.intro-actions {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center;
}
.intro-actions > :first-child { grid-column: 2; }
.intro-actions .hint { grid-column: 3; justify-self: start; margin-left: 20px; }
.intro-split {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px;
  width: 100%; margin-top: clamp(56px, 8vh, 88px); padding-top: 40px;
  border-top: 1px solid var(--hairline); text-align: center; counter-reset: division;
}
.intro-split > div { counter-increment: division; }
.intro-split > div::before {
  content: "0" counter(division);
  content: "0" counter(division) / "";
  display: block; margin-bottom: 18px;
  font-family: var(--font-accent); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem); line-height: 1; color: var(--muted);
}
.intro-split p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.intro-split .split-label {
  font-family: var(--font-display); font-size: clamp(1.375rem, 2.2vw, 2rem); font-weight: 600;
  line-height: 1.15; letter-spacing: -0.02em; text-transform: none; color: var(--ink); margin: 0 0 10px;
}
.noscript { margin-top: 24px; }

/* ---------- Buttons (crteagency.com "pill") ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; max-width: 100%; padding: 16px 26px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500; line-height: 1;
  letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap; text-decoration: none;
  transition: transform 0.3s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 640px) { .btn { letter-spacing: 0.25em; padding: 18px 34px; } }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { transform: scale(1.02) translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-text {
  background: none; border: 0; padding: 8px 0; font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}
.btn-text:hover { color: var(--ink); }
.hint { font-size: 13px; line-height: 1.4; color: var(--muted); }

/* ---------- Question card (crteagency.com marketing-plan card on ink) ---------- */
.form-screen {
  max-width: 760px;
  margin: clamp(32px, 7vh, 80px) auto;
  padding: 40px 44px 36px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(25, 24, 23, 0.14);
  border-radius: 14px;
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.8);
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.q { animation: rise 0.46s var(--ease) both; }
.q.back { animation-name: fall; }
.q.still { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fall { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.q-kicker {
  display: flex; align-items: center; gap: 8px; letter-spacing: 0.3em; margin-bottom: 24px;
  padding-bottom: 18px; border-bottom: 1px solid var(--hairline);
}
.q-kicker .num { color: var(--ink); }
.q-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 12px; outline: none;
}
.q-title em { font-family: var(--font-accent); font-weight: 400; letter-spacing: -0.01em; }
.q-help { color: var(--muted); margin: 0 0 28px; font-size: 15px; line-height: 1.55; max-width: 36em; }
.q-help strong { color: var(--ink); font-weight: 500; }

/* Options (mplan-option) */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt-group + .opt-group { margin-top: 26px; }
.opt-group-label {
  font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px; padding: 0;
}
.opts { display: grid; gap: 10px; }
.opts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px; min-height: 56px;
  background: transparent; border: 1px solid var(--hairline-strong); border-radius: 10px;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .opt-card:hover { border-color: var(--ink); transform: translateX(2px); }
  .opt-card:hover .check { opacity: 0.35; transform: none; }
  .chip span:hover { border-color: var(--ink); }
  .input:hover { border-color: rgba(25, 24, 23, 0.7); }
}
.opt input:focus-visible + .opt-card { outline: 2px solid var(--ink); outline-offset: 3px; }
.opt input:checked + .opt-card { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: none; }
.opt input:checked + .opt-card .opt-desc { color: var(--muted-on-ink); }
.opt input:checked + .opt-card .key { border-color: var(--hairline-on-ink); color: var(--paper); }
.key {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-top: 0;
  border: 1px solid var(--hairline-strong); border-radius: 6px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.04em; line-height: 1; color: var(--muted);
}
.opt-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt-title { font-weight: 500; font-size: 16px; line-height: 1.35; }
.opt-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.check {
  margin-left: auto; flex: none; opacity: 0; transform: translateX(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); font-size: 14px; line-height: 1.6;
}
.opt input:checked + .opt-card .check { opacity: 1; transform: none; }
.opt.flash .opt-card { animation: flash 0.32s ease 2; }
@keyframes flash { 50% { opacity: 0.6; } }

/* Text fields (crteagency.com field treatment) */
.fields { display: grid; gap: 22px; }
.field > label, .field > .label {
  display: block; font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding: 0;
}
.field .opt-in { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.input {
  width: 100%; border: 1px solid var(--control-border); border-radius: 3px;
  background: rgba(25, 24, 23, 0.04);
  padding: 12px 14px; font-size: 1.0625rem; line-height: 1.4; color: var(--ink); caret-color: var(--ink);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder { color: rgba(25, 24, 23, 0.45); }
.input:focus { border-color: var(--ink); background: rgba(25, 24, 23, 0.06); box-shadow: 0 0 0 3px rgba(25, 24, 23, 0.14); }
textarea.input { resize: vertical; min-height: 116px; line-height: 1.5; }
.input[aria-invalid="true"] {
  border-color: var(--error); background: rgba(138, 61, 54, 0.08); box-shadow: inset 3px 0 0 0 var(--error);
}
.input[aria-invalid="true"]:focus { box-shadow: inset 3px 0 0 0 var(--error), 0 0 0 3px rgba(138, 61, 54, 0.2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* Chips (mplan-chip) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--hairline-strong); background: transparent; font-size: 14px; line-height: 1.1; cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Inline validation (field-error) */
.error {
  display: flex; align-items: center; gap: 10px;
  color: var(--error); font-size: 12px; font-weight: 500; line-height: 1.5;
  letter-spacing: 0.08em; text-transform: uppercase; margin: 18px 0 0;
}
.error::before { content: ""; flex: none; width: 3px; align-self: stretch; min-height: 16px; background: var(--error); border-radius: 2px; }
.error:empty { display: none; }

/* Nav */
.q-nav {
  display: flex; align-items: center; gap: 16px; margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--hairline); flex-wrap: wrap;
}
.q-nav .spacer { flex: 1; }

/* Submit failure (form-error-summary) */
.fail {
  margin-top: 22px; padding: 14px 16px; border-radius: 3px; color: var(--ink); font-size: 15px; line-height: 1.55;
  background: rgba(138, 61, 54, 0.07); border: 1px solid rgba(138, 61, 54, 0.28); border-left: 3px solid var(--error);
}
.fail p { margin: 0 0 6px; }
.fail p:last-child { margin: 0; }
.fail strong { color: var(--error); font-weight: 600; }
.fail a { font-weight: 500; color: var(--ink); text-underline-offset: 3px; }

/* ---------- Thank you (ink surface, like the crteagency.com footer) ---------- */
body.is-done .form-screen {
  max-width: 1120px; margin: 0 auto; padding: clamp(40px, 8vh, 96px) 0 clamp(40px, 7vh, 88px);
  background: transparent; color: var(--on-ink); border: 0; border-radius: 0; box-shadow: none;
}
.thanks .eyebrow { color: var(--muted-on-ink); }
.thanks .intro-title { font-size: clamp(3rem, 10cqi, 6.5rem); }
.thanks .intro-lede { color: var(--muted-on-ink); }
.thanks .btn-ghost { color: var(--on-ink); border-color: var(--hairline-on-ink); }
.thanks .btn-ghost:hover { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); }
.contact-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
  margin: clamp(48px, 9vh, 96px) auto 0; padding-top: 28px; border-top: 1px solid var(--hairline-on-ink);
  width: 100%; text-align: center;
}
.contact-grid p { margin: 0; }
.contact-grid .split-label { color: var(--muted-on-ink); letter-spacing: 0.3em; margin-bottom: 14px; }
.contact-grid a {
  font-family: var(--font-display); font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 500;
  letter-spacing: -0.01em; text-decoration: none; overflow-wrap: anywhere; transition: opacity 0.2s var(--ease);
}
.contact-grid a:hover { opacity: 0.6; }

/* ---------- Footer (ink) ---------- */
.footer {
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--muted-on-ink);
  font-family: var(--font-sans); font-size: 11px; font-weight: 400; line-height: 1.4;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 28px; text-align: center;
}
body.is-done .footer { border-top: 1px solid var(--hairline-on-ink); }
.footer a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 2px; text-decoration: none; color: var(--on-ink);
  white-space: nowrap; transition: opacity 0.2s var(--ease);
}
.footer a:hover { opacity: 0.6; }
body.in-form .footer { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --bar-h: 76px; }
  html { scroll-padding-bottom: 112px; }
  body.in-form .stage { padding-top: 20px; padding-bottom: 20px; }
  .intro { padding-top: 48px; }
  .intro .eyebrow { margin-bottom: 24px; }
  .intro-title { margin-bottom: 24px; }
  .intro-lede { margin-bottom: 32px; }
  .intro-split { margin-top: 40px; gap: 32px; padding-top: 28px; }
  .intro-split p { font-size: 14px; line-height: 1.55; }
  .footer { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .footer-inner { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 0; }
  .footer a { font-size: 10px; letter-spacing: 0.06em; }
  .intro-split, .contact-grid { grid-template-columns: 1fr; }
  .intro-split > div::before { margin-bottom: 12px; }
  .opts.cols { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .form-screen {
    margin: 14px auto calc(104px + env(safe-area-inset-bottom));
    padding: 24px 20px 28px; border-radius: 12px;
  }
  .q-kicker { margin-bottom: 20px; padding-bottom: 14px; }
  .q-help { margin-bottom: 22px; }
  .q-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: rgba(247, 246, 242, 0.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--hairline);
  }
  .q-nav .btn { padding: 14px 22px; min-height: 48px; }
  .intro .hint, .q-nav .hint, .q .hint { display: none; }
  .q-nav .btn-primary { flex: 1; }
  .key { display: none; }
  body.is-done .form-screen { margin: 0 auto; padding: 36px 0 44px; }
}

/* Keyboard hints are meaningless on touch-only devices */
@media (hover: none) and (pointer: coarse) {
  .hint { display: none; }
}

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