/* ==========================================================================
   Terra: base styles shared by every page
   tokens · reset · type · buttons · header · footer · modal · forms · utils
   ========================================================================== */

:root {
  --bg: #0a121c;
  --bg-2: #0f1926;
  --surface: #121d2b;
  --surface-2: #182536;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-2: #c4cad4;
  --muted: #8c95a4;
  --accent: #4da2ff;
  --accent-hover: #1c88ff;
  --slate: #465167;
  --slate-hover: #5d6880;
  --danger: #ff6b6b;
  --success: #6be0a0;

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace; /* numbers read like data */

  --radius-sm: 2px;
  --radius: 2px;
  --radius-lg: 4px;
  --pill: 0px; /* buttons, chips and fields are square */

  --container: 1440px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 10vw, 128px);
  --header-h: 68px;
  /* where page content starts on full-width layouts (same edge as the header and .container) */
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

::selection { background: var(--accent); color: #fff; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }

.sr-only {
  position: absolute !important;
  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: 12px; top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: #fff; color: var(--bg);
  border-radius: var(--pill);
  font-weight: 500;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* Type scale, used on every page:
   display (home hero) · h1 page titles · h2 section headings · h3 subheadings · lead intro text · body */
.display {
  font-size: clamp(2.6rem, 6vw, 4.75rem);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: -0.035em;
}
.h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.06;
  font-weight: 300;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: -0.025em;
}
.h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 300;
}
.muted { color: var(--muted); }
.prose > * + * { margin-top: 1em; }
.prose p { color: var(--text-2); font-weight: 300; font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .icon { transition: transform .25s var(--ease); flex: none; }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }

