@import url("/static/css/fonts.css");

:root {
  --bg: #FBF7EF;
  --paper: #FFFCF6;
  --ink: #241A10;
  --muted: #5D4B38;
  --line: #E7D9BF;
  --amber: #E5A31F;
  --amber-hover: #d09218;
  --amber-active: #b88212;
  --focus: #8A5200;
  --bad: #8d2b22;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }

h1, h2, p { margin: 0; }

h1 {
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.02em; }

a { color: inherit; }

.frame {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
}

.demo-mark {
  display: inline-flex;
  width: fit-content;
  justify-self: start;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #FFF1D2;
  color: var(--focus);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile { position: relative; }

.profile summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.profile a {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.profile a:hover { background: #F6EFE2; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 32px;
}

.hero-tile,
.hero-corner {
  position: absolute;
  pointer-events: none;
}

.hero-tile {
  inset: 0;
  background-image: url("/static/img/honeycomb-tile.png");
  background-size: 108px 62px;
  opacity: 0.25;
  -webkit-mask-image: linear-gradient(90deg, #000 0 28px, transparent 140px, transparent calc(100% - 140px), #000 calc(100% - 28px));
  mask-image: linear-gradient(90deg, #000 0 28px, transparent 140px, transparent calc(100% - 140px), #000 calc(100% - 28px));
}

.hero-corner {
  top: 16px;
  right: 24px;
  width: 140px;
  height: 140px;
}

.hero-grid,
.cards,
.how,
.page { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(360px, 38%);
  gap: 32px;
  align-items: center;
}

.lead { margin-top: 16px; color: var(--muted); font-size: 18px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hint { margin-top: 16px; color: var(--muted); font-size: 15px; }

.hero-art { width: min(100%, 360px); height: auto; justify-self: end; }

.btn, .btn-ghost, .text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.btn {
  border: 0;
  background: var(--amber);
  color: var(--ink);
}

.btn:hover { background: var(--amber-hover); }
.btn:active { background: var(--amber-active); }

.btn-ghost, .text-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.btn-ghost:hover, .text-btn:hover { background: #F6EFE2; }

.text-btn { min-height: 44px; padding: 0 12px; }

.section { padding: 16px 0 48px; }

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.card:hover { border-color: #C9A36A; background: #FFF9F0; }

.card img { width: 72px; height: 72px; }

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

.card-action {
  margin-top: auto;
  padding-top: 8px;
  color: var(--focus);
  font-weight: 600;
}

.status { color: var(--muted); font-size: 14px; }

.how { padding-bottom: 48px; }

.how h2 { margin-bottom: 16px; }

.steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
}

.steps a:hover { color: var(--focus); }

.steps span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  font-variant-numeric: tabular-nums;
}

.page { padding: 32px 0 48px; }

.page h1 { font-size: 36px; }

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}

.subnav a[aria-current="page"] {
  background: #FFF1D2;
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--amber);
}

.stack { display: grid; gap: 16px; margin-top: 24px; }

.fields {
  display: grid;
  gap: 16px;
}

.fields.two { grid-template-columns: 1fr 1fr; }

label, .pair {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input[type="number"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

input[type="range"] { width: 100%; height: 44px; accent-color: var(--amber); }

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

legend { padding: 0 8px; font-weight: 700; }

.field-error {
  min-height: 0;
  color: var(--bad);
  font-size: 14px;
  font-weight: 600;
}

.field-error:empty { display: none; }

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 600;
}

.check input { width: 22px; height: 22px; accent-color: var(--focus); }

.result {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.result-value {
  margin-top: 8px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 16px 0 0;
}

dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.month-bar h2 { font-variant-numeric: tabular-nums; }

.tasks { display: grid; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }

.tasks li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.counter { margin-top: 8px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.gate {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
}

.gate-card {
  width: min(28rem, 100%);
  display: grid;
  gap: 8px;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.gate-logo { width: 40px; height: 40px; }

.gate-card h1 { font-size: 40px; }
.gate-card .lead { margin: 0 0 8px; }
.gate-card .btn { margin-top: 8px; }
.row { display: flex; justify-content: flex-end; }

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

@media (max-width: 800px) {
  h1 { font-size: 32px; }
  .hero { padding-top: 32px; }
  .hero-grid, .fields.two, .cards { grid-template-columns: 1fr; }
  .hero-art { justify-self: start; order: 2; }
  .hero-copy { order: 1; }
  .hero-corner { display: none; }
  .page h1 { font-size: 30px; }
  .result-value { font-size: 32px; }
  .month-bar { flex-wrap: wrap; }
  .month-bar h2 { width: 100%; text-align: center; }
}

@media (max-width: 640px) {
  .frame { width: min(1160px, calc(100% - 32px)); }
}

.bar-inner { flex-wrap: wrap; }

.bar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.families-field,
.season-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.families-field input { width: 4.5rem; min-height: 44px; text-align: right; }
.season-field input { width: 6.5rem; min-height: 44px; }

.offline {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FFF1D2;
  color: var(--focus);
  font-size: 13px;
  font-weight: 700;
}

.banner,
.note {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #F8E4DF;
  color: var(--bad);
  font-weight: 600;
}

.note {
  background: #FFF6E4;
  color: var(--ink);
  font-weight: 500;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: start;
  margin-top: 24px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.panel h2 { margin-bottom: 4px; }
.panel .hint { margin-top: 4px; margin-bottom: 16px; }
.panel .fields { margin-top: 16px; }

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

label.invalid input {
  border-color: var(--bad);
  background: #FBF1EF;
}

.total,
.per-family {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #FFF1D2;
  font-weight: 700;
}

.per-family { background: transparent; padding-left: 0; padding-right: 0; }

.formula { margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }

.min-price { margin-top: 16px; font-weight: 700; }
.min-price strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.good { color: #1f6b3a; }
.bad { color: var(--bad); }

.metrics { display: grid; gap: 12px; margin-top: 16px; }
.metrics p { display: flex; justify-content: space-between; gap: 12px; }
.metrics span { color: var(--muted); }
.metric-value { font-variant-numeric: tabular-nums; font-size: 20px; }

.slider-label output {
  font-variant-numeric: tabular-nums;
  color: var(--focus);
}

.families-ro { margin: 16px 0; font-weight: 600; }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.toggle button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.toggle button[aria-pressed="true"] {
  background: #FFF1D2;
  border-color: var(--amber);
}

.scale {
  position: relative;
  height: 12px;
  margin: 28px 8px 8px;
  border-radius: 999px;
  background: #F6EFE2;
}

.scale-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.scale-mark {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 24px;
  background: var(--ink);
}

.table-panel { margin-top: 16px; }
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-weight: 500;
}

thead th { color: var(--muted); font-size: 14px; font-weight: 600; }

td.chosen, th.chosen { background: #FFF6E4; }

.main-row { background: #FFF6E4; }

.when { white-space: nowrap; font-weight: 700; }

.season-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.season-spring { background: #2f7d4a; }
.season-summer { background: var(--amber); }
.season-autumn { background: #3d6f8f; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.pills button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pills button[aria-pressed="true"] {
  background: #FFF1D2;
  box-shadow: inset 0 -2px 0 var(--amber);
}

.progress-panel { margin-top: 24px; }
.progress-head { margin-bottom: 8px; }
.progress { height: 10px; border-radius: 999px; background: #F6EFE2; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--amber); }

.check-list { display: grid; gap: 12px; margin-top: 16px; }

.check-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-weight: 500;
}

.check-card input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--focus); }

.num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFF1D2;
  font-weight: 700;
}

.check-card strong,
.check-card .field-hint,
.check-card .skip { display: block; }

.check-card .skip { margin-top: 6px; color: var(--focus); font-weight: 600; }
.check-card.done { background: #F3F7F1; }

@media (max-width: 800px) {
  .split, .toggle { grid-template-columns: 1fr; }
  .bar-tools { width: 100%; margin-left: 0; padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
  }
}
