/* showandtell.click — mobile-first, no external assets */

/* ---- tokens --------------------------------------------------------------- */
:root {
  color-scheme: light dark;
  --brand: #E85D3A;          /* decoration + large text only */
  --brand-dark: #A63A1C;     /* links/buttons on paper: ~6:1 */
  --brand-deeper: #8C2F15;
  --brand-tint: #FDEEE9;
  --on-brand: #FFFFFF;
  --ink: #1F2328;
  --muted: #565C64;          /* ~6.6:1 on paper */
  --line: #E8E2DA;
  --bg: #FFFAF4;             /* warm paper */
  --bg-soft: #FBF2E8;
  --card: #FFFFFF;
  --focus: #1D4ED8;
  --accent: var(--brand);            /* per-letter color, set by app.js */
  --accent-strong: #A63A1C; /* darkened per letter so white text is >= 4.5:1 */

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem;
  --fs-sm: .875rem; --fs-base: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.45rem;
  --shadow-1: 0 1px 2px rgb(60 40 20 / .06), 0 1px 1px rgb(60 40 20 / .04);
  --shadow-2: 0 2px 4px rgb(60 40 20 / .06), 0 8px 20px -6px rgb(60 40 20 / .14);
  --shadow-3: 0 4px 8px rgb(60 40 20 / .07), 0 16px 32px -10px rgb(60 40 20 / .2);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t-fast: .14s;
}

@media screen and (prefers-color-scheme: dark) {
  :root {
    --brand-dark: #FF9C7D;   /* links on dark bg: ~8:1 */
    --brand-deeper: #FFB89F;
    --brand-tint: #3A2620;
    --on-brand: #1B1512;     /* text on light-orange buttons */
    --ink: #F4EEE8;
    --muted: #C3B8AD;        /* ~9:1 on dark bg */
    --line: #3D342D;
    --bg: #1B1714;           /* warm dark */
    --bg-soft: #231E1A;
    --card: #26201C;
    --focus: #8AB4FF;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 2px 4px rgb(0 0 0 / .3), 0 8px 20px -6px rgb(0 0 0 / .5);
    --shadow-3: 0 4px 8px rgb(0 0 0 / .35), 0 16px 32px -10px rgb(0 0 0 / .6);
  }
}

