/* ---------------------------------------------------------------------------
   Design tokens
   Modern aesthetic with refined color palette and sophisticated depth.
   --------------------------------------------------------------------------- */
:root {
  --bg: #fafaf9;        --surface: #ffffff;   --surface-2: #f7f6f4;   --surface-3: #efeee9;
  --border: #e5e3df;    --border-light: #f0eeeb;
  --text: #1f1d1a;      --text-secondary: #6b6963;
  --accent: #1d7d5f;    --accent-hover: #175e4b; --accent-light: #e8f5f1;
  --accent-soft: #f0faf7;
  --danger: #b42e2e;    --warn: #8a5a12;      --warn-soft: #fdf4e3;
  --success: #2d8a4b;

  /* Spacing scale */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px;  --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;
  --section: clamp(64px, 10vw, 104px);
  --gutter: clamp(20px, 4vw, 40px);
  --card-pad: clamp(24px, 3vw, 32px);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);
  --shadow-xl: 0 20px 48px rgba(0,0,0,.15);
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Monaco", "Menlo", "Courier New", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;      --surface: #161b22;   --surface-2: #21262d;   --surface-3: #30363d;
    --border: #30363d;  --border-light: #21262d;
    --text: #e8eaed;    --text-secondary: #8b949e;
    --accent: #3fb950;  --accent-hover: #2ea043; --accent-light: #1c421e;
    --accent-soft: #0d2818;
    --danger: #da3633;  --warn: #d29922;      --warn-soft: #3d2817;
    --success: #3fb950;
    --shadow-sm: 0 2px 4px rgba(0,0,0,.2);
    --shadow: 0 4px 12px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.1);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.4);
    --shadow-xl: 0 20px 48px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117;        --surface: #161b22;   --surface-2: #21262d;   --surface-3: #30363d;
  --border: #30363d;    --border-light: #21262d;
  --text: #e8eaed;      --text-secondary: #8b949e;
  --accent: #3fb950;    --accent-hover: #2ea043; --accent-light: #1c421e;
  --accent-soft: #0d2818;
  --danger: #da3633;    --warn: #d29922;      --warn-soft: #3d2817;
  --success: #3fb950;
  --shadow-sm: 0 2px 4px rgba(0,0,0,.2);
  --shadow: 0 4px 12px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 48px rgba(0,0,0,.5);
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-hover); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 var(--sp-4);
  font-weight: 700;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem);
  letter-spacing: -0.035em;
  font-weight: 750;
}
h2 { font-size: clamp(1.45rem, 1.15rem + 1vw, 1.95rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 1rem + 0.3vw, 1.35rem); font-weight: 680; }
h4 { font-size: 1rem; font-weight: 650; }
p  { margin: 0 0 var(--sp-4); text-wrap: pretty; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; color: var(--text); }

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 720px; }

/* Consistent vertical rhythm without per-section inline margins. */
main > section { padding-block: 0; }
main > section + section { margin-top: var(--section); }

/* Auto-fit grids: 1 -> 2 -> 3 columns as space allows, with no dead zone where
   three cards are crushed. Equal heights come free from grid stretch. */
.grid { display: grid; gap: var(--sp-5); align-items: stretch; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
}
@media (prefers-color-scheme: dark) {
  header.site:not([data-theme="light"]) {
    background: rgba(22, 27, 34, 0.8);
  }
}
header.site[data-theme="dark"] {
  background: rgba(22, 27, 34, 0.8);
}
header.site .wrap {
  display: flex; align-items: center; gap: var(--sp-6);
  min-height: var(--header-h); flex-wrap: wrap; padding-block: var(--sp-3);
}
.brand {
  font-weight: 750; letter-spacing: -0.03em; color: var(--text);
  font-size: 1.2rem; transition: transform .2s ease;
}
.brand:hover { text-decoration: none; transform: translateY(-1px); }
.brand span { color: var(--accent); }
nav.site {
  margin-left: auto; display: flex; gap: var(--sp-6); align-items: center;
  flex-wrap: wrap;
}
nav.site a {
  color: var(--text-secondary); font-size: .95rem; white-space: nowrap;
  font-weight: 500; transition: color .2s ease, transform .2s ease;
}
nav.site a:hover { color: var(--accent); text-decoration: none; transform: translateY(-1px); }

/* Mobile hamburger menu */
.nav-toggle { display: none; }
.hamburger {
  display: none; width: 24px; height: 24px; flex-direction: column;
  justify-content: space-between; background: none; border: none;
  cursor: pointer; padding: 0;
}
.hamburger span {
  display: block; width: 100%; height: 2px; background: var(--text);
  border-radius: 1px; transition: all .3s ease;
}

