/* Candle Planner — "Modernist" design system (Claude Design export, layout 1a · Ruled). */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  /* Accent dark enough for light text on it (4.5:1, WCAG AA). Use for filled buttons and panels. */
  --color-accent-strong: #d42a0f;
  --color-accent-strong-hover: #c42309;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);
  --color-muted: color-mix(in srgb, var(--color-text) 70%, transparent);
  --color-soft: color-mix(in srgb, var(--color-text) 80%, transparent);
  --color-neutral-100: #f8f4f4;
  --color-neutral-800: #444141;
  --color-accent-100: #fff2ef;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --font: 'Archivo', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font); font-size: 15px; line-height: 1.55; text-wrap: pretty;
}
h1, h2, h3 { font-family: var(--font); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
code { overflow-wrap: anywhere; }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; font: 800 14px/1.2 var(--font);
  color: var(--color-text); background: transparent; border: 1px solid transparent;
  padding: 8px 14px; border-radius: 0;
}
.btn svg { display: block; flex: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn-primary:hover { background: var(--color-accent-strong); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-strong-hover); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-ghost { color: var(--color-accent-700); padding-inline: 4px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-lg { padding: 12px 16px; font-size: 15px; }
.btn-arrow { min-width: 220px; justify-content: space-between; }
.btn-inverse, .btn-inverse:hover { background: var(--color-bg); color: var(--color-accent-700); }
.btn-inverse:hover { background: #fff; }
.btn-outline-inverse, .btn-outline-inverse:hover { color: var(--color-bg); border-color: var(--color-bg); }
.btn-outline-inverse:hover { background: color-mix(in srgb, var(--color-bg) 14%, transparent); }

/* — tags — */
.tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: .02em; padding: 3px 10px; white-space: nowrap; }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent-700); }

/* — navigation — */
.nav {
  position: sticky; top: 0; z-index: 5; background: var(--color-bg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 12px max(var(--gutter), calc((100% - 1200px) / 2 + var(--gutter)));
  border-bottom: 2px solid var(--color-divider);
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--color-accent); }
.nav .btn-primary, .nav .btn-primary:hover { color: var(--color-bg); }
.nav-brand { font-weight: 800; font-size: 18px !important; margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--color-divider); }
.seg-opt { border: 0; font: inherit; font-size: 13px; padding: 6px 10px; cursor: pointer; background: transparent; color: var(--color-text); }
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt[aria-pressed='true'] { background: var(--color-accent-strong); color: var(--color-bg); }
.seg-opt:not([aria-pressed='true']):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }

@media (max-width: 720px) {
  .nav { gap: 10px; }
  .nav > a[href^='#']:not(.nav-brand):not(.btn) { display: none; }
  .nav .btn { padding: 7px 10px; font-size: 13px; }
  .nav-brand { font-size: 16px !important; }
}

/* Skip link: off-screen until it receives keyboard focus. */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--color-text); color: var(--color-bg); font-weight: 700; }
.skip:focus { top: 12px; }

/* — layout — */
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }
.rule { height: 2px; border: 0; margin: 0; background: var(--color-divider); }
.anchor { scroll-margin-top: 72px; }
.kicker { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-accent-700); margin-bottom: 20px; }
.muted { color: var(--color-muted); }
.small, .note { font-size: 13px; }
.note { color: var(--color-muted); margin: 16px 0 0; }
.lead { font-size: 18px; line-height: 1.6; max-width: 48ch; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.body { font-size: 15.5px; line-height: 1.65; max-width: 52ch; color: var(--color-soft); }
.square { width: 10px; height: 10px; background: var(--color-accent); flex: none; display: inline-block; }
h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; margin-bottom: 16px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

.hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 56px clamp(32px, 6vw, 96px); align-items: end;
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 84px);
}
.hero h1 { font-size: clamp(42px, 6vw, 80px); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 0 -0.05em; max-width: 11ch; }
.hero .lead { margin: 28px 0 0; }

