/* Olivia's Corner
   Layout: a show-ring of three rosettes up top, then one "ring" per hobby,
   each with its own colour and one hands-on thing to try.
   All text colours meet WCAG 2.2 AA (4.5:1) on their backgrounds in both themes. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/bricolage.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/caveat-600.woff2") format("woff2"); }

:root {
  --paper: #f6f8f4;
  --card: #ffffff;
  --ink: #1b2b27;
  --muted: #4f5f58;
  --line: #cfd9d2;
  --ride: #b0263d;     /* rosette red */
  --bake: #8a5800;     /* golden crust */
  --med: #0f6e6a;      /* scrubs teal */
  --ride-soft: #f8e3e6;
  --bake-soft: #faefd6;
  --med-soft: #dcf1ef;
  --on-accent: #ffffff;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a18; --card: #1b2523; --ink: #e9efeb; --muted: #a9b8b1; --line: #34433f;
    --ride: #f2788b; --bake: #f0b53f; --med: #4cc5bf;
    --ride-soft: #3a1f25; --bake-soft: #3a2f17; --med-soft: #173533;
    --on-accent: #121a18;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
}
.wrap { max-width: 65rem; margin: 0 auto; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; max-width: 62ch; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.note { font-family: var(--hand); font-weight: 600; font-size: 1.6rem; line-height: 1.2; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Hero ---------- */
.hero { padding-block: 3.5rem 2.5rem; display: grid; gap: 2.25rem; }
.hello { display: grid; gap: 0.9rem; }
.hello .note { color: var(--ride); transform: rotate(-2deg); transform-origin: left; }
h1 { font-size: clamp(2.6rem, 9vw, 5.6rem); font-weight: 800; letter-spacing: -0.03em; }
h1 span { color: var(--med); }
.intro { font-size: 1.2rem; color: var(--muted); }

.ring { display: flex; flex-wrap: wrap; gap: 1.25rem 1.75rem; }
.rosette { position: relative; width: 8.25rem; display: block; text-decoration: none; border-radius: 50%; transition: transform .25s ease; }
.rosette:nth-child(1) { color: var(--ride); transform: rotate(-5deg); }
.rosette:nth-child(2) { color: var(--bake); transform: rotate(3deg); }
.rosette:nth-child(3) { color: var(--med);  transform: rotate(-2deg); }
.rosette:hover, .rosette:focus-visible { transform: rotate(0) translateY(-4px); }
.rosette svg { width: 100%; height: auto; display: block; aspect-ratio: 120 / 170; }
.rosette-centre { fill: var(--card); }
.rosette span {
  position: absolute; left: 0; right: 0; top: 35.3%; transform: translateY(-50%);
  text-align: center; font-family: var(--display); font-weight: 700; font-size: .82rem; line-height: 1.05;
  color: var(--ink); padding: 0 2.1rem;
}

/* ---------- Sections ---------- */
section { padding-block: 3.5rem; border-top: 2px dashed var(--line); display: grid; gap: 1.75rem; }
.sec-head { display: grid; gap: 0.6rem; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-family: var(--display); font-weight: 700; font-size: .85rem;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--soft); color: var(--c);
}
.tag svg { width: 20px; height: 20px; flex: none; }
h2 { font-size: clamp(2rem, 5.5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
h2 em { font-style: normal; color: var(--c); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }
.lede { font-size: 1.15rem; }

#riding  { --c: var(--ride); --soft: var(--ride-soft); }
#baking  { --c: var(--bake); --soft: var(--bake-soft); }
#medical { --c: var(--med);  --soft: var(--med-soft); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.5rem; align-items: start; }
.cols > * { min-width: 0; }
.panel { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 1.4rem; display: grid; gap: 0.9rem; min-width: 0; }
.small { font-size: .95rem; color: var(--muted); }
ul.list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
ul.list li::marker { color: var(--c); }

/* Gaits */
.gaits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gait { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: 12px; }
.gait strong { font-family: var(--display); }
.gait.walk   { --d: 1.1s; }
.gait.trot   { --d: .7s; }
.gait.canter { --d: .6s; }
.gait.gallop { --d: .42s; }
.beats { display: flex; gap: 6px; }
.beats i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); display: block; }
.gaits.playing .beats i { animation: beat var(--d) ease-in-out infinite; }
.gaits.playing .beats i:nth-child(2) { animation-delay: calc(var(--d) * .25); }
.gaits.playing .beats i:nth-child(3) { animation-delay: calc(var(--d) * .5); }
.gaits.playing .beats i:nth-child(4) { animation-delay: calc(var(--d) * .75); }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .5; } }

