/* Curiosity Math. Type scale and spacing follow alpha.school's homepage
   (h1 32-36px, section titles 30px, card titles 20px, ~1100px content width,
   ~100px between sections), with 16px body text for readability. */

:root {
  --paper: #F9F9F9;
  --band: #F0EEEA;
  --white: #FFFFFF;
  --ink: #22201C;
  --ink-soft: #5B5750;
  --rule: #E3E1DC;
  --amber: #F5A623;
  --amber-hover: #FFB838;
  --amber-deep: #A86400;
  --panel: #22201C;
  --panel-text: #F9F9F9;

  --max: 1100px;
  --narrow: 800px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(64px, 8vw, 104px);
  --title-gap: clamp(28px, 3.4vw, 44px);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber-deep); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.center { text-align: center; }

/* ---------- type scale ---------- */
h1, h2, h3 { margin: 0; font-weight: 700; color: inherit; }
.h1 { font-size: clamp(26px, 2.6vw + 0.5rem, 38px); line-height: 1.15; letter-spacing: -0.01em; }
.h2 { font-size: clamp(24px, 1.6vw + 0.75rem, 30px); line-height: 1.2; letter-spacing: -0.005em; }
.h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }
.lede { font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.small { font-size: 15px; color: var(--ink-soft); }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--amber-hover); }
.btn-small { padding: 9px 18px; font-size: 14px; }
.btn-outline { background: transparent; border: 2px solid currentColor; padding: 12px 24px; }
.btn-outline:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- header ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.wordmark .logo { height: 40px; width: auto; max-width: 220px; object-fit: contain; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(56px, 8vw, 104px); }
.hero .h1 { max-width: 820px; margin: 0 auto; }
.hero .lede { max-width: 680px; margin: 20px auto 0; }
.hero .actions { margin-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* hero with a photo: full-width image, dark overlay, white text */
.hero-photo { position: relative; color: var(--panel-text); display: grid; align-items: center; min-height: clamp(520px, 78vh, 820px); padding-top: 96px; padding-bottom: 96px; overflow: hidden; }
.hero-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(34,32,28,.45), rgba(34,32,28,.68)); z-index: 1; }
.hero-photo .wrap { position: relative; z-index: 2; width: 100%; }
.hero-photo .lede, .hero-photo .small { color: rgba(249,249,249,.85); }

/* ---------- sections ---------- */
.block { padding-top: var(--section); }
.block .section-title { margin-bottom: var(--title-gap); }
.block .section-title + .lede, .section-head .lede { margin-top: -16px; margin-bottom: var(--title-gap); max-width: 720px; }
.center .lede { margin-left: auto; margin-right: auto; }

.band { background: var(--band); margin-top: var(--section); padding-top: var(--section); padding-bottom: var(--section); }
.band + .block { padding-top: var(--section); }

/* ---------- video ---------- */
.video { position: relative; aspect-ratio: 16 / 9; background: var(--panel); color: var(--panel-text); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; text-align: center; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .soon { padding: 24px; }
.video .play { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; border: 2px solid rgba(249,249,249,.35); display: grid; place-items: center; }
.video .play svg { width: 22px; height: 22px; margin-left: 4px; fill: var(--amber); }
.video .soon strong { display: block; font-size: 20px; font-weight: 600; }
.video .soon span { display: block; margin-top: 6px; font-size: 15px; color: rgba(249,249,249,.7); }

/* ---------- puzzle ---------- */
.puzzle { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.equation { margin: 0; font-size: clamp(48px, 6vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.equation .mark { display: inline-block; background: var(--amber); border-radius: 0.12em; padding: 0 0.12em; margin-left: 0.06em; }
.reveal-btn { background: transparent; border: 2px solid var(--ink); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 999px; cursor: pointer; margin-top: 6px; }
.reveal-btn:hover { background: var(--ink); color: var(--paper); }
.answer { margin-top: 20px; padding-left: 18px; border-left: 3px solid var(--amber); }
.answer[hidden] { display: none; }
.answer.open { animation: open .3s ease-out; }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- approach points (centered columns, optional photo) ---------- */
.points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 40px clamp(24px, 3vw, 40px); text-align: center; }
.points .photo { aspect-ratio: 4 / 3; margin-bottom: 20px; }
.points .h3 { margin-bottom: 8px; }
.points p { color: var(--ink-soft); font-size: 15px; max-width: 34ch; margin-left: auto; margin-right: auto; }
.points.no-photos li { padding-top: 20px; border-top: 2px solid var(--ink); }

/* photo frame: any photo fills its slot, cropped from the center */
.photo { overflow: hidden; border-radius: var(--radius); background: var(--band); }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- gallery ---------- */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(46%, 300px), 1fr)); gap: 12px; }
.gallery .photo { aspect-ratio: 4 / 3; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* ---------- subjects ---------- */
.subjects { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 clamp(24px, 5vw, 64px); }
.subjects div { padding: 18px 0; border-bottom: 1px solid #D8D5CF; }
.subjects dt { font-weight: 600; font-size: 18px; }
.subjects dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 32px clamp(20px, 3vw, 36px); }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.steps .h3 { font-size: 18px; margin-bottom: 4px; }
.steps p { color: var(--ink-soft); font-size: 15px; }

/* ---------- where + about ---------- */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(40px, 6vw, 80px); align-items: start; }
.two-col .h2 { margin-bottom: 16px; }
.places { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.places li { border: 1px solid var(--rule); background: var(--white); border-radius: 999px; padding: 5px 14px; font-size: 15px; }

.about { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.about.no-photo { grid-template-columns: minmax(0, 1fr); max-width: var(--narrow); }
.about .photo { aspect-ratio: 4 / 5; }
.about .h2 { margin-bottom: 16px; }
.about p { max-width: 60ch; }

/* ---------- contact ---------- */
.contact { margin-top: var(--section); background: var(--panel); color: var(--panel-text); text-align: center; }
.contact .wrap { padding-top: var(--section); padding-bottom: var(--section); }
.contact .h2 { max-width: 760px; margin: 0 auto; font-size: clamp(26px, 2vw + 0.75rem, 34px); }
.contact .text { max-width: 620px; margin: 18px auto 28px; color: rgba(249,249,249,.78); }
.contact .email-line { margin-top: 16px; font-size: 15px; color: rgba(249,249,249,.7); }
.contact .email-line a { color: var(--panel-text); text-underline-offset: 3px; }
.pay-links { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 15px; color: rgba(249,249,249,.7); }
.pay-links a { color: var(--panel-text); text-underline-offset: 3px; }

.site-footer { background: var(--panel); color: rgba(249,249,249,.55); font-size: 14px; }
.site-footer .wrap { border-top: 1px solid rgba(249,249,249,.15); padding-top: 20px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .puzzle, .about { grid-template-columns: minmax(0, 1fr); }
  .about .photo { max-width: 340px; }
  .subjects div { padding: 14px 0; }
}
@media (max-width: 520px) {
  .site-header .btn-small { padding: 8px 14px; font-size: 13px; }
  .hero-photo { min-height: 480px; padding-top: 72px; padding-bottom: 72px; }
  .video { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .answer.open { animation: none; }
  .btn { transition: none; }
}
