/* =========================================================
   Harmonia Labs — stylesheet
   Brand palette is declared once, below. Everything else
   references semantic tokens, so the palette can be swapped
   in one place.
   ========================================================= */

:root {
  /* ---- Brand palette (source of truth — edit here only) ---- */
  --color-bg-darkest:  #10141F; /* near-black navy  */
  --color-bg-dark:     #1C2B40; /* dark navy        */
  --color-accent-mid:  #3F5872; /* slate blue       */
  --color-accent-light:#7C90AF; /* muted blue-grey  */
  --color-cream:       #F0EBDB; /* warm off-white   */

  /* ---- Semantic tokens: dark theme (default) ----
     Contrast measured against the surface each is used on:
       cream    on darkest  15.42:1   AA ✓  AAA ✓
       cream    on dark     11.99:1   AA ✓  AAA ✓
       muted    on darkest   6.74:1   AA ✓
       muted    on dark      5.24:1   AA ✓
     --color-accent-mid and --color-accent-light are NEVER used
     for body text on these surfaces (2.50:1 and 4.40:1 on
     --color-bg-dark respectively — both below the 4.5:1 floor).
     They are restricted to borders, rules, and drawn marks.   */
  --bg:          var(--color-bg-darkest);
  --surface:     var(--color-bg-dark);
  --surface-alt: color-mix(in srgb, var(--color-bg-dark) 55%, var(--color-bg-darkest));
  --text:        var(--color-cream);
  --text-muted:  #8D9EB6; /* --color-accent-light lifted 15% toward cream to clear AA on --surface */
  --line:        color-mix(in srgb, var(--color-accent-mid) 45%, var(--color-bg-darkest));
  --line-strong: color-mix(in srgb, var(--color-accent-mid) 80%, var(--color-bg-darkest));
  --mark:        var(--color-accent-light); /* decorative strokes only, never text */

  --btn-bg:      var(--color-cream);
  --btn-fg:      var(--color-bg-darkest); /* 15.42:1 */

  /* ---- Type ---- */
  --font-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Rhythm ---- */
  --container: 1160px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(4.5rem, 9vw, 7.5rem);
  --radius: 14px;
  --radius-sm: 8px;
}

/* ---- Semantic tokens: light theme ----
     darkest on cream    15.42:1   AA ✓
     darkest on surface  16.26:1   AA ✓
     accent-mid on cream  6.18:1   AA ✓  (muted text is safe here)
     --color-accent-light is not used for text in this theme
     (2.72:1 on cream).                                        */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:          var(--color-cream);
    --surface:     color-mix(in srgb, var(--color-cream) 70%, #FFFFFF);
    --surface-alt: color-mix(in srgb, var(--color-cream) 94%, var(--color-accent-mid));
    --text:        var(--color-bg-darkest);
    --text-muted:  var(--color-accent-mid);
    --line:        color-mix(in srgb, var(--color-accent-mid) 26%, var(--color-cream));
    --line-strong: color-mix(in srgb, var(--color-accent-mid) 45%, var(--color-cream));
    --mark:        var(--color-accent-mid);

    --btn-bg:      var(--color-bg-darkest);
    --btn-fg:      var(--color-cream);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.022em; line-height: 1.1; }
p { margin: 0; }

::selection { background: var(--text); color: var(--bg); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--text); color: var(--bg);
  padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--sunk { background: var(--surface-alt); border-block: 1px solid var(--line); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

.section-head { max-width: 42ch; margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem); }
.section-head h2 { font-family: var(--font-serif); font-size: clamp(1.9rem, 4vw, 2.7rem); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .94rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { background: color-mix(in srgb, var(--btn-bg) 88%, var(--color-accent-light)); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); background: var(--surface); }
.btn--sm { padding: .5rem 1rem; font-size: .87rem; }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 66px;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 500; font-size: 1rem;
  letter-spacing: -0.015em;
}
.brand__mark { width: 26px; height: 26px; flex: none; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a { text-decoration: none; font-size: .93rem; color: var(--text-muted); transition: color .15s ease; }
.nav a:hover { color: var(--text); }
.nav .btn { color: var(--btn-fg); }
.nav .btn:hover { color: var(--btn-fg); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: .5rem .7rem;
  color: var(--text); cursor: pointer;
}

@media (max-width: 820px) {
  .nav {
    position: absolute; inset: 66px 0 auto;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .25rem var(--gutter) 1.25rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav .btn { margin-top: 1.1rem; justify-content: center; border-bottom: 0; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3.5rem, 10vw, 7rem) clamp(3rem, 7vw, 5.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.8vw, 4.2rem);
  letter-spacing: -0.032em; line-height: 1.03;
}
.hero__sub {
  margin-top: 1.5rem;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  color: var(--text-muted);
  max-width: 42ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }
.hero__meta {
  margin: 2.75rem 0 0; padding: 1.4rem 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
}

/* Harmonic-series figure — the brand motif, drawn not stocked */
.hero__figure svg { width: 100%; height: auto; overflow: visible; color: var(--mark); }
.hero__figure .wave { fill: none; stroke: var(--mark); stroke-width: 1.25; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { order: -1; max-width: 440px; }
}

/* ---------- Principles ---------- */

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.75rem, 4vw, 3rem); }
.principle { padding-top: 1.4rem; border-top: 1px solid var(--line-strong); }
.principle__n { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--text-muted); }
.principle h3 { margin: .8rem 0 .55rem; font-size: 1.15rem; font-weight: 500; }
.principle p { color: var(--text-muted); font-size: .96rem; }
@media (max-width: 780px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Services ---------- */

.services {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.service {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2.1rem);
  display: flex; flex-direction: column; gap: .65rem;
  transition: background-color .2s ease;
}
.service:hover { background: var(--surface); }
.service__idx { font-family: var(--font-mono); font-size: .71rem; letter-spacing: .12em; color: var(--text-muted); }
.service h3 { font-size: 1.12rem; font-weight: 500; }
.service p { color: var(--text-muted); font-size: .95rem; }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
/* With the founder placeholder commented out there is a single child; hold a readable
   measure instead of leaving an empty column. Reverts on its own once it is restored. */
.about:has(> :only-child) { grid-template-columns: minmax(0, 60ch); }
.about__body p + p { margin-top: 1.1rem; }
.about__body p { color: var(--text-muted); font-size: 1rem; }
.about__lead {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.32; letter-spacing: -0.02em;
  color: var(--text) !important;
}

.placeholder-card {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 1.9rem);
  background: var(--surface);
}
.placeholder-card__tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: .67rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: .28rem .7rem; margin-bottom: 1rem;
}
.placeholder-card h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: .5rem; }
.placeholder-card p { color: var(--text-muted); font-size: .94rem; }
.placeholder-card ul { margin: .9rem 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: .91rem; }
.placeholder-card li { padding: .42rem 0; border-top: 1px solid var(--line); }

@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.contact h2 { font-family: var(--font-serif); font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
.contact p { margin-top: 1rem; color: var(--text-muted); max-width: 42ch; }

.contact__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3.4vw, 2.4rem);
}
.contact__label { font-family: var(--font-mono); font-size: .71rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.contact__email {
  display: inline-block; margin-top: .55rem;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.9vw, 1.7rem);
  letter-spacing: -0.02em; text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px; word-break: break-word;
}
.contact__email:hover { border-bottom-color: var(--text); }
.contact__note { margin-top: 1.3rem; font-size: .9rem; color: var(--text-muted); }

@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 2.25rem 2.75rem; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem; font-size: .87rem; color: var(--text-muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Reveal ---------- */

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }
