/* ==========================================================================
   Flow State Technologies — flowstatetechnologies.io
   One stylesheet, no build step. Change design tokens in :root, not in rules.

   Palette is "Ink & Signal": a near-black engineered base with a single
   saturated signal-orange accent. Deliberately distinct from the old
   flowstateconsulting.com teal.
   ========================================================================== */

:root {
  /* — surface & text ------------------------------------------------------ */
  --ink:        #0B0D12;   /* page base            */
  --ink-2:      #11141B;   /* raised band          */
  --surface:    #161A23;   /* cards                */
  --surface-2:  #1D222D;   /* card hover / chips   */
  --line:       #262C39;   /* hairlines            */
  --line-soft:  #1B2029;

  --text:       #E8EBF2;
  --text-2:     #A7AFC0;   /* secondary copy       */
  --text-3:     #82899A;   /* meta, placeholders   */

  /* — accent ------------------------------------------------------------- */
  --signal:     #FF6B35;
  --signal-2:   #FF8B5E;
  --signal-ink: #1A0B04;   /* text on signal fill  */
  --signal-dim: rgba(255, 107, 53, 0.12);

  /* — type --------------------------------------------------------------- */
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--1: clamp(0.82rem, 0.80rem + 0.10vw, 0.88rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.38vw, 1.42rem);
  --step-2:  clamp(1.52rem, 1.34rem + 0.85vw, 2.05rem);
  --step-3:  clamp(1.95rem, 1.58rem + 1.75vw, 3.00rem);
  --step-4:  clamp(2.45rem, 1.72rem + 3.40vw, 4.40rem);

  /* — space -------------------------------------------------------------- */
  --gap:    1rem;
  --gap-2:  1.5rem;
  --gap-3:  2.5rem;
  --gap-4:  4rem;
  --gap-5:  6.5rem;
  --gutter: 1rem;          /* phone side gutter    */
  --max:    68rem;

  --radius:   14px;
  --radius-s: 9px;
}

/* Light mode. Same tokens, re-pointed — no rule below needs to know. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink:        #FBFAF8;
    --ink-2:      #F4F2EE;
    --surface:    #FFFFFF;
    --surface-2:  #F4F2EE;
    --line:       #E2DED6;
    --line-soft:  #EDEAE3;

    --text:       #14171D;
    --text-2:     #4E5564;
    --text-3:     #676F7F;

    --signal:     #C54118;
    --signal-2:   #A5340F;
    --signal-ink: #FFFFFF;
    --signal-dim: rgba(197, 65, 24, 0.10);
  }
}

:root[data-theme="light"] {
  --ink:        #FBFAF8;
  --ink-2:      #F4F2EE;
  --surface:    #FFFFFF;
  --surface-2:  #F4F2EE;
  --line:       #E2DED6;
  --line-soft:  #EDEAE3;

  --text:       #14171D;
  --text-2:     #4E5564;
  --text-3:     #676F7F;

  --signal:     #C54118;
  --signal-2:   #A5340F;
  --signal-ink: #FFFFFF;
  --signal-dim: rgba(197, 65, 24, 0.10);
}

/* ── reset ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--signal); text-decoration: none; }
a:hover { color: var(--signal-2); }

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

.mono { font-family: var(--mono); font-size: 0.92em; }
.accent { color: var(--signal); }

/* Clip-based hiding rather than a -9999px offset, so the link never
   participates in layout width. */
.skip {
  position: absolute; top: 0; left: 0; z-index: 99;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  padding: 0; border-radius: 0 0 var(--radius-s) 0;
  background: var(--signal); color: var(--signal-ink); font-weight: 600;
}
.skip:focus {
  width: auto; height: auto; overflow: visible;
  clip-path: none; padding: 0.6rem 1rem; color: var(--signal-ink);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 40rem) { :root { --gutter: 2rem; } }

/* ── masthead ────────────────────────────────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);                                    /* fallback */
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap); min-height: 62px;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark rect { fill: var(--signal); }
.brand-mark path { stroke: var(--signal-ink); }
.brand-text {
  font-family: var(--display); font-weight: 700;
  font-size: var(--step-0); letter-spacing: -0.02em; white-space: nowrap;
}
.brand-dim { color: var(--text-3); font-weight: 500; }
@media (max-width: 30rem) { .brand-dim { display: none; } }

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  color: var(--text-2); font-size: var(--step--1); font-weight: 500;
  padding: 0.45rem 0.6rem; border-radius: var(--radius-s);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav-cta {
  color: var(--signal) !important;
  border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent);
}
.nav-cta:hover { background: var(--signal-dim) !important; }
@media (max-width: 34rem) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ── hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding-block: var(--gap-4) var(--gap-4);
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(60rem 26rem at 12% -10%, var(--signal-dim), transparent 70%),
    var(--ink);
}
@media (min-width: 48rem) { .hero { padding-block: var(--gap-5) var(--gap-4); } }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-3);
  margin-bottom: var(--gap);
}

.hero-title { font-size: var(--step-4); font-weight: 700; max-width: 22ch; }
/* The hard breaks shape the headline on wide screens; on phones they fight the
   natural wrap, so drop them and let the text find its own lines. */
@media (max-width: 40rem) { .hero-title br { display: none; } }
.hero-lede {
  margin-top: var(--gap-2);
  font-size: var(--step-1);
  color: var(--text-2);
  max-width: 54ch;
  line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--gap-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 1.25rem;
  border-radius: var(--radius-s);
  font-weight: 600; font-size: var(--step-0);
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--signal); color: var(--signal-ink); }
.btn-primary:hover { background: var(--signal-2); color: var(--signal-ink); }
.btn-ghost { color: var(--text); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--text-3); }

