/* Ben's Bites house style (~/bites/DESIGN.md). Copy lives in index.html. */

:root {
  --page: #fcfcfc;
  --surface: #ffffff;
  --soft: #f7f7f5;
  --sunken: #f0f0ee;
  --hairline: #e6e6e3;
  --ink: #1c1c1a;
  --ink-hover: #000000;
  --on-ink: #ffffff;
  --body: #62625f;
  --muted: #70706c;
  --accent: #2456f5;
  --on-accent: #ffffff;
  --live: #2f8f4e;
  --ring: 0 0 0 1px rgb(0 0 0 / 0.08);
  --raised: 0 0 0 1px rgb(0 0 0 / 0.05), 0 1px 3px rgb(0 0 0 / 0.05), 0 4px 10px -4px rgb(0 0 0 / 0.05);
  --raised-hover: 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.07), 0 4px 10px -4px rgb(0 0 0 / 0.08);
  --mono: "Berkeley Mono", "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  --col: 680px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121212;
    --surface: #1c1c1b;
    --soft: #181817;
    --sunken: #222220;
    --hairline: #2e2e2b;
    --ink: #ededea;
    --ink-hover: #ffffff;
    --on-ink: #121212;
    --body: #a8a8a3;
    --muted: #8f8f8a;
    --accent: #7c9dff;
    --on-accent: #121212;
    --live: #57b874;
    --ring: 0 0 0 1px rgb(255 255 255 / 0.08);
    --raised: 0 0 0 1px rgb(255 255 255 / 0.05), 0 1px 3px rgb(255 255 255 / 0.05), 0 4px 10px -4px rgb(255 255 255 / 0.05);
    --raised-hover: 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 3px rgb(255 255 255 / 0.07), 0 4px 10px -4px rgb(255 255 255 / 0.08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--body);
  font: 400 16px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ink); color: var(--page); }

/* ---------- layout: one reading column ---------- */
.top, main, footer {
  width: 100%;
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
}
.brand { color: var(--ink); font-weight: 500; font-size: 14px; text-decoration: none; border-radius: 4px; }

section { padding-top: 88px; }
section.intro { padding-top: 48px; }

h1, h2, h3, dt { color: var(--ink); font-weight: 500; text-wrap: balance; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 16px; }
h2 { font-size: 20px; line-height: 1.25; margin-bottom: 12px; }
h3 { font-size: 16px; line-height: 1.4; }
p + p { margin-top: 12px; }
p { text-wrap: pretty; }

.note { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 20px; }

a { color: var(--ink); text-underline-offset: from-font; text-decoration-thickness: from-font; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (min-width: 1024px) {
  section.intro { padding-top: 92px; }
  .top { padding-top: 24px; }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out;
}
/* 44px hit area */
.btn::after { content: ""; position: absolute; inset: -6px -2px; }
.btn:active { transform: scale(0.96); }
.btn-quiet { background: var(--surface); color: var(--ink); box-shadow: var(--raised); }
.btn-pill { background: var(--surface); color: var(--ink); box-shadow: var(--raised); }
.end .btn { background: var(--accent); color: var(--on-accent); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink-hover); }
  .btn-quiet:hover, .btn-pill:hover { background: var(--surface); box-shadow: var(--raised-hover); }
  .end .btn:hover { background: var(--accent); filter: brightness(0.94); }
}

/* ---------- what we make: tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 24px;
  margin-top: 24px;
}
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .tiles { margin-left: -32px; margin-right: -32px; } }

.tile { min-width: 0; }
.shot {
  aspect-ratio: 16 / 10;
  background: var(--soft);
  border-radius: 12px;
  box-shadow: var(--ring);
  overflow: hidden;
  margin-bottom: 12px;
}
.shot img { display: block; width: 100%; height: 100%; }
.tile h3 { margin-bottom: 2px; }
.tile p { font-size: 15px; line-height: 1.55; }

/* ---------- how a season works ---------- */
.steps { list-style: none; counter-reset: step; margin-top: 32px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}
.steps li:last-child { border-bottom: 1px solid var(--hairline); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: var(--muted);
}
.steps p { font-size: 15px; line-height: 1.55; }

/* ---------- who reads: stats ---------- */
.stats { margin-top: 24px; }
.stats > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}
.stats > div:last-child { border-bottom: 1px solid var(--hairline); }
.stats b {
  color: var(--ink);
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stats small { font-size: 16px; letter-spacing: 0; color: var(--body); font-weight: 400; margin-left: 6px; }
.stats span { font-size: 15px; line-height: 1.5; }
@media (min-width: 640px) {
  .stats > div { grid-template-columns: 220px 1fr; align-items: center; gap: 16px; }
  .stats b { font-size: 56px; }
}

/* ---------- seasons table ---------- */
.table {
  margin-top: 24px;
  overflow-x: auto;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--ring);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--sunken); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--ink); font-weight: 500; }
