:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --bg-soft: hsl(99, 48%, 11%);
  --text: hsl(0, 0%, 100%);
  --muted: hsl(99, 10%, 85%);
  --brand: hsl(99, 89%, 48%);
  --brand-2: hsl(99, 86%, 53%);
  --card: hsl(99, 10%, 5%);
  --ring: hsla(99, 86%, 53%, 0.5);
  --link: hsl(99, 85%, 72%);
  --shadow: 0 10px 30px hsla(99, 84%, 5%, 0.6);
}

* {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth;
}

html, body {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* pushes footer to bottom */
    margin-bottom: 40px; /* space above footer */
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 80% -10%,
      hsla(99, 100%, 57%, 0.05),
      transparent 60%
    ),
    radial-gradient(
      1500px 800px at -10% 10%,
      hsla(99, 100%, 48%, 0.15),
      transparent 60%
    ),
    var(--bg);
}

a {
  color: var(--link);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--brand);
  color: white;
  border-radius: 8px;
  z-index: 1000;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  margin-bottom: 10px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

nav a:hover {
  color: var(--text);
}

.cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--brand) 40%, var(--text) 8%);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--brand) 14%, transparent),
    color-mix(in oklab, var(--brand-2) 6%, transparent)
  );
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.btn:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 24px var(--ring);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: color-mix(in oklab, var(--text) 14%, transparent);
  color: var(--text);
}

/* Mobile nav */
.hamburger {
  display: none;
  background: none;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--text);
}

.mobile-menu {
  display: none;
}

@media (max-width: 900px) {
  nav ul {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .mobile-menu[open] summary {
    list-style: none;
  }

  .mobile-menu {
    display: block;
    border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  }

  .mobile-menu ul {
    list-style: none;
    padding: 12px 0 20px;
    margin: 0;
  }

  .mobile-menu li {
    padding: 8px 0;
  }

  .mobile-menu a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
  }

  .mobile-menu a:hover {
    color: var(--text);
  }
}

/* Hero */
.hero {
  padding: 72px 0 48px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-accent-text {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-feature-image {
  max-width: 100%;
  height: auto;
}

.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in oklab, var(--brand) 8%, transparent);
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  margin: 14px 0;
}

.hero p.lede {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  margin: 0 0 24px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.badges {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.menu-badge {
  display: inline-flex;
  height: 2em;
}

.store-badge {
  display: inline-flex;
  height: 3em;
}

.stars {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}

.mock {
  position: relative;
  isolation: isolate;
}

@media (max-width: 700px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 12px;
  }
}

/* Sections */
.section {
  padding: 48px 0;
}

.section h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 16px;
}

.section p.sub {
  color: var(--muted);
  margin: 0 0 28px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (min-width: 700px) and (max-width: 1050px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .features {
    grid-template-columns: 1fr;
  }
}

.feature {
  text-align: center;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.feature h3 {
  margin: 8px 0 6px;
  font-size: 18px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}

/* Feature screenshots */
.feature img {
  height: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 12px;
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
}

/* Hero device image */
.device img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.faq details {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq p {
  color: var(--muted);
  margin: 8px 0 0;
}

@media (max-width: 900px) {
  .faq {
    grid-template-columns: 1fr;
  }
}

/* Footer */
footer {
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  padding: 28px 0;
  color: var(--muted);
}

.fgrid {
  display: grid;
  grid-template-columns: 2fr 2fr;
  gap: 20px;
}

.fgrid a {
  color: inherit;
  text-decoration: none;
}

.fgrid a:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .fgrid {
    grid-template-columns: 1fr 1fr;
  }
}

input[type="email"],
input[type="text"],
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
              background-color 0.15s ease, transform 0.1s ease;
}

/* Bigger message box */
textarea {
  min-height: 220px;
  resize: vertical;
}

/* Placeholder color */
input::placeholder,
textarea::placeholder {
  color: color-mix(in oklab, var(--muted) 80%, transparent);
}

/* Hover state */
input[type="email"]:hover,
input[type="text"]:hover,
textarea:hover {
  border-color: color-mix(in oklab, var(--brand) 40%, var(--text) 10%);
}

/* Focus state (keyboard + click) */
input[type="email"]:focus-visible,
input[type="text"]:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--ring), 0 6px 18px var(--ring);
  background-color: color-mix(in oklab, var(--bg) 90%, var(--brand) 5%);
  transform: translateY(-1px);
}
form .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* History section enhancements */
.history-body p {
  font-size: 16px;
}