.plan-card { margin: 0; border-top: 2px solid var(--color-text); }
.plan-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 2px solid var(--color-divider);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.plan-head .kicker { margin: 0; font-size: 12px; }
.plan-row {
  /* minmax(0, 1fr) and a narrower gap keep the status tag on screen at 320px (German "Daten prüfen"). */
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px clamp(10px, 4vw, 24px); align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--color-divider);
}
.plan-name, .plan-batch { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.plan-card figcaption { font-size: 13px; padding-top: 12px; color: var(--color-muted); }

.split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px clamp(32px, 6vw, 96px); padding: clamp(56px, 7vw, 84px) 0;
}
.split h2.narrow { max-width: 16ch; margin: 0; }
.split .lead.end { align-self: end; max-width: 46ch; margin: 0; }
.split .body { max-width: 42ch; margin-bottom: 24px; }

.steps { padding: clamp(56px, 7vw, 84px) 0 clamp(32px, 4vw, 48px); }
.steps .kicker { margin-bottom: 8px; }
.step {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px clamp(24px, 4vw, 72px); align-items: baseline; padding: 32px 0; border-bottom: 2px solid var(--color-divider);
}
.step-head { display: flex; gap: clamp(24px, 6vw, 96px); align-items: baseline; }
.step-num { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.step h3 { font-size: 24px; margin: 0; }
.step .body { margin: 0; }

.math { gap: 40px clamp(32px, 6vw, 96px); padding-top: clamp(48px, 6vw, 72px); }
.ruled-top { border-top: 2px solid var(--color-text); }
.math-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 4px 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--color-divider);
}
.math-label { font-weight: 700; font-size: 16px; }
.math-value { grid-row: span 2; font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.math-row .muted { font-size: 14px; }
.result-line { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 0; font-size: 15px; font-weight: 700; }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
  padding: 8px; border-bottom: 2px solid var(--color-divider); vertical-align: bottom;
}
.table td { padding: 8px; border-bottom: 1px solid var(--color-divider); vertical-align: top; }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
#cols td.mono { white-space: nowrap; }

/* — demo — */
.demo { margin: 0 0 clamp(56px, 7vw, 84px); padding: clamp(20px, 3vw, 36px); background: var(--color-surface); border-top: 2px solid var(--color-text); }
.demo .kicker { margin-bottom: 12px; }
.actions, .result-head { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-block: 16px; }
.actions .note { margin: 0; }
.result-head { justify-content: space-between; }
.result-head h3 { margin: 0; font-size: 22px; }
.result-tools { display: flex; flex-wrap: wrap; gap: 8px; }
details { margin-block: 16px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 12px; max-width: 70ch; }
#notice { margin-block: 16px; padding: 10px 14px; background: var(--color-accent-100); color: var(--color-accent-800); }
.table-scroll { overflow-x: auto; background: var(--color-bg); }
#rows td:first-child { font-weight: 700; }
#rows td:last-child { min-width: 220px; }
#rows small { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; }
#rows details { margin: 6px 0 0; font-weight: 400; }
#rows summary { font-size: 13px; font-weight: 400; color: var(--color-muted); }
#rows details small { color: var(--color-muted); }

/* Phones: one card per fragrance instead of an 8-column table that needs side scrolling.
   The thead stays in the DOM for screen readers; each cell repeats its column name. */
