/*
  Healthyfied on the EveryTech design system.
  Same faces, type scale, spacing, radii, and motion as everytech-products
  (src/app/design-tokens.css). Two brand slots change: the ground is white instead of
  EveryTech's warm paper, and green takes the place of EveryTech gold as the only accent.
  Light only, like EveryTech (its dark mode is not shipped).
*/
:root {
  color-scheme: light;

  /* faces */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --label: "Quicksand", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* EveryTech type scale (subset used here) */
  --type-label: 0.72rem;
  --type-small: 0.875rem;
  --type-body: 1.0625rem;
  --type-lead: clamp(1.125rem, 1.7vw, 1.35rem);
  --type-title: clamp(1.45rem, 2.4vw, 2rem);
  --type-heading: clamp(2rem, 4vw, 3rem);
  --type-display: clamp(2.4rem, 5.6vw, 4.2rem);
  --line-tight: 1.02;
  --line-copy: 1.65;

  /* EveryTech spacing, radius, motion, layout */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;   --space-7: 3rem;    --space-8: 4rem;
  --space-9: 6rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.625rem;
  --dur-press: 120ms;
  --dur-pop: 180ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --measure: 42rem;
  --wide: 74rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);

  /* brand: Healthyfied (EveryTech slots, green for gold, white for paper) */
  --paper: #ffffff;
  --sunken: #f3f8f5;
  --ink: #16140f;
  --muted: #6f6a60;
  --rule: rgba(22, 20, 15, 0.12);
  --rule-strong: rgba(22, 20, 15, 0.34);
  --green: #1f9d55;       /* marks and fills, never body text */
  --green-ink: #0f6b4a;   /* green text and buttons on white, 6.5:1 */
  --green-wash: #e3f2e9;
  --on-green: #ffffff;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 450;
  font-size: var(--type-body);
  line-height: var(--line-copy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { text-wrap: pretty; }

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  scroll-margin-top: var(--space-7);
}

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

.skip {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  transform: translateY(-150%);
  padding: 0.65rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  font-family: var(--label);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out);
}
.skip:focus { transform: translateY(0); }

.wrap {
  width: min(var(--wide), 100% - 2 * var(--pad));
  margin: 0 auto;
}

.kicker {
  font-family: var(--label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--type-label);
  color: var(--green-ink);
  margin: 0 0 0.9rem;
}

.mono {
  font-family: var(--mono);
  font-size: var(--type-small);
  color: var(--muted);
  font-feature-settings: "tnum" 1;
}

/* ---------- header ---------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--rule-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.brand svg { width: 1.7rem; height: 1.7rem; color: var(--green); }
.brand__word {
  font-family: var(--label);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
}
.brand__tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-left: 0.55rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
  white-space: nowrap;
}
@media (max-width: 900px) { .brand__tag { display: none; } }

.nav { display: flex; align-items: center; gap: var(--space-5); }
.nav a:not(.btn) {
  font-family: var(--label);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur-press) ease;
}
.nav a:not(.btn):hover { color: var(--green-ink); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--label);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur-press) ease,
    border-color var(--dur-press) ease,
    color var(--dur-press) ease,
    transform var(--dur-press) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green-ink); color: var(--on-green); }
.btn-primary:hover { background: var(--ink); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--ink); }

/* ---------- hero ---------- */

.hero .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  align-items: center;
  padding: var(--space-9) 0;
}
.hero-copy { grid-column: 1 / span 7; }
.hero-figure { grid-column: 8 / span 5; margin: 0; }

.hero h1 {
  font-size: var(--type-display);
  line-height: 1.04;
  max-width: 15ch;
}
.hero .lede {
  margin: var(--space-5) 0 0;
  max-width: var(--measure);
  font-size: var(--type-lead);
  line-height: 1.55;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

@media (max-width: 900px) {
  .hero .wrap { padding: var(--space-8) 0; }
  .hero-copy, .hero-figure { grid-column: 1 / -1; }
  .hero-figure { max-width: 400px; width: 100%; margin: var(--space-7) auto 0; }
}

/* ---------- loop diagram (the signature asset) ----------
   Motion runs on the SVG's own clock (SMIL) so the dot and the captions stay in step.
   Reduced motion and print swap the animated group for a static one. */

.loop { width: 100%; height: auto; overflow: visible; }
.loop .track { fill: none; stroke: var(--rule); stroke-width: 2; }
.loop .trace { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; }
.loop .node { fill: var(--paper); stroke: var(--green-ink); stroke-width: 2.5; }
.loop .halo { fill: var(--green); }
.loop .dot { fill: var(--green-ink); }
.loop .label {
  font-family: var(--label);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--ink);
}
.loop .caption {
  font-family: var(--mono);
  font-size: 16px;
  fill: var(--muted);
}
.loop .caption .k { fill: var(--green-ink); font-weight: 500; }
.loop .static { display: none; }