/* ---- base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--bg);
  z-index: 10;
}
.skip:focus { left: var(--s-2); top: var(--s-2); }

[hidden] { display: none !important; }

/* ---- header --------------------------------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) var(--s-1);
}
.brand { margin: 0; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-link { color: var(--ink); text-decoration: none; }
.brand-link::before {
  content: "S";
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: .45em;
  border-radius: .4em;
  background: var(--brand);
  color: #fff;
  font-size: .85em;
  vertical-align: middle;
  box-shadow: var(--shadow-1);
}
.home-link { font-size: .95rem; }

main { max-width: 60rem; margin: 0 auto; padding: 0 var(--s-4); }

/* ---- hero ----------------------------------------------------------------- */
.intro {
  display: grid;
  align-items: center;
  gap: var(--s-4);
  margin: var(--s-4) 0 var(--s-5);
}
.badge {
  display: inline-block;
  margin: 0 0 var(--s-3);
  padding: .3rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-1);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.intro h1 {
  margin: 0 0 var(--s-2);
  font-size: clamp(1.75rem, 6.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lede { margin: 0; color: var(--muted); max-width: 40rem; font-size: 1.1rem; }

.hero-art { display: none; width: 100%; max-width: 15rem; height: auto; justify-self: end; color: var(--line); }
.hero-art text { font: 800 34px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; text-anchor: middle; }
.hero-balloon { animation: bob 6s ease-in-out infinite; transform-box: fill-box; }
.hero-balloon.b2 { animation-delay: -2s; }
.hero-balloon.b3 { animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* ---- letter picker -------------------------------------------------------- */
.picker {
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-2);
}
.grid button {
  --lc: var(--brand);
  --lc-strong: #A63A1C;
  min-height: 3.25rem;      /* >= 44px tap target */
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease);
}
.grid button:hover { border-color: var(--lc); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.grid button:active { transform: translateY(0) scale(.95); box-shadow: var(--shadow-1); }
.grid button[aria-pressed="true"] {
  background: var(--lc-strong);
  border-color: var(--lc-strong);
  color: #fff;
  box-shadow: 0 0 0 3px var(--bg-soft), 0 0 0 5px var(--lc), var(--shadow-2);
}
.grid button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.noscript {
  margin: var(--s-4) 0 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--brand-tint);
}

/* ---- results -------------------------------------------------------------- */
.results { margin: var(--s-6) 0 var(--s-7); outline: none; }
.results-title {
  margin: 0 0 var(--s-1);
  font-size: clamp(1.3rem, 4.8vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: -.015em;
}
.notice { margin: 0 0 var(--s-3); min-height: 1.5em; color: var(--brand-dark); font-weight: 600; }
.results[aria-busy="true"] .results-title { color: var(--muted); }
#retry { margin: 0 0 var(--s-4); }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}
.card {
  position: relative;
  padding: var(--s-4) var(--s-4) var(--s-4) 4rem;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: card-in .32s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
.card-num {
  position: absolute;
  left: .95rem;
  top: 1.05rem;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
}
.card-tag {
  display: inline-block;
  margin: 0 0 var(--s-1);
  padding: .1rem .55rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.card-name { margin: 0; font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.01em; }
.card-loc { margin: var(--s-1) 0 0; color: var(--muted); font-size: .98rem; font-weight: 600; }
.card-tip {
  margin: var(--s-3) 0 0;
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line);
}

/* ---- actions -------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
}
.btn {
  flex: 1 1 100%;
  min-height: 3rem;
  padding: .65rem 1.25rem;
  border: 2px solid var(--brand-dark);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--brand-tint); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand-dark);
  color: var(--on-brand);
  font-size: 1.08rem;
  box-shadow: var(--shadow-2);
}
.btn-primary:hover { background: var(--brand-deeper); border-color: var(--brand-deeper); box-shadow: var(--shadow-3); }
.btn-text {
  min-height: 2.75rem;
  padding: .5rem .25rem;
  border: 0;
  background: none;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-text:hover { text-decoration-thickness: 2px; }

.guide-link {
  margin: var(--s-5) 0 0;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--brand-tint);
  overflow-wrap: anywhere;
}

/* ---- how it works + FAQ --------------------------------------------------- */
.info { margin: 0 0 var(--s-7); }
.info h2 { margin: 0 0 var(--s-4); font-size: clamp(1.3rem, 4.5vw, 1.6rem); letter-spacing: -.015em; }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: var(--s-4) var(--s-4) var(--s-4) 3.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 800;
}
.steps h3 { margin: 0 0 var(--s-1); font-size: var(--fs-lg); line-height: 1.6rem; }
.steps p { margin: 0; color: var(--muted); }

.faq-list { margin: 0; display: grid; gap: var(--s-3); }
.faq-list div {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.faq-list dt { font-weight: 700; font-size: 1.08rem; }
.faq-list dd { margin: var(--s-1) 0 0; color: var(--muted); }

/* ---- footer --------------------------------------------------------------- */
.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .95rem;
}
.site-footer p { margin: var(--s-1) 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
}
.footer-links a { display: inline-block; padding: .35rem 0; }

/* ---- 404 ------------------------------------------------------------------ */
.not-found { padding: var(--s-6) 0 var(--s-7); }
.not-found .big { margin: 0; font-size: clamp(4rem, 18vw, 7rem); font-weight: 800; line-height: 1; color: var(--brand); letter-spacing: -.04em; }
.not-found .actions .btn { flex: 0 1 auto; text-decoration: none; display: inline-grid; place-items: center; }

/* ---- breakpoints ---------------------------------------------------------- */
@media (min-width: 34rem) {
  .grid { grid-template-columns: repeat(7, 1fr); }
  .btn { flex: 0 1 auto; }
  .actions .btn-text { margin-left: var(--s-2); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { padding: var(--s-5) var(--s-4) var(--s-4); }
  .steps li::before { position: static; margin-bottom: var(--s-3); }
  .faq-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 44rem) {
  .intro { grid-template-columns: 1fr 13rem; }
  .hero-art { display: block; }
}
@media (min-width: 52rem) {
  .picker { padding: var(--s-4); }
  .grid { grid-template-columns: repeat(13, 1fr); }
  .cards { grid-template-columns: 1fr 1fr; }
  .intro { grid-template-columns: 1fr 15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .grid button:hover, .card:hover { transform: none; }
}

/* ---- print: results only — letter title, 5 cards, guide link -------------- */
@media print {
  @page { margin: 1.5cm; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .skip, .site-header, .intro, .picker, .actions, .notice, #retry, .info, .site-footer { display: none !important; }
  main { max-width: none; padding: 0; }
  .results { margin: 0; }
  .print-header[hidden] { display: block !important; }
  .print-header {
    margin: 0 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #999;
    font-size: 10pt;
    color: #333;
  }
  .results-title { font-size: 18pt; margin-bottom: .75rem; }
  .cards { grid-template-columns: 1fr; gap: .5rem; }
  .card { break-inside: avoid; border: 1px solid #999; border-left: 4px solid #000; padding: .6rem .8rem .6rem 3rem; box-shadow: none; animation: none; background: #fff; }
  .card-num { background: none; border: 1px solid #000; color: #000; left: .6rem; top: .6rem; width: 1.7rem; height: 1.7rem; }
  .card-tag { background: none; border: 1px solid #999; color: #333; }
  .card-name { font-size: 15pt; }
  .card-loc { color: #333; }
  .card-tip { border-top: 0; padding-top: 0; margin-top: .4rem; }
  .guide-link { background: none; padding: .75rem 0 0; border-top: 1px solid #999; border-radius: 0; }
  .guide-link a { color: #000; text-decoration: none; }
}