td b { color: var(--ink); font-weight: 500; font-size: 14px; }
.num { text-align: right; }
.price { color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.dates { display: block; color: var(--muted); margin-top: 2px; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: var(--sunken);
  color: var(--body);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.01em;
  vertical-align: 1px;
}
.open { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.open::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: var(--live); }

.gets-label { margin-top: 40px; color: var(--ink); font-weight: 500; font-size: 15px; }
.gets-label + .gets { margin-top: 12px; }
.gets {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 24px;
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.5;
}
.gets > li { position: relative; padding-left: 24px; }
.gets > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- good to know ---------- */
.faq { margin-top: 32px; }
.faq dt { padding-top: 16px; border-top: 1px solid var(--hairline); }
.faq dd { padding: 2px 0 16px; font-size: 15px; line-height: 1.55; }
.faq dd:last-child { border-bottom: 1px solid var(--hairline); }
@media (min-width: 640px) {
  .faq { display: grid; grid-template-columns: 140px 1fr; column-gap: 0; }
  .faq dt, .faq dd { padding: 16px 0; border-top: 1px solid var(--hairline); }
  .faq dt { padding-right: 16px; }
  .faq dd:last-child { border-bottom: 1px solid var(--hairline); }
  .faq dt:nth-last-of-type(1) { border-bottom: 1px solid var(--hairline); }
}

/* ---------- end ---------- */
section.end { padding-top: 128px; }
footer { padding-top: 96px; padding-bottom: 72px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-width: 639px) {
  /* seasons table becomes stacked rows: season on the left, price + spots on the right */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px; border-bottom: 1px solid var(--sunken); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table td:first-child { grid-row: span 2; }
  .table td.price { text-align: right; }
  .table td:last-child { grid-column: 2; text-align: right; font-size: 13px; }
  .badge { display: table; margin: 6px 0 0; white-space: nowrap; }
  .dates { margin-top: 4px; }
}

/* ---------- brand, callout, logos ---------- */
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { display: block; height: 24px; width: auto; }


.logos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-items: center;
  gap: 28px 16px;
  margin-top: 16px;
}
@media (min-width: 640px) { .logos { grid-template-columns: repeat(5, 1fr); } }
.logos img {
  display: block;
  height: var(--h, 22px);
  width: auto;
  max-width: 100%;
  filter: grayscale(1) brightness(0);
  opacity: 0.55;
}
@media (prefers-color-scheme: dark) {
  .logos img { filter: grayscale(1) brightness(0) invert(1); opacity: 0.6; }
}

/* ---------- who reads: big stats, coding bar, reach row ---------- */
.aud-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; margin-top: 40px; }
.aud-stats b { display: block; color: var(--ink); font-weight: 500; font-size: 48px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.aud-stats b small { font-size: 20px; margin-left: 2px; letter-spacing: 0; }
.aud-stats strong { display: block; margin-top: 10px; color: var(--ink); font-weight: 500; font-size: 14px; line-height: 20px; }
.aud-stats span { display: block; font-size: 14px; line-height: 1.45; }
@media (min-width: 640px) { .aud-stats { grid-template-columns: repeat(2, 1fr); gap: 32px; } }

.code-bar, .code-legend { --g1: #dcdcd8; --g2: #b9b9b5; --g4: #1c1c1a; }
@media (prefers-color-scheme: dark) { .code-bar, .code-legend { --g1: #3a3a37; --g2: #5c5c58; --g4: #ededea; } }
.c1 { --c: var(--g1); --t: var(--ink); }
.c2 { --c: var(--g2); --t: var(--ink); }
.c3 { --c: var(--accent); --t: var(--on-accent); }
.c4 { --c: var(--g4); --t: var(--page); }
.code-bar { display: flex; gap: 3px; height: 56px; margin-top: 56px; }
.code-bar div { position: relative; width: calc(var(--w) - 3px); border-radius: 4px; background: var(--c); }
.code-bar span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--t); font-variant-numeric: tabular-nums; }
.code-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin-top: 16px; color: var(--ink); font-weight: 500; font-size: 13px; line-height: 1.4; }
@media (min-width: 640px) { .code-legend { grid-template-columns: repeat(4, 1fr); } }
.code-legend div { display: flex; gap: 8px; align-items: baseline; }
.code-legend i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.aud-where { margin-top: 40px; }
.aud-where b { color: var(--ink); font-weight: 500; }
.reach { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.reach b { display: block; color: var(--ink); font-weight: 500; font-size: 24px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.reach span { display: block; font-size: 13px; line-height: 1.4; }
@media (min-width: 640px) { .reach { grid-template-columns: repeat(4, 1fr); } }
.aud-src { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 16px; }

/* three tiles: one column until there is room for three */
@media (min-width: 640px) { .tiles-3 { grid-template-columns: repeat(3, 1fr); gap: 32px 16px; } }
@media (min-width: 1024px) { .tiles-3 { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }

/* sub-list inside "What you get for a season" */
.gets .sub { list-style: disc; display: grid; gap: 4px; margin-top: 6px; padding-left: 18px; }
.gets .sub li { padding-left: 2px; }
.gets .sub li::marker { color: var(--muted); }

/* "What you get" tiles break out wider than the text column */
@media (min-width: 1024px) { .tiles-3 { margin-left: -64px; margin-right: -64px; gap: 32px 24px; } }
@media (min-width: 1280px) { .tiles-3 { margin-left: -120px; margin-right: -120px; gap: 32px 28px; } }

/* extra breathing room on bigger screens */
@media (min-width: 1024px) {
  section { padding-top: 128px; }
  section.end { padding-top: 160px; }
  .tiles, .table, .steps, .faq { margin-top: 40px; }
}
.note { margin-top: 28px; }