@media (max-width: 700px) {
  .hamburger { display: flex; }
  nav.site {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; width: 100%; margin-left: 0 !important;
    gap: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease;
    padding: 0;
  }
  nav.site a {
    display: block; padding: var(--sp-3) var(--gutter);
    border-bottom: 1px solid var(--border-light);
  }
  .nav-toggle:checked ~ nav.site {
    max-height: 500px;
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 12px 24px; min-height: 44px; border-radius: var(--radius-sm);
  border: none; background: var(--accent); color: #fff; font: inherit;
  font-weight: 650; font-size: 0.95rem;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: all .25s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative; overflow: hidden;
}
.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}
.btn.small {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 0.875rem;
  box-shadow: none;
}
.btn.small:hover {
  box-shadow: var(--shadow-sm);
}
.btn-row {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
@media (max-width: 420px) {
  .btn-row .btn {
    flex: 1 1 100%;
  }
}

/* ---------------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow);
  transition: all .3s cubic-bezier(0.2, 0, 0, 1);
}
.card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card > .btn:last-child,
.card > .btn-row:last-child {
  margin-top: auto;
  align-self: flex-start;
}
.card > h2, .card > h3 {
  margin-bottom: var(--sp-2);
  color: var(--text);
}
.card > p {
  color: var(--text-secondary);
}
.card:has(> .btn:last-child) > *:nth-last-child(2) {
  margin-bottom: var(--sp-5);
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(56px, 10vw, 96px) clamp(48px, 8vw, 80px);
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  border-radius: var(--radius);
  margin-block: clamp(24px, 4vw, 40px);
}
.hero h1 {
  max-width: 24ch;
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p.lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 56ch;
  margin-bottom: var(--sp-6);
  font-weight: 500;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 650;
  margin-bottom: var(--sp-5);
  backdrop-filter: blur(8px);
}

/* ---------------------------------------------------------------------------
   Pricing
   --------------------------------------------------------------------------- */
.pack {
  position: relative;
  transition: all .3s cubic-bezier(0.2, 0, 0, 1);
}
.pack:hover {
  transform: translateY(-2px);
}
.pack h3 {
  margin-bottom: var(--sp-2);
  color: var(--text);
}
.price {
  font-size: clamp(2rem, 1.7rem + 1.2vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.price small {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
}
.pack ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.pack li {
  padding: 6px 0 6px 28px;
  position: relative;
  font-weight: 500;
}
.pack li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--accent);
  font-size: 1em;
  font-weight: 700;
}
.pack.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}
.pack.featured:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.pack.featured h3 {
  color: var(--accent);
}
.grid-note {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: var(--sp-2);
  color: var(--text);
}
input[type=text],
input[type=email],
input[type=password],
select {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: all .2s ease;
}
input[type=text]::placeholder,
input[type=email]::placeholder,
input[type=password]::placeholder {
  color: var(--text-secondary);
}
input:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
input:hover:not(:focus),
select:hover:not(:focus) {
  border-color: var(--border);
  background: var(--surface);
}
.check {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin-block: var(--sp-4);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  margin-top: 5px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.row {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Notices
   --------------------------------------------------------------------------- */
.note {
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.95rem;
  margin-block: var(--sp-4);
  font-weight: 500;
  border: 1px solid;
  backdrop-filter: blur(8px);
}
.note.info {
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  color: var(--accent);
  border-color: var(--accent);
}
.note.warn {
  background: linear-gradient(135deg, var(--warn-soft) 0%, transparent 100%);
  color: var(--warn);
  border-color: var(--warn);
}
.note.err {
  background: linear-gradient(135deg, rgba(180, 46, 46, 0.1) 0%, transparent 100%);
  color: var(--danger);
  border-color: var(--danger);
}

.muted { color: var(--text-secondary); }
.small { font-size: 0.875rem; }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------------- */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  min-width: 420px;
}
th, td {
  text-align: left;
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--border);
}
tr:hover {
  background: var(--surface-2);
}
tr:last-child td {
  border-bottom: none;
}
th {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: var(--surface-2);
}
td {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: var(--section);
  padding-block: var(--sp-7);
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: linear-gradient(180deg, transparent 0%, var(--surface-2) 100%);
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  align-items: center;
}
footer.site nav {
  margin-left: auto;
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
footer.site nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color .2s ease;
}
footer.site nav a:hover {
  color: var(--accent);
}
@media (max-width: 480px) {
  footer.site nav {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