/* signature element: a hairline carrying a slow signal pulse */
.signal {
  position: relative; overflow: hidden;
  height: 1px; margin-top: var(--gap-4);
  background: linear-gradient(90deg, var(--line), transparent);
}
.signal-pulse {
  position: absolute; inset-block: 0; left: 0;
  width: 22%; border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  animation: travel 7s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes travel {
  0%   { transform: translateX(-100%); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(460%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .signal-pulse { animation: none; opacity: .5; }
}

/* ── practices ───────────────────────────────────────────────────────────── */

.practices { padding-block: var(--gap-4); }
.grid-2 { display: grid; gap: var(--gap-3); }
@media (min-width: 46rem) { .grid-2 { grid-template-columns: 1fr 1fr; gap: var(--gap-4); } }

.practice-tag {
  font-family: var(--mono); font-size: var(--step--1);
  color: var(--signal); letter-spacing: 0.04em; margin-bottom: 0.5rem;
}
.practice h2 { font-size: var(--step-2); margin-bottom: 0.7rem; }
.practice p { color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: var(--gap-2); }
.chips li {
  font-family: var(--mono); font-size: 0.76rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: 0.25rem 0.55rem; border-radius: 999px;
}

/* ── sections ────────────────────────────────────────────────────────────── */

.section { padding-block: var(--gap-4); border-top: 1px solid var(--line-soft); }
@media (min-width: 48rem) { .section { padding-block: var(--gap-5); } }
.section-alt { background: var(--ink-2); }

.section-head { max-width: 58ch; margin-bottom: var(--gap-3); }
.section-title { font-size: var(--step-3); font-weight: 700; }
.section-lede { margin-top: var(--gap); color: var(--text-2); font-size: var(--step-1); line-height: 1.55; }

/* ── cards ───────────────────────────────────────────────────────────────── */

.cards { display: grid; gap: var(--gap-2); }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--gap-2);
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--signal) 45%, var(--line)); }
@media (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-2px); }
}
.card-ph { border-style: dashed; background: transparent; }

.card-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.35rem var(--gap); margin-bottom: 0.7rem;
  /* the platform chip drops to its own line before it can widen the card */
  flex-wrap: wrap;
}
.card-top h3 { font-size: var(--step-1); }
.card-plat {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--signal); white-space: nowrap; margin: 0;
  letter-spacing: 0.04em;
}
.card-plat-soft { color: var(--text-3); }

.card-body { color: var(--text-2); font-size: var(--step-0); flex: 1 1 auto; }
.card-body-ph { color: var(--text-3); font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; }

.card-links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: var(--gap-2) 0 0; }
.link { font-size: var(--step--1); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-pending {
  font-family: var(--mono); font-size: 0.74rem;
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: 999px; padding: 0.2rem 0.6rem;
}

.scaffold-note {
  margin-top: var(--gap-3);
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--signal);
  background: var(--signal-dim);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--text-2);
  font-size: var(--step--1);
}
.scaffold-note .mono { color: var(--signal); font-weight: 500; }

/* ── studio ──────────────────────────────────────────────────────────────── */

.studio { display: grid; gap: var(--gap-3); }
@media (min-width: 52rem) { .studio { grid-template-columns: 1.6fr 1fr; gap: var(--gap-4); } }
.studio-body p { color: var(--text-2); margin-top: var(--gap); }
.studio-body .section-title { margin-bottom: 0.2rem; }

.facts { margin: 0; display: grid; gap: 0; align-content: start; }
.facts > div {
  display: grid; gap: 0.15rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3);
}
.facts dd { margin: 0; color: var(--text); font-size: var(--step--1); font-weight: 500; }

/* ── contact ─────────────────────────────────────────────────────────────── */

.contact { max-width: 56ch; }
.contact-mail { margin-top: var(--gap-3); }
.mail {
  display: inline-block; max-width: 100%;
  font-family: var(--display); font-weight: 600;
  font-size: var(--step-1); letter-spacing: -0.02em;
  border-bottom: 2px solid var(--signal-dim);
  /* long address, narrow phones: break rather than force a scrollbar */
  overflow-wrap: anywhere;
}
@media (min-width: 34rem) { .mail { font-size: var(--step-2); overflow-wrap: normal; } }
.mail:hover { border-bottom-color: var(--signal); }
.contact-note { margin-top: var(--gap-2); color: var(--text-3); font-size: var(--step--1); }

/* ── footer ──────────────────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); padding-block: var(--gap-3); }
.foot-in {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--gap) var(--gap-2);
}
.foot-brand {
  margin: 0; font-family: var(--display); font-weight: 600;
  font-size: var(--step--1); color: var(--text);
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.foot-nav a { color: var(--text-2); font-size: var(--step--1); }
.foot-nav a:hover { color: var(--signal); }
.foot-meta { margin: 0; color: var(--text-3); }

/* ── 404 ─────────────────────────────────────────────────────────────────── */

.nf {
  min-height: 68vh;
  display: grid; place-content: center;
  text-align: center;
  padding-block: var(--gap-4);
}
.nf-code {
  font-family: var(--mono); font-size: var(--step--1);
  letter-spacing: 0.2em; color: var(--signal); margin-bottom: var(--gap);
}
.nf h1 { font-size: var(--step-3); margin-bottom: var(--gap); }
.nf p { color: var(--text-2); max-width: 44ch; margin-inline: auto; }
.nf .hero-actions { justify-content: center; }
