/*
 * myroots.work — the marketing homepage at the apex.
 *
 * Palette and type are lifted from the console's own tokens
 * (app/src/styles/tokens.css, dark theme) so that the hop from here to
 * app.myroots.work doesn't look like two different products. Plain CSS, same
 * as the app — deliberately no Tailwind and no build step: this is a
 * three-file static deploy.
 *
 * Dark only. The console offers a light theme because people sit in it all
 * day; a landing page doesn't need the switch, and committing to one palette
 * keeps the canvas illustration tuned to a single background.
 */

:root {
  color-scheme: dark;

  --bg: #0b1514;
  --surface: #11201e;
  --surface-2: #152624;
  --border: #24312f;
  --ink: #eaf3f1;
  --ink-2: #a8bcb8;
  --ink-3: #77908c;

  --accent: #45c7c0;
  --accent-ink: #6fd8d2;
  --accent-soft: #10302e;
  --on-accent: #04211f;

  /* Consumed by roots-bg.js for the canvas strokes. */
  --root-line: rgba(69, 199, 192, 0.30);

  --f-display: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 24px;
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 {
  font-family: var(--f-display);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -200%);
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Background illustration ---------- */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Damped a little so the hero copy always wins the contrast fight over it. */
#treeCanvas { display: block; width: 100%; height: 100%; opacity: 0.8; }

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 22%, transparent 18%, var(--bg) 82%);
}

/* ---------- Layout ---------- */

.page { position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 72px; }

.section-head { margin-bottom: 32px; max-width: 46ch; }
.section-head h2 { font-size: 26px; font-weight: 600; line-height: 1.25; }
.section-head p { margin-top: 10px; color: var(--ink-3); font-size: 15px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transition: box-shadow 160ms ease;
}
.brand:hover .brand-dot { box-shadow: 0 0 12px var(--accent); }
.brand-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.site-nav {
  display: none;
  gap: 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav a { color: var(--ink-3); text-decoration: none; transition: color 140ms ease; }
.site-nav a:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/*
 * On a phone the brand plus both buttons overflow the viewport, so the header
 * keeps only "Sign in" — the one thing a returning customer came for. The
 * booking CTA is the first thing under it in the hero, twice.
 *
 * Scoped to .header-actions rather than left as a bare .header-cta: .btn sets
 * its own display and is declared after this block, so a single-class rule
 * here loses on source order.
 */
.header-actions .header-cta { display: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-lg { padding: 14px 26px; font-size: 12px; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}
.btn-primary:hover { background: var(--accent-ink); }

.btn-outline {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink);
}
.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }

.btn-quiet { color: var(--ink-3); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding-top: 72px;
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(38px, 8vw, 68px);
  font-weight: 500;
  line-height: 1.08;
  max-width: 15ch;
}
.h1-soft { color: var(--ink-2); font-weight: 400; }

.lede {
  margin-top: 24px;
  max-width: 58ch;
  font-size: clamp(15px, 2.4vw, 17.5px);
  color: var(--ink-2);
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-note {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

/* ---------- Pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 24px;
  transition: border-color 180ms ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.card-index {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--ink-2); line-height: 1.62; }

/* ---------- Dossier ---------- */

.dossier {
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 20px;
  padding: 24px;
}

.dossier-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dossier-label { color: var(--accent); }
.dossier-meta { color: var(--ink-3); }

.dossier-top {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.dossier-name { font-size: 21px; font-weight: 600; }
.dossier-sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); }

.pill {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  padding: 6px 13px;
  white-space: nowrap;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  margin: 24px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.dossier-grid dt {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dossier-grid dd {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--ink);
}
.dossier-grid dd.accent { color: var(--accent); }

.fineprint {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 62ch;
}

/* ---------- Closing CTA ---------- */

.cta-band {
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.cta-band h2 { font-size: 23px; font-weight: 600; }
.cta-band p { margin-top: 8px; font-size: 14.5px; color: var(--ink-3); max-width: 52ch; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner {
  padding-block: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer-verticals { display: flex; flex-direction: column; gap: 2px; }
.footer-verticals .muted { color: color-mix(in srgb, var(--ink-3) 72%, transparent); }

/* ---------- Breakpoints ---------- */

@media (min-width: 720px) {
  .site-nav { display: flex; }
  .section { padding-block: 88px; }
  .dossier { padding: 30px; }
  .dossier-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-verticals { text-align: right; }
}

@media (min-width: 900px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-top: 96px; padding-bottom: 112px; }
  .cta-band { flex-wrap: nowrap; padding: 38px 36px; }
}

@media (min-width: 560px) {
  .header-actions .header-cta { display: inline-flex; }
}

/* ---------- Booking modal ---------- */

/*
 * A native <dialog>, so Esc, the top layer and focus handling come from the
 * browser rather than from hand-rolled JS. Only shown at >=700px — see
 * booking.js for why the phone case deliberately keeps the full page.
 */
.booking-dialog {
  width: min(880px, 92vw);
  max-width: none;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.booking-dialog::backdrop {
  background: rgba(4, 10, 9, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.booking-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.booking-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  line-height: 1;
  font-size: 18px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}
.booking-close:hover { border-color: var(--accent); color: var(--ink); }

/* Google's scheduling UI supplies its own white surface, hence no padding. */
.booking-frame { height: min(640px, 72vh); background: #fff; }
.booking-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.booking-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-3);
}
.booking-foot a { color: var(--accent); }
