/*
 * Design tokens. Every colour, size and space used by components comes from here,
 * so a designer can restyle the product by editing this one file.
 * Light is the default, dark follows the system unless the user chose a theme
 * (html[data-theme="light"|"dark"]).
 */
:root {
  color-scheme: light dark;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 1.125rem;
  --font-size-small: 1rem;
  --font-size-h1: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  --font-size-h2: 1.375rem;
  --line-height-body: 1.6;
  --line-height-heading: 1.25;
  --font-weight-bold: 650;

  --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;

  --radius-s: 0.375rem;
  --radius-m: 0.75rem;
  --radius-l: 1.25rem;

  --target-min: 2.75rem; /* 44 px */
  --content-max: 70rem;
  --focus-width: 3px;
}

:root,
:root[data-theme="light"] {
  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-surface-sunken: #f0ece4;
  --color-text: #1b2430;
  --color-text-muted: #455062;
  --color-border: #8a93a1;
  --color-border-soft: #d4d0c6;
  --color-primary: #1d4f7a;
  --color-primary-hover: #153b5c;
  --color-primary-text: #ffffff;
  --color-link: #1d4f7a;
  --color-focus: #b45309;
  --color-danger: #a4161a;
  --color-danger-surface: #fdecec;
  --color-lock: #7a4a00;
  --color-lock-surface: #fdf3dc;
  --color-nav-current: #e1ebf4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #121820;
    --color-surface: #1b232d;
    --color-surface-sunken: #0d1218;
    --color-text: #eaeff4;
    --color-text-muted: #b7c1ce;
    --color-border: #8794a5;
    --color-border-soft: #36414f;
    --color-primary: #8dc0ef;
    --color-primary-hover: #b0d3f6;
    --color-primary-text: #0b1520;
    --color-link: #9cc9f2;
    --color-focus: #ffb454;
    --color-danger: #ff9f9f;
    --color-danger-surface: #3a1d1f;
    --color-lock: #ffd58a;
    --color-lock-surface: #34290f;
    --color-nav-current: #243649;
  }
}

:root[data-theme="dark"] {
  --color-bg: #121820;
  --color-surface: #1b232d;
  --color-surface-sunken: #0d1218;
  --color-text: #eaeff4;
  --color-text-muted: #b7c1ce;
  --color-border: #8794a5;
  --color-border-soft: #36414f;
  --color-primary: #8dc0ef;
  --color-primary-hover: #b0d3f6;
  --color-primary-text: #0b1520;
  --color-link: #9cc9f2;
  --color-focus: #ffb454;
  --color-danger: #ff9f9f;
  --color-danger-surface: #3a1d1f;
  --color-lock: #ffd58a;
  --color-lock-surface: #34290f;
  --color-nav-current: #243649;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: var(--line-height-heading);
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

p {
  margin: 0 0 var(--space-4);
}

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none;
    transition: none;
  }
}

/*
 * Public pages. Colours, sizes and spaces come from @rodokmenoid/ui tokens (prepended to this
 * file at build time), so the site looks like the app in light and dark mode.
 * Breakpoints: 24em (sign-up button beside the brand), 40em (two-column cards), 48em (wider
 * gutters), 64em (hero and land section in two columns, three-column cards), 72em (header in one row).
 */
:root {
  --site-hero-size: clamp(2rem, 1.35rem + 2.6vw, 3rem);
  --site-band-pad: var(--space-7);
  --site-text-max: 42rem;
}

html {
  scroll-behavior: smooth;
  /* anchors land with a little air above the heading */
  scroll-padding-top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

h3 {
  font-size: 1.1875rem;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  min-height: var(--target-min);
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-radius: var(--radius-s);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transform: translateY(-300%);
}

.skip:focus {
  transform: none;
}

/* ---------- buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-m);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  text-align: center;
  line-height: var(--line-height-heading);
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.button-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
}

.button-secondary:hover {
  background: var(--color-nav-current);
}

.button-small {
  padding-inline: var(--space-4);
  font-size: var(--font-size-small);
}

.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--space-2);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-small);
  text-decoration: none;
}

.link-quiet:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

@media (max-width: 39.99em) {
  .actions .button {
    flex: 1 1 100%;
  }
}

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

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-4);
  row-gap: var(--space-1);
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  margin-right: auto;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

.brand-mark circle {
  fill: var(--color-primary);
}

.brand-mark path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* on phones the section links get their own row under the brand */
.site-nav {
  order: 3;
  width: 100%;
  border-top: 1px solid var(--color-border-soft);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--space-2);
  color: var(--color-text);
  font-size: var(--font-size-small);
  text-decoration: none;
  border-radius: var(--radius-s);
}

