/* Nakos Checkout
   Brand from nakos.org: dark phosphor, orange accent, the N mark, an 80s grid horizon.
   Signature: the till receipt. The hero's worked example and every calculator result print on
   thermal paper, because "every claim shows its arithmetic" is the pitch. Everything else stays quiet.
   Type: heavy, tight system sans for headlines; system sans for reading; monospace for labels,
   prices and anything printed. No web fonts, no external requests, no inline styles (strict CSP).
   Contrast meets WCAG 2.2 AA in dark and light. */

:root {
  --bg: #0b0907;
  --panel: #15110c;
  --line: #3a2c1c;
  --fg: #f3dfbd;
  --dim: #a38b68;
  --accent: #ff8a1e;
  --hot: #ffb36b;
  --accent-ink: #0b0907;
  --glow: rgba(255, 138, 30, 0.35);
  --paper: #f6efe1;
  --paper-ink: #1d160e;
  --paper-dim: #5e5243;
  --paper-accent: #9a4300;
  --f-sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans",
    Arial, sans-serif;
  --f-mono:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Liberation Mono",
    "Courier New", monospace;
  --measure: 62ch;
  --s-1: 0.8125rem;
  --s0: 1rem;
  --s1: 1.1875rem;
  --s2: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  --s3: clamp(2rem, 1.3rem + 3.2vw, 3.4rem);
  --radius: 6px;
  color-scheme: dark;
}
/* Paper (light): warm cream, softer than white. The receipt is a shade lighter so it still reads
   as paper. It follows the system setting unless the visitor picked a mode with the toggle,
   which sets data-theme on <html>. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f1e7;
    --panel: #eee7d9;
    --line: #d6cab3;
    --fg: #1f1810;
    --dim: #5a5248;
    --accent: #a84a00;
    --hot: #873b00;
    --accent-ink: #ffffff;
    --glow: rgba(168, 74, 0, 0.15);
    --paper: #fffaf0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f1e7;
  --panel: #eee7d9;
  --line: #d6cab3;
  --fg: #1f1810;
  --dim: #5a5248;
  --accent: #a84a00;
  --hot: #873b00;
  --accent-ink: #ffffff;
  --glow: rgba(168, 74, 0, 0.15);
  --paper: #fffaf0;
  color-scheme: light;
}

/* ---------- base ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  /* the grid horizon is wider than the screen; clip it without making a scroll container */
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--s0) / 1.6 var(--f-sans);
  padding-inline: 16px;
  overflow-x: clip;
  overflow-wrap: break-word;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--hot);
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
  z-index: 70;
}
.skip:focus {
  top: 0.5rem;
}
.wrap {
  max-width: 68rem;
  margin-inline: auto;
}
.col {
  max-width: var(--measure);
}
.dim {
  color: var(--dim);
}

/* ---------- header ---------- */
.bar {
  margin-inline: -16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font: 700 var(--s0) / 1 var(--f-mono);
  letter-spacing: 0.02em;
}
.brand svg {
  height: 30px;
  width: auto;
  fill: var(--accent);
  filter: drop-shadow(0 0 8px var(--glow));
}
.bar nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font: 500 var(--s-1) / 1.6 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bar nav a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--dim);
  text-decoration: none;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--fg);
  box-shadow: inset 0 -2px var(--accent);
}