@media (prefers-reduced-motion: reduce) {
  .loop .anim { display: none; }
  .loop .static { display: inline; }
}
@media print {
  .loop .anim { display: none; }
  .loop .static { display: inline; }
}

/* ---------- sections ---------- */

.section .wrap {
  padding: var(--space-9) 0;
  border-top: 1px solid var(--rule-strong);
}
.section h2 {
  font-size: var(--type-heading);
  max-width: 20ch;
}
.section .intro {
  margin: var(--space-4) 0 0;
  max-width: var(--measure);
  font-size: var(--type-lead);
  line-height: 1.55;
  color: var(--muted);
}
@media (max-width: 760px) {
  .section .wrap { padding: var(--space-8) 0; }
}

/* ---------- product: Zarii ---------- */

.product { background: var(--sunken); }
.product .wrap { border-top: 0; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  row-gap: var(--space-7);
  margin-top: var(--space-7);
}
.product-copy { grid-column: 1 / span 6; }
.product-flow { grid-column: 8 / span 5; }
.product-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--type-heading);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
  color: var(--green-ink);
}
.product-line {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--type-title);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: var(--space-3) 0 0;
  max-width: 22ch;
}
.product-copy p:not(.product-name):not(.product-line) {
  margin: var(--space-5) 0 0;
  max-width: var(--measure);
}
.product-points {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.product-points li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}
.product-points strong { font-weight: 650; }
.product-status {
  margin-top: var(--space-5);
  font-family: var(--mono);
  font-size: var(--type-small);
  color: var(--muted);
}

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: flow;
}
.flow li {
  counter-increment: flow;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--rule);
}
.flow li:first-child { border-top: 2px solid var(--green); }
.flow li::before {
  content: counter(flow, decimal-leading-zero);
  font-family: var(--mono);
  font-size: var(--type-small);
  color: var(--green-ink);
  padding-top: 0.15rem;
}
.flow h3 { font-size: 1.15rem; line-height: 1.3; }
.flow p { margin: var(--space-1) 0 0; color: var(--muted); font-size: 0.975rem; }

@media (max-width: 900px) {
  .product-copy, .product-flow { grid-column: 1 / -1; }
}

/* ---------- services index ---------- */

.services {
  list-style: none;
  margin: var(--space-7) 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.services li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  row-gap: var(--space-3);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--rule);
}
.services h3 {
  grid-column: 1 / span 5;
  font-size: var(--type-title);
  line-height: 1.15;
}
.services .body { grid-column: 7 / -1; }
.services p { margin: 0; max-width: var(--measure); }
.services .mono { margin-top: var(--space-3); }
@media (max-width: 900px) {
  .services h3, .services .body { grid-column: 1 / -1; }
}

/* ---------- process ---------- */

.steps {
  list-style: none;
  margin: var(--space-7) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding-top: var(--space-4);
  border-top: 2px solid var(--green);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: var(--type-small);
  color: var(--green-ink);
  margin-bottom: var(--space-3);
}
.steps h3 { font-size: var(--type-title); }
.steps p { margin: var(--space-3) 0 0; color: var(--muted); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-6);
  margin: var(--space-8) 0 0;
}
.facts > div { padding: var(--space-5) 0; border-top: 1px solid var(--rule); }
.facts dt { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.facts dd { margin: var(--space-2) 0 0; color: var(--muted); max-width: var(--measure); }
@media (max-width: 800px) { .facts { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */

.contact h2 { font-size: var(--type-display); max-width: 14ch; line-height: 1.04; }
.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.email {
  font-family: var(--display);
  font-size: var(--type-title);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: var(--green);
  overflow-wrap: anywhere;
  margin-right: var(--space-3);
}
.copy-status {
  font-family: var(--mono);
  font-size: var(--type-small);
  color: var(--green-ink);
  min-height: 1.5em;
  margin: var(--space-3) 0 0;
}
.copy-btn { display: none; }
.js .copy-btn { display: inline-flex; }

/* ---------- footer ---------- */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--rule-strong);
  font-size: var(--type-small);
  color: var(--muted);
}
.site-footer nav { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--green-ink); text-decoration: underline; }

/* ---------- document pages (privacy, 404) ---------- */

.doc .wrap { padding: var(--space-8) 0 var(--space-9); }
.doc h1 { font-size: var(--type-heading); }
.doc h2 { font-size: var(--type-title); margin-top: var(--space-7); }
.doc p, .doc li { max-width: var(--measure); }
.doc p { margin: var(--space-4) 0 0; }
.doc ul { padding-left: var(--space-5); }
.doc a:not(.btn) { color: var(--green-ink); text-underline-offset: 3px; }
