/* ThenThat — one stylesheet for the site and the app. Playful on purpose: the
   people reading it know exactly how good a feed feels, and a beige habit
   tracker loses that fight. Bright, round and bouncy — but motion stops for
   anyone who asks the system for less of it. */

:root {
  color-scheme: light dark;
  --ink: #1d1530;
  --bg: #fff8ee;
  --paper: #ffffff;
  --line: #eadfce;
  --muted: #5a5170;
  --brand: #ff4f7b;
  --brand-ink: #ffffff;
  --brand-2: #7c4dff;
  --sun: #ffd23f;
  --good: #14966b;
  --bad: #c43a4a;
  --warn-bg: #fff1c9;
  --warn-line: #f0c95a;
  --common: #6b7a90;
  --rare: #2f7bff;
  --epic: #7c4dff;
  --jackpot: #e6a100;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3eefc; --bg: #140f1f; --paper: #1e1830; --line: #322a48; --muted: #b0a7c6;
    --brand: #ff6a91; --brand-ink: #1a0f1e; --brand-2: #a68bff; --good: #3fcf98; --bad: #ff7c8a;
    --warn-bg: #2f2814; --warn-line: #6e5a24; --common: #9aa7bb; --rare: #74a6ff; --epic: #b39bff; --jackpot: #ffc93d;
  }
}

* { box-sizing: border-box; }
/* Classes that set display (.claim, .btn, .card…) must not win over hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 ui-rounded, "SF Pro Rounded", "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
h1 { font-size: clamp(30px, 5vw, 50px); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 14px; }
h2 { font-size: 24px; letter-spacing: -0.015em; margin: 36px 0 10px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, .hint { font-size: 14px; }
.hint { color: var(--muted); margin-top: 6px; }
.error { color: var(--bad); min-height: 1em; }
.ok { color: var(--good); }
.pre { white-space: pre-wrap; }
.lede { font-size: 20px; color: var(--muted); max-width: 660px; }
.kicker { display: inline-block; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; color: var(--brand-2); margin-bottom: 10px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

main { max-width: 860px; margin: 0 auto; padding: 36px 20px 72px; }

/* ── Header and footer ─────────────────────────────────────────────────── */

.site-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--paper); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -0.03em; }
.brand span { color: var(--brand); }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--ink); }
.site-header .account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sync-dot[data-state="synced"] { background: var(--good); }
.sync-dot[data-state="syncing"] { background: var(--sun); }
.sync-dot[data-state="error"], .sync-dot[data-state="offline"] { background: var(--bad); }

.claim { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }

