/* Layout: fruit-parlor gift box. Hero = tagged gift box + headline + comparison table as one block;
   a pinned stage where the prompt is packed into the box; a melon-flesh band of four mode cups with a live demo. */
:root {
  --paper: #FAFDF2;
  --card: #FFFFFF;
  --ink: #1B2A1A;
  --muted: #4F6248;
  --line: rgba(27, 42, 26, .13);
  --box: #DDF3BC;
  --box-2: #BDE48F;
  --net: #6DB23C;
  --band: #E8F7D2;
  --berry: #E0304A;
  --berry-ink: #FFFFFF;
  --cup: #F0F9E3;
  --cup-shadow: rgba(60, 110, 30, .16);
  --f-display: "Zen Old Mincho", "Iowan Old Style", Georgia, serif;
  --f-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121912; --card: #1B241B; --ink: #E7EEDD; --muted: #A3B19B; --line: rgba(231, 238, 221, .14);
    --box: #2A3A26; --box-2: #33472E; --net: #6E9150; --band: #182217; --berry: #EE5866; --berry-ink: #1A0E10;
    --cup: #1C281B; --cup-shadow: rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121912; --card: #1B241B; --ink: #E7EEDD; --muted: #A3B19B; --line: rgba(231, 238, 221, .14);
  --box: #2A3A26; --box-2: #33472E; --net: #6E9150; --band: #182217; --berry: #EE5866; --berry-ink: #1A0E10;
  --cup: #1C281B; --cup-shadow: rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.6; }
.wrap { max-width: 1000px; margin-inline: auto; padding-inline: var(--gutter); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 900; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }

.top { width: 100%; max-width: calc(clamp(320px, 112vh, 1400px) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); padding-block: 14px; display: flex; align-items: center; justify-content: space-between; }
.theme {
  appearance: none; cursor: pointer; width: clamp(44px, 5.4vh, 68px); height: clamp(44px, 5.4vh, 68px); border-radius: 999px; display: grid; place-items: center;
  background: var(--box-2); color: var(--ink); border: 2px solid var(--ink);
}
.theme:hover { background: var(--box); }
.theme:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }
.theme svg { width: clamp(24px, 3vh, 38px); height: clamp(24px, 3vh, 38px); stroke-width: 2.2; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
.mark { display: inline-flex; align-items: center; gap: .5em; font-family: var(--f-display); font-weight: 900; font-size: clamp(30px, min(3.8vw, 5.8vh), 84px); }
.mark svg { width: 1.25em; height: 1.25em; }

/* Button: bows forward when pressed */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 17px/1 var(--f-body); color: var(--berry-ink); background: var(--berry);
  padding: 16px 28px; border-radius: 999px;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--berry) 60%, #000);
  transform-origin: 50% 100%;
  transition: transform .32s linear(0, .32 7%, .85 18%, 1.04 28%, 1.02 40%, 1 55%, 1), box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active, .btn.bow { transform: perspective(400px) rotateX(22deg) translateY(2px) scale(.97); box-shadow: 0 1px 0 color-mix(in srgb, var(--berry) 60%, #000); transition-duration: .08s; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn svg { width: 18px; height: 18px; }

/* Hero: one block of gift, headline and table */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.hero-main { flex: 1; display: grid; align-content: center; padding-inline: var(--gutter); padding-block: 2vh 5vh; }
.hero-block { width: 100%; max-width: clamp(320px, 112vh, 1400px); margin-inline: auto; display: grid; gap: clamp(14px, 3vh, 40px); }
.hero-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(14px, 2.4vw, 40px); }
.gift { width: clamp(84px, min(14vw, 19vh), 280px); aspect-ratio: 220 / 160; max-width: 100%; }
.gift svg { width: 100%; height: 100%; overflow: visible; }
.hero h1 { font-size: clamp(26px, min(3.6vw, 5.4vh), 76px); line-height: 1.16; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 .line:last-child { color: var(--berry); }

/* Comparison table */
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 clamp(4px, .8vh, 10px); font-size: clamp(15px, min(1.35vw, 2.2vh), 28px); }
th, td { padding: clamp(8px, 1.6vh, 22px) clamp(10px, 1.2vw, 24px); text-align: left; vertical-align: middle; }
thead th { font-family: var(--f-mono); font-weight: 500; font-size: clamp(11.5px, min(.95vw, 1.6vh), 20px); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-block: 4px 2px; }
thead th.so { color: var(--ink); }
thead th.so span { display: inline-flex; align-items: center; gap: 8px; }
thead th.so svg { width: 1.5em; height: 1.5em; }
tbody th { font-family: var(--f-mono); font-weight: 500; font-size: clamp(12px, min(1vw, 1.7vh), 21px); color: var(--muted); white-space: nowrap; width: 1%; padding-left: 0; }
tbody td.them { color: var(--muted); background: var(--card); border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; }
tbody td.them.none { color: color-mix(in srgb, var(--muted) 75%, transparent); font-style: italic; }
tbody td.so {
  position: relative; font-weight: 700; color: var(--ink);
  background: var(--box-2); border-radius: 0 12px 12px 0; padding-left: calc(1em + 18px);
  background-image: linear-gradient(90deg, var(--berry) 0 4px, transparent 4px);
}
tbody td.so::before { content: ""; position: absolute; left: 14px; top: 50%; width: .5em; height: .7em; margin-top: -.35em; background: var(--berry); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; }

/* Prompt-to-course stage */
.pack { min-height: 100vh; display: grid; align-content: center; justify-items: center; text-align: center; gap: 18px; padding-block: 48px; }
.pack h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; }
.pack p { color: var(--muted); max-width: 32rem; }
.stage { width: clamp(220px, calc((100vh - 360px) * 1.2), 400px); max-inline-size: 86vw; aspect-ratio: 360 / 300; }
.stage svg { width: 100%; height: 100%; overflow: visible; }
.captions { display: grid; min-height: 1.6em; }
.captions > * { grid-area: 1 / 1; font-family: var(--f-mono); font-size: 13.5px; color: var(--muted); }
.captions .after { color: var(--berry); opacity: 0; }