.btn--primary { --btn-bg: var(--accent); --btn-fg: #fff; }
.btn--primary:hover { --btn-bg: var(--accent-hover); }

.btn--light { --btn-bg: #fff; --btn-fg: var(--bg); }
.btn--light:hover { --btn-bg: rgba(255, 255, 255, .86); }

.btn--slate { --btn-bg: var(--slate); --btn-fg: #fff; }
.btn--slate:hover { --btn-bg: var(--slate-hover); }

.btn--outline { --btn-bd: var(--line-strong); --btn-fg: #fff; }
.btn--outline:hover { --btn-bg: #fff; --btn-fg: var(--bg); --btn-bd: #fff; }

.btn--sm { min-height: 40px; padding: 9px 18px; font-size: 14px; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text);
  transition: background-color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  transition: color .2s;
}
.text-link:hover { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 18, 28, .72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(10, 18, 28, .88); }

.header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.nav--primary { display: flex; gap: 4px; margin-left: -14px; } /* pull the first word onto the page edge, in line with the content below */
.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: 15px;
  color: var(--text-2);
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: #fff; }
.nav-link[aria-current='page'] { color: #fff; }

.brand { justify-self: center; display: inline-flex; }
.brand img { height: 25px; width: auto; }

.header-actions { justify-self: end; display: flex; align-items: center; gap: 4px; margin-right: -12px; } /* "Join waitlist" ends on the page edge */
.header-cta { margin-left: 8px; }

/* ---------- Mosaic star under links (header, text links) ---------- */
.star-link { position: relative; }
.star-under { position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px; overflow: visible; opacity: 0; transform: translateY(6px) scale(.5) rotate(-45deg); transition: opacity .25s, transform .45s var(--spring); pointer-events: none; }
.star-under polygon { fill: var(--c, #76bd81); }
.star-link:hover .star-under, .star-link:focus-visible .star-under, .star-link[aria-current='page'] .star-under { opacity: 1; transform: none; }
.icon-btn.star-link:hover { background: transparent; }
.icon-btn .star-under { bottom: -2px; }
.text-link .star-under { bottom: -14px; }

/* Join waitlist: text with a green star on its left that turns on hover */
.header-cta { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: transparent; gap: 8px; padding-inline: 12px; font-weight: 600; }
.header-cta:hover { --btn-bg: transparent; }
.cta-star { width: 12px; height: 12px; flex: none; overflow: visible; transition: transform .6s var(--spring); }
.cta-star polygon { fill: #76bd81; }
.header-cta:hover .cta-star, .header-cta:focus-visible .cta-star { transform: rotate(45deg) scale(1.2); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  position: relative;
  margin-right: -10px;
}
/* the mosaic star: sits like a plus, turns into a green cross when the menu is open */
.menu-star { display: block; width: 22px; height: 22px; margin: auto; overflow: visible; transform: rotate(45deg); transition: transform .5s var(--spring); }
.menu-star polygon { fill: #fff; transition: fill .3s; }
.menu-toggle:hover .menu-star { transform: rotate(35deg); }
.menu-toggle[aria-expanded='true'] .menu-star { transform: rotate(0deg) scale(.95); }
.menu-toggle[aria-expanded='true'] .menu-star polygon { fill: #76bd81; }

.mobile-menu {
  /* absolute, not fixed: the header's backdrop-filter makes it the containing block */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  background: var(--bg);
  overflow-y: auto;
  animation: menuIn .3s var(--ease);
}
.mobile-menu nav { display: flex; flex-direction: column; padding-block: 16px 32px; }
.mobile-link {
  padding: 16px 0;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.mobile-link[aria-current='page'] { color: var(--accent); }
.mobile-menu .btn { margin-top: 28px; }

@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 859px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .nav--primary { display: none; }
  .brand { justify-self: start; }
  .header-actions .icon-btn { display: none; }
  .menu-toggle { display: grid; place-items: center; }
}
@media (max-width: 400px) {
  .header-cta { padding-inline: 8px; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-block: 56px 28px;
  font-size: 15px;
  color: var(--text-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.6fr auto;
  gap: 40px 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-col h4 { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #fff; margin-bottom: 4px; }
.footer-col a { transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-brand img { height: 22px; width: auto; margin-bottom: 6px; }
.footer-brand p { max-width: 260px; color: var(--muted); font-size: 14px; }
.footer-subscribe { min-width: 0; }
.footer-subscribe .inline-form { width: 100%; }

.socials { display: flex; gap: 8px; }
.social {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: #fff;
  transition: background-color .2s, color .2s, border-color .2s;
}
.footer-col .social:hover { background: #fff; color: var(--bg); border-color: #fff; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer-bottom a { color: var(--text-2); }
.footer-bottom a:hover { color: #fff; }

@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-subscribe { grid-column: span 2; }
}
@media (max-width: 599px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-subscribe { grid-column: 1 / -1; }
}

/* ---------- Forms ---------- */
.input,
input[type='email'],
input[type='text'],
input[type='password'],
input[type='number'],
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px; /* ≥16px stops iOS zooming on focus */
  transition: border-color .2s, background-color .2s;
}
input::placeholder { color: var(--muted); }
input:hover, select:hover { border-color: rgba(255, 255, 255, .35); }
input:focus, select:focus { outline: none; border-color: var(--accent); background: rgba(77, 162, 255, .06); }

.inline-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
.inline-form input { flex: 1 1 auto; min-width: 0; }
.inline-form .btn { flex: none; }

.stack-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
}
.check input {
  flex: none;
  width: 18px; height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.form-msg { font-size: 14px; color: var(--text-2); margin-top: 12px; }
.form-msg--success { color: var(--success); }
.form-msg--error { color: var(--danger); }

/* ---------- Modal ---------- */
.modal {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.modal::backdrop { background: rgba(5, 10, 16, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .35s var(--ease); }
.modal-card {
  position: relative;
  padding: clamp(28px, 5vw, 40px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}
.modal-card h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 300; letter-spacing: -0.025em; line-height: 1.12; margin-bottom: 8px; }
.modal-close { position: absolute; top: 12px; right: 12px; }

@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 90;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(18, 29, 43, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.cookie-banner.is-visible { opacity: 1; transform: none; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 520px) {
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 300;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  background: #fff;
  color: var(--bg);
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- Reveal on scroll ---------- */
.js-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js-ready .reveal.is-in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s !important; }
.reveal-delay-2 { transition-delay: .16s !important; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Saved-designs badge ---------- */
.saved-link { position: relative; }
.badge {
  position: absolute;
  top: 4px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}
.badge--inline { position: static; display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 12px; height: 20px; line-height: 20px; min-width: 20px; }


/* ---------- Headline word reveal (js/fx.js) ---------- */
[data-split].is-split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
[data-split].is-split .w > span {
  display: inline-block;
  transform: translateY(105%) rotate(4deg);
  opacity: 0;
  transition: transform .9s var(--ease), opacity .9s var(--ease);
}
[data-split].is-split.is-in .w > span { transform: none; opacity: 1; }