/* Controls */
label { font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input[type="text"] {
  font: inherit; font-size: 1.3rem; font-family: var(--display); width: 7.5rem; min-height: 44px;
  padding: 6px 12px; border-radius: 12px; border: 2px solid var(--muted);
  background: var(--paper); color: var(--ink);
}
input[type="text"]:focus-visible { border-color: var(--c); outline: 3px solid var(--c); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--ride); }
.out { font-family: var(--display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.out .big { font-size: 1.7rem; color: var(--c); font-weight: 800; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px;
  border: 2px solid var(--c); background: transparent; color: var(--ink);
  min-height: 44px; min-width: 44px; padding: 6px 16px; width: fit-content;
}
.btn:hover { background: var(--soft); }
.btn[aria-pressed="true"] { background: var(--c); color: var(--on-accent); }

/* Recipe card */
.recipe { background: var(--soft); border-color: transparent; }
.recipe .note { color: var(--c); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
td.qty { font-weight: 700; white-space: nowrap; width: 5.5rem; }
.recipe td { border-color: var(--c); border-bottom-style: dotted; }
ol.method { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
ol.method li::marker { font-family: var(--display); font-weight: 800; color: var(--c); }
.scroll { overflow-x: auto; }
.oven tr.hot td { background: var(--soft); font-weight: 700; }
.pill {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px;
  background: var(--c); color: var(--on-accent); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase;
}

/* Quiz */
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 14px; }
.fact { border-radius: 16px; border: 2px solid var(--line); background: var(--card); display: grid; align-content: start; overflow: hidden; }
.fact button {
  font: inherit; font-family: var(--display); font-weight: 700; font-size: 1.08rem; line-height: 1.3;
  text-align: left; color: var(--ink); background: none; border: 0; cursor: pointer;
  padding: 16px 18px; min-height: 44px; display: grid; gap: 8px;
}
.fact button::after { content: "Show answer"; font-family: var(--body); font-size: .85rem; color: var(--c); letter-spacing: .03em; }
.fact button[aria-expanded="true"]::after { content: "Hide answer"; }
.fact p { padding: 0 18px 16px; }
.fact:has(button[aria-expanded="true"]) { border-color: var(--c); background: var(--soft); }

/* Pulse */
.pulse { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.pulse-text { display: grid; gap: 8px; min-width: 0; }
.tap {
  width: 7.5rem; height: 7.5rem; border-radius: 50%; border: none; cursor: pointer;
  background: var(--c); color: var(--on-accent); font: inherit; font-family: var(--display); font-weight: 700; font-size: 1.2rem;
  transition: transform .08s;
}
.tap:active { transform: scale(.94); }
.tap.thump { animation: thump .45s ease-out; }
@keyframes thump { from { box-shadow: 0 0 0 0 var(--c); } to { box-shadow: 0 0 0 22px transparent; } }

footer { padding-block: 2.5rem 3.5rem; border-top: 2px dashed var(--line); display: grid; gap: 6px; padding-bottom: calc(3.5rem + env(safe-area-inset-bottom)); }

@media (max-width: 32.5rem) {
  .rosette { width: 6.5rem; }
  .rosette span { font-size: .72rem; padding: 0 1.6rem; }
  .pulse { grid-template-columns: 1fr; justify-items: start; }
  .gait { grid-template-columns: 4.6rem 1fr; }
  .gait .small { grid-column: 1 / -1; margin-top: -8px; }
}

/* Windows High Contrast / forced colours */
@media (forced-colors: active) {
  .beats i, .tap, .pill { forced-color-adjust: none; background: CanvasText; color: Canvas; }
  .btn[aria-pressed="true"] { outline: 3px solid Highlight; }
}

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