/* Correction modes */
.modes { background: var(--band); padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.modes h2 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.12; margin-bottom: 32px; }
.cups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px; border-radius: 26px; background: var(--box-2); }
.cup {
  appearance: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--cup); border-radius: 18px; padding: 22px 20px 24px; box-shadow: inset 0 3px 8px var(--cup-shadow);
  display: grid; align-content: start; gap: 8px; min-width: 0;
  outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .2s, transform .2s;
}
.cup:hover { transform: translateY(-2px); }
.cup[aria-selected="true"] { outline-color: var(--berry); background: var(--card); }
.cup:focus-visible { outline-color: var(--ink); }
.cup h3 { font-size: 22px; line-height: 1.2; }
.cup p { color: var(--muted); }
.strip { position: relative; height: 26px; margin-bottom: 8px; }
.strip::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 6px; background: var(--ink); opacity: .75; }
.strip b { position: absolute; top: 4px; height: 16px; border-radius: 4px; background: var(--berry); border: 2px solid var(--cup); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: -16px 0 20px; font-size: 15px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend span::before { content: ""; width: 28px; height: 6px; border-radius: 6px; background: var(--ink); opacity: .75; }
.legend span.fix::before { width: 14px; height: 16px; border-radius: 4px; background: var(--berry); opacity: 1; }

.demo { margin-top: 28px; max-width: 560px; }
.sample { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 22px 24px; display: grid; gap: 14px; }
.sample .when { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.sample-body { display: grid; gap: 12px; }
.turn { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: baseline; }
.turn b { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.turn s { text-decoration-color: var(--berry); text-decoration-thickness: 2px; color: var(--muted); }
.turn em { font-style: normal; color: var(--berry); font-weight: 700; }

/* Closing */
.close { padding-block: clamp(72px, 11vw, 140px); text-align: center; display: grid; justify-items: center; gap: 22px; }
.close h2 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.15; max-width: 16ch; }
.close p { color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding-block: 20px; font-size: 14px; color: var(--muted); }
.foot a { color: inherit; }

@media (max-width: 820px) {
  .cups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero-head { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 10px; }
  .cups { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .cups .demo { margin-top: 0; }
  th, td { padding: clamp(8px, 1.4vh, 12px) 10px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .cup { transition: none; } }