/* ---------- type ---------- */
main {
  padding-block: 2.5rem 4rem;
}
main > section + section {
  margin-top: clamp(3.5rem, 2rem + 5vw, 6rem);
}
h1,
h2,
h3 {
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  text-wrap: balance;
}
h1 {
  font-size: var(--s3);
  margin-top: 0.25rem;
}
h2 {
  font-size: var(--s2);
}
h3 {
  font-size: var(--s1);
  letter-spacing: -0.01em;
}
p,
ul,
ol {
  margin: 0 0 1rem;
}
.lede {
  font-size: var(--s1);
  max-width: var(--measure);
}
.kicker {
  font: 600 var(--s-1) / 1.4 var(--f-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.5rem;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-bottom: 4rem;
}
@media (min-width: 56rem) {
  .hero {
    grid-template-columns: 1.25fr 1fr;
    gap: 3.5rem;
  }
}
/* the grid horizon, as on nakos.org, fading out under the hero */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -2rem;
  width: 140vw;
  height: 12rem;
  transform: translateX(-50%) perspective(260px) rotateX(62deg);
  transform-origin: bottom;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to top, #000, transparent 85%);
  pointer-events: none;
}
.problems {
  list-style: none;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--accent);
  max-width: var(--measure);
}
.problems li + li {
  margin-top: 0.5rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- the receipt (signature) ---------- */
.receipt,
.result {
  --tooth: 9px;
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  font: 400 var(--s-1) / 1.5 var(--f-mono);
  padding: 1.25rem 1.25rem 1.75rem;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 18px 40px -18px rgba(0, 0, 0, 0.6);
  /* torn bottom edge */
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom /
    calc(var(--tooth) * 2) var(--tooth) repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 0.5px) no-repeat;
}
.receipt {
  margin: 0;
  max-width: 24rem;
  justify-self: center;
  width: 100%;
  rotate: -1.5deg;
  animation: print 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms both;
}
@keyframes print {
  from {
    clip-path: inset(0 0 100% 0);
    translate: 0 -1.5rem;
  }
  to {
    clip-path: inset(0 0 0 0);
    translate: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .receipt {
    animation: none;
  }
}
.receipt-head {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0 0 0.25rem;
}
.receipt figcaption {
  text-align: center;
  color: var(--paper-dim);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--paper-dim);
}
.receipt dl {
  margin: 0;
}
.receipt .row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding-block: 0.2rem;
}
.receipt .row dt {
  flex: 1;
  display: flex;
  gap: 0.5rem;
}
.receipt .row dt::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--paper-dim);
  translate: 0 -0.3em;
}
.receipt dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}
.receipt .rule {
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--paper-dim);
}
.receipt .total {
  font-size: var(--s0);
}
.receipt .total dd {
  color: var(--paper-accent);
}
.receipt-foot {
  text-align: center;
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--paper-dim);
  color: var(--paper-dim);
}

/* ---------- package cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition:
    border-color 150ms,
    translate 150ms;
}
.card:hover {
  border-color: var(--accent);
  translate: 0 -2px;
}
.card h3 {
  margin: 0.25rem 0 0.5rem;
}
.card h3 a {
  color: var(--fg);
  text-decoration: none;
}
/* the whole card is the link target */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card .price {
  font: 700 var(--s2) / 1.1 var(--f-mono);
  color: var(--accent);
  margin: 0.25rem 0 0;
}
.card .terms {
  font: 400 var(--s-1) / 1.4 var(--f-mono);
  color: var(--dim);
  margin: 0.25rem 0 1rem;
}
.card .more {
  margin: auto 0 0;
  padding-top: 0.5rem;
  font: 600 var(--s-1) / 1.4 var(--f-mono);
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  .card:hover {
    translate: none;
  }
}

/* ---------- steps: a real sequence, so it is numbered ---------- */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 56rem) {
  .steps.track {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
  .steps.track li {
    padding: 3rem 0 0;
  }
  .steps.track li::after {
    content: "";
    position: absolute;
    top: 1rem;
    left: 2.5rem;
    right: -1.25rem;
    border-top: 1px dashed var(--line);
  }
  .steps.track li:last-child::after {
    display: none;
  }
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 700 var(--s-1) / 1 var(--f-mono);
}
.steps strong,
.steps h2 {
  display: block;
  font-size: var(--s1);
  margin: 0 0 0.25rem;
}

/* ---------- buttons ---------- */
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius);
  padding: 0.75rem 1.3rem;
  font: 700 var(--s0) / 1.2 var(--f-sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 var(--glow);
  transition: box-shadow 150ms;
}
.button:hover {
  color: var(--accent-ink);
  background: var(--hot);
  box-shadow: 0 0 0 6px var(--glow);
}