.site-footer {
  display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap;
  padding: 26px 20px; border-top: 2px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 11px 20px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 800;
  text-decoration: none; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 55%, #000);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 55%, #000); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.big { padding: 15px 28px; font-size: 19px; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); box-shadow: none; }
.btn.small { padding: 5px 13px; font-size: 14px; box-shadow: none; }
.btn.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font-weight: 600; box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; margin: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.honeypot { position: absolute; left: -5000px; }

/* ── Blocks ────────────────────────────────────────────────────────────── */

.card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .v { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; transition: width 0.6s ease; }
.notice { background: var(--warn-bg); border: 2px solid var(--warn-line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); }
.pill { display: inline-block; padding: 1px 9px; margin-left: 6px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 2px solid var(--line); color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); animation: rise 0.25s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.out { opacity: 0; transition: opacity 0.5s; }

table { width: 100%; border-collapse: collapse; }
dialog { border: 2px solid var(--line); border-radius: 22px; padding: 22px 24px; max-width: 560px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(20 10 40 / 0.45); }

/* ── App ───────────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 22px; }
.tabs a { padding: 8px 15px; text-decoration: none; color: var(--muted); font-weight: 800; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); }
.tabs a[aria-current="page"] { color: var(--brand-ink); background: var(--ink); border-color: var(--ink); }
.app-top { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; }

.hooks { display: grid; gap: 12px; }
.hook-card {
  display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 2px solid var(--line);
  border-radius: 20px; padding: 16px 18px; box-shadow: 0 4px 0 var(--line);
}
.hook-card.done { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); box-shadow: 0 4px 0 color-mix(in srgb, var(--good) 35%, var(--line)); }
.hook-card.big { padding: 22px; margin: 16px 0; }
.hook-card .emoji, .starter .emoji, .win .emoji, .hook-manage .emoji { font-size: 30px; line-height: 1; flex: none; }
.hook-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hook-text { display: grid; }
.hook-text .when, .hook-card .when { color: var(--muted); font-size: 15px; }
.hook-text .then, .hook-card .then { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.then.big { font-size: 26px; margin: 0; }

.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 14px 0; }
.starter {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 14px; transition: transform 0.12s, border-color 0.12s;
}
.starter:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px) rotate(-0.4deg); }
.starter:disabled { opacity: 0.45; cursor: default; }

.drop-chip { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 13px; font-weight: 900; color: #fff; background: var(--common); letter-spacing: 0.02em; width: fit-content; }
.drop-chip.rare { background: var(--rare); }
.drop-chip.epic { background: var(--epic); }
.drop-chip.jackpot { background: linear-gradient(90deg, var(--jackpot), var(--brand)); }

/* The drop reveal. */
.reveal { text-align: center; }
.reveal h2 { margin: 4px 0 10px; font-size: 30px; }
.drop-box { font-size: 84px; line-height: 1; background: none; border: 0; cursor: pointer; padding: 10px; animation: wiggle 1.2s ease-in-out infinite; }
.drop-box.opening { animation: pop 0.55s ease forwards; }
.drop-inside { animation: rise 0.35s ease; }
.drop-rarity { font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 15px; margin: 0; }
.drop-rarity.common { color: var(--common); }
.drop-rarity.rare { color: var(--rare); }
.drop-rarity.epic { color: var(--epic); }
.drop-rarity.jackpot { color: var(--jackpot); }
.drop-xp { font-size: 54px; font-weight: 900; letter-spacing: -0.03em; margin: 0 0 6px; }
.reveal.open.epic, .reveal.open.jackpot { box-shadow: 0 0 0 4px var(--epic), 0 0 60px color-mix(in srgb, var(--epic) 50%, transparent); }
.reveal.open.jackpot { box-shadow: 0 0 0 4px var(--jackpot), 0 0 80px color-mix(in srgb, var(--jackpot) 60%, transparent); }
.level-up { font-weight: 900; color: var(--brand-2); font-size: 19px; }

/* The itch button. */
.itch-wrap { display: grid; place-items: center; padding: 30px 0; }
.itch {
  width: min(320px, 80vw); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  font: inherit; font-size: 24px; font-weight: 900; color: #fff; padding: 30px;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--brand) 60%, #fff), var(--brand) 55%, color-mix(in srgb, var(--brand) 70%, #000));
  box-shadow: 0 10px 0 color-mix(in srgb, var(--brand) 55%, #000), 0 20px 40px color-mix(in srgb, var(--brand) 35%, transparent);
  animation: breathe 3.2s ease-in-out infinite;
}
.itch:active { transform: translateY(6px); box-shadow: 0 4px 0 color-mix(in srgb, var(--brand) 55%, #000); }
.choices { display: grid; gap: 10px; margin: 16px 0; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  display: grid; gap: 4px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px;
}
.choice:hover { border-color: var(--brand); }
.choice strong { font-size: 19px; }
.choice span { color: var(--muted); font-size: 15px; }
.surf { display: grid; place-items: center; text-align: center; padding: 20px 0; gap: 8px; }
.breath { width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rare) 55%, transparent), transparent 70%); border: 3px solid var(--rare); animation: surf 10s ease-in-out infinite; }
.surf-count { font-size: 44px; font-weight: 900; margin: 0; font-variant-numeric: tabular-nums; }
.surf-line { font-size: 19px; max-width: 460px; min-height: 3em; }

/* The wins feed. */
.feed { display: grid; gap: 10px; }
.feed-day { margin: 18px 0 2px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.win { display: flex; gap: 12px; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.win-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.win-body p { margin: 0; }
.win.urge { background: color-mix(in srgb, var(--rare) 6%, var(--paper)); }
.proof { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; }
.feed-more, .feed-end { text-align: center; color: var(--muted); padding: 24px 0; }

.hook-manage .hook-text { flex: 1; }

/* ── Marketing ─────────────────────────────────────────────────────────── */

.hero { padding: 16px 0 6px; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); }
.hero .cta { margin-top: 20px; }
.hook-demo { display: grid; gap: 10px; justify-items: start; margin-top: 34px; transform: rotate(-1.2deg); }
.hook-card.demo { max-width: 520px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.plan-plus { border-color: var(--brand-2); box-shadow: 0 4px 0 var(--brand-2); }
.steps { counter-reset: step; padding: 0; list-style: none; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; margin: 0 0 16px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 900; }
.swap-table { display: grid; gap: 12px; margin-top: 16px; }
.swap-row { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 10px; align-items: stretch; }
.swap-row h3 { margin: 10px 0 0; }
.swap-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.swap-cell { border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.swap-cell .label { display: block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.swap-cell.feed { background: color-mix(in srgb, var(--muted) 12%, var(--paper)); color: var(--muted); }
.swap-cell.ours { background: color-mix(in srgb, var(--brand) 12%, var(--paper)); border: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.swap-cell.ours .label { color: var(--brand); }
.callout { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--paper)), color-mix(in srgb, var(--brand-2) 16%, var(--paper))); border-radius: 26px; padding: 6px 26px 18px; margin-top: 36px; }
.principle h2 { margin-top: 0; }
.refusals li { margin-bottom: 8px; }
details summary { cursor: pointer; }

@media (max-width: 700px) {
  .swap-row, .swap-pair, .choices.two { grid-template-columns: 1fr; }
  .site-header .account { margin-left: 0; }
}

/* ── Motion ────────────────────────────────────────────────────────────── */

@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg) scale(1.04); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-4deg); } }
@keyframes pop { 0% { transform: scale(1); } 60% { transform: scale(1.35) rotate(8deg); opacity: 1; } 100% { transform: scale(0.2); opacity: 0; } }
@keyframes rise { from { transform: translate(var(--tx, 0), 10px); opacity: 0; } to { transform: translate(var(--tx, 0), 0); opacity: 1; } }
.toast { --tx: -50%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes surf { 0%, 100% { transform: scale(0.6); } 50% { transform: scale(1.1); } }

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