:root {
  color-scheme: light;
  --ink: #123c43;
  --muted: #375c61;
  --water: #09645f;
  --paper: #faf7ed;
  --line: #abc9c6;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a44b24; outline-offset: 3px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.2rem; text-decoration: none; }
.brand img { border-radius: 12px; }
nav, .actions, .footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
nav a, .secondary { font-weight: 650; text-underline-offset: 4px; }
nav a, .secondary, .button { display: inline-flex; align-items: center; min-height: 44px; }
.button {
  justify-content: center; text-align: center; padding: 12px 20px; border-radius: 999px;
  background: var(--water); color: white; text-decoration: none; font-weight: 750;
}
.button:hover { background: #074d49; }
.button.small { padding: 8px 17px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(24px, 5vw, 76px); padding-block: 36px 72px; }
.category { color: var(--water); font-weight: 750; }
h1, h2 { font-family: Georgia, serif; line-height: 1.03; letter-spacing: -.045em; margin: 0; }
h1 { font-size: clamp(2.7rem, 5.2vw, 4.55rem); }
h2 { font-size: clamp(2.3rem, 5vw, 4.1rem); }
h3 { font-size: 1.18rem; line-height: 1.2; margin: 0; }
p { color: var(--muted); }
.hero-copy > p:not(.category), .lesson-layout > div > p { font-size: 1.13rem; max-width: 38ch; }
.actions { margin-top: 27px; }
.secondary { gap: 8px; }
.hero-art {
  aspect-ratio: 1 / 1.06; display: grid; place-items: center; overflow: hidden;
  border-radius: 48% 48% 22px 22px; background: #a1ddd5 url(reef.webp) center 55% / cover;
}
.hero-art img { width: 50%; border-radius: 20px; border: 4px solid #fff8; box-shadow: 0 16px 36px #073c4650; }
.lesson { background: #e4f3ee; padding-block: clamp(46px, 8vw, 100px); }
.lesson-layout { display: grid; grid-template-columns: 1fr minmax(300px, 430px); align-items: center; gap: clamp(28px, 7vw, 100px); }
.steps { display: grid; gap: 12px; padding-inline-start: 24px; margin-bottom: 0; }
.steps li { padding-inline-start: 6px; }
.steps li::marker { font-weight: 750; color: var(--water); }
.puzzle-card { background: #fffdf7; border: 1px solid var(--line); border-radius: 24px; padding: clamp(12px, 4vw, 26px); }
.puzzle-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 14px; }
.modes { display: flex; flex-wrap: wrap; gap: 4px; }
.puzzle-tools button {
  min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: white; padding: 6px 10px; font-weight: 650;
}
.puzzle-tools button[aria-pressed="true"] { color: white; background: var(--water); }
#board { display: grid; grid-template-columns: minmax(36px, auto) repeat(5, minmax(0, 1fr)); gap: 3px; }
.clue { display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px; font-weight: 750; font-size: .9rem; }
.column-clue { flex-direction: column; justify-content: flex-end; min-height: 48px; line-height: 1; }
.cell {
  padding: 0; aspect-ratio: 1; background: #f3f8f5; border: 1px solid #98b8b5;
  border-radius: 5px; font-weight: 750; font-size: 1.35rem; touch-action: manipulation;
}
.cell[data-state="fill"] { background: #137870; border-color: #137870; }
.cell[data-state="mark"] { background: #e6eeeb; }
#board[data-solved] .cell[data-state="fill"] { background: #c36d28; border-color: #c36d28; }
.feedback { margin: 12px 0 0; min-height: 3.1em; font-weight: 650; }
.explore { padding-block: clamp(44px, 8vw, 100px); }
.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 32px; }
figure { margin: 0; min-width: 0; border-radius: 20px; padding: 20px; background: #f0eadd; }
figure img { width: min(100%, 235px); margin-inline: auto; border-radius: 13px; }
figcaption { margin-top: 20px; }
figcaption p { margin-bottom: 0; }
.closing { background: #103f46; color: white; padding-block: 55px; text-align: center; }
.closing img { margin: 0 auto 20px; border-radius: 20px; }
.closing p { color: #c7e5df; }
.closing .button { background: #e0f4e9; color: #103f46; }
.footer { padding-block: 30px; }
.footer > span { font-weight: 750; }
.footer-links { gap: 5px 18px; margin-block: 10px; }
.footer-links a, summary { display: inline-flex; align-items: center; min-height: 44px; }
summary { cursor: pointer; display: list-item; padding-block: 10px; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .header nav { display: none; }
  .hero, .lesson-layout { grid-template-columns: 1fr; }
  .hero { padding-block: 16px 42px; gap: 28px; }
  .hero-art { max-width: 480px; width: 100%; justify-self: center; }
  .puzzle-card { width: min(100%, 430px); justify-self: center; }
  .showcase { grid-template-columns: 1fr; }
  figure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 15px; padding: 14px; }
  figcaption { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
