:root {
  --navy: #14284b;
  --navy-deep: #0d1c36;
  --ink: #101b2d;
  --amber: #f2a93b;
  --amber-dark: #db901f;
  --paper: #f6f8fb;
  --header-gray: #eef1f6;
  --grid: #e0e6ee;
  --muted: #566275;
  --white: #ffffff;

  --rh: 40px;          /* spreadsheet row height */
  --cw: 128px;         /* spreadsheet column width */
  --gutter: 48px;      /* row-number column */
  --hdr: 28px;         /* column-letter row */
  --page-pad: clamp(20px, 5vw, 72px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); text-underline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0;
  font-stretch: 112%;
  color: var(--navy);
  text-wrap: balance;
}

p { margin: 0; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  background: var(--navy);
  color: var(--white);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--page-pad);
  background: var(--white);
  border-bottom: 1px solid var(--grid);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 800;
  font-stretch: 118%;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand img { border-radius: 6px; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.98rem;
  font-weight: 550;
}
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.site-header .nav-shop {
  padding: 8px 16px;
  border: 1.5px solid var(--navy);
  border-radius: 4px;
}
.site-header .nav-shop:hover { background: var(--navy); color: var(--white); text-decoration: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--rh);
  padding: 0 22px;
  border-radius: 4px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--navy-deep); }
.btn-primary:hover { background: var(--amber-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-quiet { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-quiet:hover { background: var(--navy); color: var(--white); }

/* ---------- Hero: the spreadsheet ---------- */

.sheet {
  position: relative;
  overflow: hidden;
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cw) var(--rh);
  background-position: calc(var(--gutter) - 1px) calc(var(--hdr) - 1px);
  border-bottom: 1px solid var(--grid);
}

.sheet-cols {
  display: grid;
  grid-template-columns: var(--gutter) repeat(12, var(--cw));
  height: var(--hdr);
  background: var(--header-gray);
  border-bottom: 1px solid #cfd7e2;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: var(--hdr);
  text-align: center;
  position: relative;
  z-index: 1;
}
.sheet-cols span { border-right: 1px solid #cfd7e2; }

.sheet-rows {
  position: absolute;
  top: var(--hdr);
  left: 0;
  width: var(--gutter);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--header-gray);
  border-right: 1px solid #cfd7e2;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  z-index: 1;
}
.sheet-rows li { height: var(--rh); line-height: var(--rh); border-bottom: 1px solid #dfe5ee; }

.sheet-body {
  position: relative;
  margin-left: calc(var(--gutter) + var(--cw));
  padding: var(--rh) var(--page-pad) calc(var(--rh) * 2) 0;
}

.selection {
  position: relative;
  display: inline-block;
  max-width: min(100%, 23ch);
  padding: 0 14px;
  margin-left: -14px;
  font-size: clamp(2.05rem, 4.2vw + 0.6rem, 4.3rem);
}
.selection::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--navy);
  background: rgba(20, 40, 75, 0.045);
  animation: select-range 0.9s cubic-bezier(0.25, 0.7, 0.2, 1) 0.2s both;
}
.handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--navy);
  border: 2px solid var(--white);
  animation: handle-in 0.25s ease-out 1.05s both;
}

h1 {
  position: relative;
  font-size: 1em;
  font-weight: 800;
  line-height: calc(var(--rh) * 2);
  letter-spacing: -0.01em;
}

@keyframes select-range {
  from { clip-path: inset(0 100% calc(100% - var(--rh)) 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes handle-in {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-sub {
  margin-top: var(--rh);
  max-width: 46ch;
  font-size: 1.2rem;
  line-height: var(--rh);
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--rh);
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(64px, 9vw, 120px) var(--page-pad);
  max-width: 1240px;
  margin: 0 auto;
}

.about h2,
.tools > h2 {
  font-size: clamp(1.75rem, 2.2vw + 1rem, 2.6rem);
  font-weight: 760;
  line-height: 1.15;
  margin-bottom: 24px;
}

.about-text p { max-width: 60ch; }
.about-text p + p { margin-top: 1em; }

.facts { margin: 0; align-self: end; }
.facts > div {
  padding: 18px 0;
  border-top: 2px solid var(--navy);
}
.facts > div + div { border-top-width: 1px; border-top-color: var(--grid); }
.facts dt { font-weight: 700; font-stretch: 108%; color: var(--navy); }
.facts dd { margin: 4px 0 0; color: var(--muted); }

/* ---------- Tools ---------- */

.tools {
  padding: 0 var(--page-pad) clamp(64px, 9vw, 120px);
  max-width: 1240px;
  margin: 0 auto;
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 8px;
}
.featured-img img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--grid);
}
.featured h3 {
  font-size: clamp(1.5rem, 1.4vw + 1rem, 2rem);
  font-weight: 760;
  line-height: 1.2;
  margin: 6px 0 14px;
}
.featured-body > p:not(.format) { max-width: 46ch; }

.format {
  font-size: 0.92rem;
  color: var(--muted);
}

.buy {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}
.price {
  font-size: 1.75rem;
  font-weight: 750;
  font-stretch: 104%;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.upcoming { margin-top: 56px; }
.upcoming-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.upcoming ul { list-style: none; margin: 0; padding: 0; }
.upcoming li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--grid);
}
.upcoming li:last-child { border-bottom: 1px solid var(--grid); }
.upcoming h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.upcoming p { color: var(--muted); max-width: 62ch; }
.upcoming .format { text-align: right; }

/* ---------- Signup ---------- */

.signup {
  background: var(--navy);
  color: var(--white);
  padding: clamp(56px, 8vw, 96px) var(--page-pad);
}
.signup-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}
.signup h2 {
  color: var(--white);
  font-size: clamp(1.75rem, 2.2vw + 1rem, 2.6rem);
  font-weight: 760;
  line-height: 1.15;
  margin-bottom: 12px;
}
.signup p { color: #d3dbe8; max-width: 44ch; }
.signup :focus-visible { outline-color: var(--amber); }

.signup-form label { display: block; font-weight: 600; margin-bottom: 8px; }
.field-row { display: flex; gap: 10px; }
.field-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}
.field-row .btn { min-height: 48px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { min-height: 1.6em; margin-top: 12px; font-size: 0.98rem; }
.form-status[data-state="ok"] { color: #b4ecc6; }
.form-status[data-state="error"] { color: #ffc2b5; }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 40px var(--page-pad);
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 1240px;
  margin: 0 auto;
}
.footer-brand { font-weight: 800; font-stretch: 118%; color: var(--navy); margin-bottom: 4px; }
.footer-fine { text-align: right; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .about,
  .featured,
  .signup-inner { grid-template-columns: 1fr; }
  .upcoming li { grid-template-columns: 1fr; gap: 6px; }
  .upcoming .format { text-align: left; }
  .footer-fine { text-align: left; }
}

@media (max-width: 640px) {
  :root { --cw: 92px; --gutter: 34px; }
  .site-header nav a:not(.nav-shop) { display: none; }
  .sheet-body {
    margin-left: calc(var(--gutter) + 14px);
    padding: var(--rh) 18px calc(var(--rh) * 1.5) 0;
  }
  .selection { padding: 0 10px; margin-left: -10px; }
  h1 { line-height: var(--rh); }
  .hero-sub { font-size: 1.05rem; line-height: 1.55; }
  .field-row { flex-direction: column; }
  .field-row input { flex: none; }
  .buy { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .selection::before, .handle { animation: none; }
}