.history-body p strong {
  color: var(--text);
}

.history-body img {
  max-width: 200px;
}

.history-content {
  max-width: 960px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.calories-body p {
  font-size: 16px;
}

.calories-body ul.toc {
    list-style: none;
}

.calories-body p strong {
  color: var(--text);
}

.calories-body figure {
  margin: 2rem auto;
  text-align: center;
}

.calories-body figure img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.calories-body figcaption {
  max-width: 100%;
  margin: 0.5rem auto 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 100;
}

@media (min-width: 800px) {
  .calories-body figure img,
  .calories-body figcaption {
    max-width: 80%;
  }
}

.calories-content {
  max-width: 960px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

@media (max-width: 700px) {
  .calories-content {
    padding: 16px 14px;
    margin: 12px auto 24px;
  }

  .calories-body h1 {
    font-size: 1.6rem;
  }

  .calories-body h2 {
    font-size: 1.3rem;
  }

  .calories-body h3 {
    font-size: 1.05rem;
  }
}

.contact-content {
  max-width: 960px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.contact-content button.send-btn {
    appearance: none;
    border: 1px solid color-mix(in oklab, var(--brand) 40%, var(--text) 10%);
    background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--brand) 18%, transparent),
        color-mix(in oklab, var(--brand-2) 12%, transparent)
    );
    color: var(--text);
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.15s ease;
    width: 100%; /* Forms usually look better with a full-width CTA */
    margin-top: 8px;
}

.contact-content button.send-btn:hover {
    border-color: var(--brand);
    box-shadow: 0 6px 24px var(--ring);
    transform: translateY(-1px);
}

.contact-content button.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--ring);
}

.contact-content textarea {
    width: 100%;
    min-height: 200px;
    resize: vertical;
    
    background: var(--bg);
    color: var(--text);
    border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
    border-radius: 12px;
    padding: 12px;
    font-size: 16px;
    line-height: 1.5;
}

.contact-body form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-body label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.cf-turnstile {
  margin-top: 8px;
  margin-bottom: 4px;
  display: inline-block;
  filter: drop-shadow(0 10px 30px hsla(99, 84%, 5%, 0.6));
}

.contact-body form {
  align-items: stretch;
}

.contact-body form .cf-turnstile {
  align-self: flex-start;
}

.confirmation-content {
  text-align: center;
}

.confirmation-body {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 8px 4px;
}