@media screen and (max-width: 720px) {
  .table-scroll { position: relative; overflow-x: visible; background: transparent; }
  #plan-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #plan-table, #rows, #rows tr, #rows td { display: block; }
  #rows tr { background: var(--color-bg); padding: 14px 14px 8px; margin-bottom: 12px; border-top: 2px solid var(--color-text); }
  #rows tr:hover { background: var(--color-bg); }
  #rows td { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 7px 0; }
  #rows td::before { content: attr(data-label); font-size: 13px; font-weight: 400; color: var(--color-muted); }
  #rows td:first-child { display: block; font-size: 17px; padding-top: 0; }
  #rows td:first-child::before, #rows td:last-child::before { content: none; }
  #rows td:nth-child(7) { font-weight: 700; font-size: 17px; }
  #rows td:last-child { display: block; min-width: 0; border-bottom: 0; color: var(--color-muted); font-size: 13.5px; }
  #rows td input { width: 110px; }
}
.demo input {
  font: inherit; color: var(--color-text); background: var(--color-bg); caret-color: var(--color-accent);
  border: 1px solid var(--color-divider); border-radius: 0; min-height: 36px; padding: 6px 10px;
}
.demo input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
td input { width: 5.5rem; }
#manual { margin-block: 20px; }
#manual fieldset { border: 1px solid var(--color-divider); margin: 0 0 12px; padding: 16px; }
#manual legend { font-weight: 800; padding-inline: 4px; }
#manual-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
#manual-fields label { display: grid; align-content: space-between; gap: 5px; font-size: 12px; color: var(--color-soft); }
#manual-fields input { width: 100%; }
#weekly { margin-block: 24px; }
#weekly h3 { margin-bottom: 8px; }
.weekly-row { min-inline-size: 0; border: 1px solid var(--color-divider); margin: 0 0 16px; padding: 14px; }
.weekly-row legend { font-weight: 700; overflow-wrap: anywhere; }
.weekly-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr));
  gap: 10px;
}
.weekly-fields label { display: grid; align-content: space-between; gap: 6px; font-size: 14px; }
.weekly-fields input { width: 100%; }
#rows .edit-inputs { margin-top: 6px; font-size: 14px; padding: 5px 0; text-align: left; }

.pricing { padding: clamp(48px, 7vw, 84px) 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.price-card {
  border-top: 2px solid var(--color-text);
  background: var(--color-surface);
  padding: clamp(20px, 3vw, 32px);
}
.price-card h3 { margin: 0; font-size: 22px; }
.price-card .body { max-width: 42ch; }
.price-card .note { margin-bottom: 0; }
.price-card .note + .actions { margin-top: 16px; }
.price-value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin: 12px 0;
}
.price-value span + span { font-size: 15px; font-weight: 500; color: var(--color-muted); }

.demo-request {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px clamp(32px, 6vw, 96px);
  margin-top: 32px;
  padding: clamp(20px, 4vw, 40px);
  border-top: 2px solid var(--color-accent);
  background: var(--color-surface);
}
.demo-request[hidden], #demo-request-link[hidden] { display: none; }
.demo-request h3 { margin: 0; font-size: clamp(23px, 3vw, 32px); }
.demo-request fieldset { display: grid; gap: 12px; padding: 0; border: 0; margin: 0; min-inline-size: 0; }
.demo-request label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.demo-request input, .demo-request textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  font: inherit; color: var(--color-text); background: var(--color-bg);
  border: 1px solid var(--color-divider); border-radius: 0;
}
.demo-request textarea { resize: vertical; }
.demo-request .note { margin: 0; }
.demo-request button { justify-self: start; }
#demo-request-status:not(:empty) { margin-top: 14px; color: var(--color-text); }

/* — FAQ — */
.faq { padding: clamp(56px, 7vw, 84px) 0; }
.faq .kicker { margin-bottom: 8px; }
.faq-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 8px clamp(32px, 6vw, 96px); padding: 24px 0; border-bottom: 1px solid var(--color-divider);
}
.faq-row h3 { font-size: 18px; line-height: 1.35; margin: 0; }
.faq-row .body { margin: 0; }

/* — closing CTA and footer — */
.closer { background: var(--color-accent-strong); color: var(--color-bg); }
.closer .wrap { padding-block: clamp(64px, 8vw, 96px); }
.closer h2 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 0 -0.05em; max-width: 16ch; }
.closer .cta-row { margin-top: 36px; }
.footer { display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; padding-block: 28px; font-size: 13px; color: var(--color-muted); }
.footer span { margin-right: auto; }
/* Phones: brand on its own line, links together below it. */
@media (max-width: 720px) { .footer { gap: 4px 20px; } .footer span { flex-basis: 100%; margin-bottom: 4px; } }
.footer a { display: inline-block; padding-block: 6px; }

/* — imprint — */
.page { padding-block: clamp(48px, 7vw, 84px); }
.page h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.025em; margin-bottom: 32px; }
.page p { font-size: 16px; line-height: 1.65; }