.site-nav a:hover {
  background: var(--color-nav-current);
}

.site-nav a[aria-current="page"] {
  font-weight: var(--font-weight-bold);
  box-shadow: inset 0 -3px 0 var(--color-primary);
}

/* very narrow phones: the sign-up button moves under the brand instead of squeezing it */
@media (max-width: 23.99em) {
  .header-auth {
    width: 100%;
  }

  .header-auth .button {
    flex: 1;
  }
}

/*
 * Wide screens: brand, the five links and the auth links share one row. The links never break
 * onto two lines; with an unusually wide font the auth links drop to a second row instead.
 */
@media (min-width: 72em) {
  .brand {
    margin-right: var(--space-4);
  }

  .site-nav {
    order: 0;
    width: auto;
    flex: 1 0 auto;
    border-top: 0;
  }

  .site-nav ul {
    flex-wrap: nowrap;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .header-auth {
    margin-left: auto;
  }
}

/* ---------- bands ---------- */

.band {
  padding-block: var(--site-band-pad);
}

.band-alt {
  background: var(--color-surface-sunken);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.band h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
}

.section-intro,
.group-intro,
.lead {
  max-width: var(--site-text-max);
}

.section-intro {
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.group-title {
  margin-top: var(--space-7);
  font-size: 1.375rem;
}

.group-intro {
  color: var(--color-text-muted);
}

.note {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-left: 4px solid var(--color-lock);
  background: var(--color-lock-surface);
  border-radius: var(--radius-s);
  font-size: var(--font-size-small);
}

.more {
  margin-top: var(--space-5);
  font-weight: var(--font-weight-bold);
}

/* ---------- status badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem var(--space-3);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid currentcolor;
}

.badge-coming {
  color: var(--color-lock);
  background: var(--color-lock-surface);
}

.badge-available {
  color: var(--color-primary);
  background: var(--color-nav-current);
}

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

.hero {
  padding-block: var(--space-6) var(--space-7);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
}

.hero-grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.eyebrow {
  margin-bottom: var(--space-2);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: var(--site-hero-size);
  line-height: 1.12;
  max-width: 20ch;
  margin-bottom: var(--space-4);
}

.lead {
  font-size: 1.1875rem;
  color: var(--color-text-muted);
}

.hero-today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

.hero-figure {
  margin: 0;
  padding: var(--space-3);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-l);
}

.hero-figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- sample tree ---------- */

.tree-art {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  margin: 0 auto;
}

.tree-lines path {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2;
}

.tree-person rect {
  fill: var(--color-surface);
  stroke: var(--color-primary);
  stroke-width: 2;
}

.tree-person text {
  fill: var(--color-text);
  text-anchor: middle;
  font-family: var(--font-sans);
}

.tree-name {
  font-size: 15px;
  font-weight: var(--font-weight-bold);
}

.tree-years {
  font-size: 13px;
}

.tree-living rect {
  fill: var(--color-surface-sunken);
  stroke: var(--color-border);
  stroke-dasharray: 6 4;
}

.tree-living text {
  fill: var(--color-text-muted);
}

.tree-lock rect {
  fill: var(--color-text-muted);
  stroke: none;
}

.tree-lock path {
  fill: none;
  stroke: var(--color-text-muted);
  stroke-width: 2;
}

/* ---------- lists ---------- */

.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.ticks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: var(--space-2);
}

/* a check mark drawn with borders, no icon font or image */
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.45em;
  width: 0.45rem;
  height: 0.8rem;
  border: solid var(--color-primary);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.ticks-columns {
  max-width: 60rem;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
  display: grid;
  gap: var(--space-4);
}

.step {
  counter-increment: step;
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-4) 4.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-m);
}

.step::before {
  content: counter(step);
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: var(--font-weight-bold);
}