.confirmation-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.confirmation-icon-svg {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.confirmation-success .confirmation-icon-svg {
  background: radial-gradient(
      circle at 30% 0%,
      color-mix(in oklab, var(--brand-2) 40%, transparent),
      transparent 60%
    ),
    color-mix(in oklab, var(--bg-soft) 70%, var(--card));
}

.confirmation-success .confirmation-icon-svg circle {
  fill: none;
  stroke: color-mix(in oklab, var(--brand) 55%, var(--text) 10%);
  stroke-width: 1.5;
}

.confirmation-success .confirmation-icon-svg path {
  fill: none;
  stroke: var(--brand-2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.confirmation-error .confirmation-icon-svg {
  background: radial-gradient(
      circle at 30% 0%,
      color-mix(in oklab, #ff7a7a 40%, transparent),
      transparent 60%
    ),
    color-mix(in oklab, var(--bg-soft) 70%, var(--card));
}

.confirmation-error .confirmation-icon-svg circle {
  fill: none;
  stroke: color-mix(in oklab, #ff4d4f 70%, var(--text) 10%);
  stroke-width: 1.5;
}

.confirmation-error .confirmation-icon-svg path {
  fill: none;
  stroke: #ffb3b5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.confirmation-body h1 {
  margin-top: 4px;
  margin-bottom: 8px;
}

.confirmation-actions {
  margin-top: 20px;
}

.confirmation-btn {
  width: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.privacy-body p {
  font-size: 16px;
}

.privacy-body p strong {
  color: var(--text);
}

.privacy-body img {
  max-width: 200px;
}

.privacy-content {
  max-width: 960px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.float-left,
.float-right {
  width: min(45%, 200px);
}

.float-left {
  float: left;
  margin-right: 20px;
}

.float-right {
  float: right;
  margin-left: 20px;
}

.float-left img,
.float-right img {
  display: block;
  width: 100%;
  height: auto;
}

/* Clear floats */
#story .history-body::after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 500px) {
  .float-left,
  .float-right {
    float: none;
    width: 100%;
  }
}

/* Utility */
.center {
  text-align: center;
}

.right {
  text-align: right;
}

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

.spaced {
  letter-spacing: 0.2px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-0 {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

table th,
table td {
  padding: 0.9rem 1rem;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}

table caption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 100;
}

/* Table header */
thead {
  background-color: var(--accent-color, #2c2c2c);
  color: var(--accent-text, #ffffff);
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Table rows */
tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Alternating row highlights */
tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.04); /* subtle contrast */
}

/* Hover highlight */
tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transition: background-color 0.2s ease;
}

/* Cell spacing */
td {
  padding: 0.75rem 1rem;
  line-height: 1.5;
}

/* Optional: subtle shadow for the whole table */
table {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Light mode variant */
@media (prefers-color-scheme: light) {
  thead {
    background-color: #f7f7f9;
    color: #222;
  }
  tbody tr:nth-child(even) {
    background-color: #fafafa;
  }
  tbody tr:hover {
    background-color: #f0f0f0;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
}

/* Header */
thead {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--brand) 35%, var(--card)),
    color-mix(in oklab, var(--brand-2) 30%, var(--card))
  );
  color: var(--text);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

thead th {
  text-align: left;
  padding: 0.9rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 50%, transparent);
}

/* Rows */
tbody tr {
  border-bottom: 1px solid color-mix(in oklab, var(--text) 8%, transparent);
}

/* Alternating row highlights */
tbody tr:nth-child(even) {
  background: color-mix(in oklab, var(--bg-soft) 45%, var(--card));
}

/* Hover highlight */
tbody tr:hover {
  background: color-mix(in oklab, var(--brand) 8%, var(--bg));
  transition: background-color 0.2s ease;
}

/* Cells */
td {
  padding: 0.9rem 1rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Mobile table fixes */
@media (max-width: 700px) {
  table {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  table th {
    font-size: 0.50rem;
    padding: 0.6rem 0.6rem;
    font-weight: 500;
    color: var(--muted);
  }

  table td {
    font-size: 0.50rem;
    padding: 0.6rem 0.6rem;
  }

  table thead {
    border-bottom-width: 1px;
  }
}

/* Math / KaTeX styling */
.math-block {
  margin: 1.5rem auto;
  padding: 0.75rem 0;
  overflow-x: auto;          /* allow horizontal scroll for REALLY long formulas */
}

.math-block::-webkit-scrollbar {
  height: 6px;
}

.math-block::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--brand) 40%, var(--card));
  border-radius: 999px;
}

.math-inline {
  font-size: 0.98em;
}

/* Make KaTeX use the same colors and sizing as the rest of the page */
.katex,
.katex-display {
  color: var(--text);
}

.math-block .katex-display {
  display: block;
  margin: 0 auto;
  font-size: clamp(0.9rem, 3.2vw, 1.1rem); /* smaller on phones, normal on desktop */
  max-width: 100%;
}

/* Don’t let equations blow out table cells */
table .math-inline,
table .katex {
  white-space: normal;
  overflow-wrap: anywhere;
}