/* ---------- package page ---------- */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1.5rem 0;
}
.facts dt {
  font: 600 var(--s-1) / 1.6 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.facts dd {
  margin: 0;
}
@media (max-width: 30rem) {
  .facts {
    grid-template-columns: 1fr;
  }
  .facts dd {
    margin-bottom: 0.5rem;
  }
}

/* ---------- calculator ---------- */
.calc {
  display: grid;
  gap: 2rem;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
@media (min-width: 56rem) {
  .calc {
    grid-template-columns: 1fr 1fr;
  }
}
.calc fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}
.calc label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.calc input,
.calc select {
  width: 100%;
  font: 400 var(--s0) / 1.4 var(--f-mono);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.calc input:focus-visible,
.calc select:focus-visible {
  border-color: var(--accent);
}
.calc .hint {
  font-size: var(--s-1);
  color: var(--dim);
  margin: 0.3rem 0 0;
}
.result p {
  margin: 0;
}
.result .big {
  font: 700 var(--s2) / 1.2 var(--f-mono);
  margin: 0.15rem 0 0.25rem;
}
.result .formula {
  color: var(--paper-dim);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--paper-dim);
}
.result .formula:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.result .dim {
  color: var(--paper-dim);
}
.result .error {
  color: var(--paper-accent);
  font-weight: 700;
}

/* ---------- booking, order and address forms ---------- */
.form {
  max-width: 36rem;
  display: grid;
  gap: 1.25rem;
}
.form .field label,
.form legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.form input:not([type="radio"]),
.form select,
.form textarea {
  width: 100%;
  font: 400 var(--s0) / 1.4 var(--f-sans);
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--dim);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  border-color: var(--accent);
}
.form .hint,
.hint {
  font-size: var(--s-1);
  color: var(--dim);
  margin: 0.3rem 0 0;
}
.form .invalid input,
.form .invalid select,
.form .invalid textarea {
  border-color: var(--accent);
  border-width: 2px;
}
.field-error {
  font: 600 var(--s-1) / 1.4 var(--f-mono);
  color: var(--accent);
  margin: 0.35rem 0 0;
}
.radios {
  border: 0;
  margin: 0;
  padding: 0;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1.5rem;
  font-weight: 400;
}
.radio input {
  accent-color: var(--accent);
  width: 1.1rem;
  height: 1.1rem;
}
/* spam trap: off-screen for people and screen readers */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* IDs are case-sensitive: never transform them */
.id {
  text-transform: none;
  letter-spacing: 0.02em;
}
.notice {
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  max-width: var(--measure);
}
.invoices {
  border-collapse: collapse;
  font: 400 var(--s-1) / 1.5 var(--f-mono);
  margin-bottom: 1.5rem;
}
.invoices th,
.invoices td {
  text-align: left;
  padding: 0.4rem 1.25rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.invoices th {
  color: var(--dim);
  font-weight: 600;
}

/* ---------- FAQ, legal ---------- */
.faq dt {
  font-weight: 700;
  font-size: var(--s1);
  margin-top: 1.75rem;
}
.faq dd {
  margin: 0.4rem 0 0;
}
.draft {
  font: 600 var(--s-1) / 1.5 var(--f-mono);
  border: 1px dashed var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

/* ---------- theme toggle (shown only when JavaScript runs) ---------- */
.theme {
  font: 500 var(--s-1) / 1.6 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
/* Narrow: logo and toggle share the top row, the menu wraps below. Wide: one row. */
.bar .brand {
  margin-right: auto;
}
.bar nav {
  order: 3;
  flex-basis: 100%;
}
@media (min-width: 64rem) {
  .bar nav {
    order: 0;
    flex-basis: auto;
  }
}
.theme:hover {
  color: var(--fg);
  border-color: var(--accent);
}
.theme[hidden] {
  display: none;
}

/* ---------- admin ---------- */
.filters,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 1rem 0;
}
.filters select,
.filters input,
.actions select,
.admin input[type="file"] {
  font: inherit;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--dim);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
}
.admin .invoices {
  width: 100%;
  display: block;
  overflow-x: auto;
}
.admin pre {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
}
.admin details {
  margin: 1rem 0;
}
.admin summary {
  cursor: pointer;
  color: var(--accent);
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-inline: -16px;
  padding: 1.75rem 16px 2.5rem;
  font-size: var(--s-1);
  color: var(--dim);
}
footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-family: var(--f-mono);
}