.step-coming::before {
  background: var(--color-surface-sunken);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.step-head h3 {
  margin: 0;
}

.step p {
  margin: 0;
  color: var(--color-text-muted);
}

/* ---------- cards ---------- */

.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

.card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-m);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

.card-tagline {
  color: var(--color-text-muted);
}

.price {
  margin-bottom: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
}

.price-amount {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  white-space: nowrap;
}

.price-unit {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.card-note,
.card-conditions {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

.card-conditions {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-soft);
}

.card-conditions .price-amount {
  font-size: inherit;
  color: var(--color-text);
}

.privacy p {
  margin: 0;
  color: var(--color-text-muted);
}

.privacy .card-title {
  margin-bottom: var(--space-2);
  font-size: 1.125rem;
}

/* ---------- land ---------- */

.land {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.land-text p {
  max-width: var(--site-text-max);
}

.notice {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-left-width: 6px;
  border-radius: var(--radius-m);
}

.notice h3 {
  margin-bottom: var(--space-3);
}

.notice p:last-child {
  margin-bottom: 0;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: var(--space-3);
  max-width: 50rem;
}

.faq details {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-m);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--target-min);
  padding: var(--space-3) var(--space-4);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-m);
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* plus that turns into a minus, drawn with borders */
.faq summary::after {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border: solid var(--color-primary);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-2px, -2px);
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.faq details p {
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  color: var(--color-text-muted);
}

/* ---------- pricing ---------- */

.page-head {
  padding-block: var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
}

.page-head h1 {
  font-size: var(--site-hero-size);
}

.table-scroll {
  margin-top: var(--space-6);
  overflow-x: auto;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-small);
}

.compare caption {
  padding: var(--space-4);
  text-align: left;
  font-weight: var(--font-weight-bold);
  font-size: 1.125rem;
}

/* words in the table wrap at spaces only, never letter by letter */
.compare th,
.compare td {
  overflow-wrap: normal;
  hyphens: auto;
  padding: var(--space-3);
  border-top: 1px solid var(--color-border-soft);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  background: var(--color-surface-sunken);
}

.compare td .price-amount {
  font-size: 1.25rem;
}

.compare .explain {
  display: block;
  font-weight: normal;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.compare .no {
  color: var(--color-text-muted);
}

/*
 * Phones: each feature row becomes a label line with the three plan values under it, aligned
 * with the plan names in the header row. No sideways scrolling needed at 320 px.
 */
@media (max-width: 39.99em) {
  .compare thead,
  .compare tbody {
    display: block;
  }

  .compare tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compare thead th:first-child {
    display: none;
  }

  .compare tbody th[scope="row"] {
    grid-column: 1 / -1;
    padding-bottom: var(--space-1);
  }

  .compare tbody td {
    border-top: 0;
    padding-top: var(--space-1);
  }

  /* three narrow columns: tighter side padding, and a word too long for its column may break */
  .compare th,
  .compare td {
    padding-inline: var(--space-2);
    overflow-wrap: break-word;
  }

  .compare caption {
    display: block;
  }
}

.two-col {
  display: grid;
  gap: var(--space-6);
}

.two-col > div {
  max-width: var(--site-text-max);
}

/* ---------- call to action ---------- */

.band-cta {
  background: var(--color-nav-current);
  border-top: 1px solid var(--color-border-soft);
}

.cta h2 {
  margin-bottom: var(--space-2);
}

.cta .actions {
  margin-bottom: 0;
}

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

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.footer-inner {
  padding-block: var(--space-5);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-4);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

.footer-note {
  max-width: 50rem;
  margin-bottom: var(--space-2);
}

/* ---------- wider screens ---------- */

@media (min-width: 40em) {
  .cards-products,
  .cards-plans,
  .cards-privacy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticks-columns {
    columns: 2;
    column-gap: var(--space-6);
  }

  .ticks-columns li {
    break-inside: avoid;
  }
}

@media (min-width: 48em) {
  .wrap {
    padding-inline: var(--space-6);
  }

  :root {
    --site-band-pad: var(--space-8);
  }

  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .hero {
    padding-block: var(--space-8);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-7);
  }

  .cards-products,
  .cards-plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cards-privacy {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .land {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-7);
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps .step:first-child {
    grid-column: 1 / -1;
  }
}