/* — legal pages (privacy, pilot terms) — */
.legal { max-width: 860px; }
.legal h1 { margin-bottom: 12px; }
/* Long German compounds (Datenschutzerklärung) would push the page sideways on phones. */
.legal h1, .legal h2 { hyphens: auto; overflow-wrap: break-word; }
.legal h1 + .note { margin: 0 0 40px; }
.legal h2 { font-size: 20px; line-height: 1.3; margin: 36px 0 10px; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.65; max-width: 72ch; }
.legal ol, .legal ul { margin: 0 0 12px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal .rule { margin: 64px 0 48px; }
.legal code { font-size: 14px; }
.legal .summary { border-top: 2px solid var(--color-text); padding-top: 16px; }

/* — planning guide (reuses the legal page layout) — */
.guide .kicker { margin-bottom: 12px; }
.guide h2 { font-size: 24px; margin-top: 48px; }
.guide .table-scroll { margin: 16px 0 20px; }
/* The phone rule above turns the plan table into cards; the guide tables scroll sideways inside their box instead. */
@media screen and (max-width: 720px) { .guide .table-scroll { overflow-x: auto; } .guide .table { min-width: 560px; } }
.guide .table th[scope="row"] {
  font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--color-text);
  border-bottom-width: 1px; vertical-align: top; white-space: nowrap;
}
/* Automatic hyphenation splits words badly on wide screens ("Sho-pify", "produc-tion"); only German titles on phones need it. */
.guide h1, .guide h2 { hyphens: manual; }
@media (max-width: 720px) { .guide h1:lang(de), .guide h2:lang(de) { hyphens: auto; } }
.guide .cta-row { margin-top: 24px; }

/* — pilot account — */
.account-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-block: 16px; padding: 12px 14px; background: var(--color-bg); border-left: 3px solid var(--color-accent); }
.account-bar #account-who { font-weight: 700; }
.account-bar .note { margin: 0; flex-basis: 100%; }
.account-bar .note:empty { display: none; }
.account-page { max-width: 640px; }
.account-form { display: grid; gap: 14px; margin-block: 24px; max-width: 420px; }
/* display: grid would otherwise override the hidden attribute. */
.account-form[hidden], .account-bar[hidden] { display: none; }
.account-form label { display: grid; gap: 6px; font-weight: 600; }
.account-form input { font: inherit; padding: 10px 12px; border: 1px solid var(--color-divider); background: var(--color-bg); color: var(--color-text); }
.account-status:empty { display: none; }
.account-status { padding: 10px 14px; background: var(--color-accent-100); color: var(--color-accent-800); }
.account-delete { margin-top: 40px; }
@media print { .account-bar { display: none !important; } }

/* — print — */
.plan-summary { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.plan-summary:empty { display: none; }
@media screen { .print-meta { display: none; } }
/* With a plan loaded, a printout is the plan alone: one sheet to pin up in the workshop.
   Without a plan, the page prints as it is. */
@media print {
  @page { margin: 14mm; }
  body.has-plan { background: #fff; color: #000; }
  body.has-plan > :not(main), body.has-plan main > :not(#demo), body.has-plan #demo > :not(#result) { display: none !important; }
  body.has-plan .demo { margin: 0; padding: 0; background: none; border: 0; }
  body.has-plan .result-tools, body.has-plan #rows details, body.has-plan .edit-inputs { display: none !important; }
  body.has-plan .result-head h3 { font-size: 20pt; }
  body.has-plan .print-meta { margin: 0 0 6mm; font-size: 9pt; color: #444; }
  body.has-plan .body { font-size: 9.5pt; max-width: none; }
  body.has-plan .table-scroll { overflow: visible; background: none; }
  body.has-plan .table { font-size: 10pt; }
  body.has-plan .table th { color: #000; }
  body.has-plan #rows tr { break-inside: avoid; }
  body.has-plan #rows input { border: 0; padding: 0; min-height: 0; background: none; width: 4em; font-weight: 700; }
  body.has-plan #rows td:nth-child(7) { font-weight: 700; }
}
