/* ============================================================
   LEXICON LANE — Word Games & Language Play
   Playful letterpress system: warm cream, teal + coral + mustard blocks,
   Scrabble-style letter tiles, rounded Fredoka display. No framework.
   ============================================================ */

:root {
  --ink:      #241f1a;
  --cream:    #fbf3e2;
  --cream-2:  #f4e8cd;
  --tile:     #fdf8ec;
  --teal:     #12897f;
  --teal-dk:  #0d6f66;
  --coral:    #ef6a4c;
  --coral-dk: #d9502f;
  --mustard:  #f4b942;
  --line:     #e6d8b8;
  --ink-soft: #5b5347;

  --f-display: "Fredoka", system-ui, sans-serif;
  --f-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap-max: 78rem;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
}

* { box-sizing: border-box; }

html { background-color: var(--cream); color: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0; min-height: 100dvh;
  font-family: var(--f-body); font-weight: 400; line-height: 1.65; color: var(--ink);
  background-color: var(--cream);
}

::selection { background: var(--mustard); color: var(--ink); }

a { color: inherit; text-decoration: none; }
svg { display: block; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin: 0; line-height: 1.08; }
p { margin: 0; }

.mt-3 { margin-top: 1.5rem; }
.mx-auto { margin-inline: auto; }
.fine { font-size: 0.86rem; color: var(--ink-soft); }

/* -------- Wrap -------- */
.wrap { width: 100%; max-width: var(--wrap-max); margin-inline: auto; padding-inline: 1.4rem; }
@media (min-width: 768px) { .wrap { padding-inline: 2.4rem; } }
.wrap.narrow { max-width: 52rem; }

/* -------- Type -------- */
.display { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.04; }
.display-xl { font-size: clamp(2.6rem, 6.5vw, 4.8rem); font-weight: 700; }
.display-lg { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; }
.light { color: var(--cream); }
.light-soft { color: rgba(251, 243, 226, 0.86); }

.eyebrow {
  display: inline-block; font-family: var(--f-display); font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--coral-dk);
  background: var(--mustard); border: 2px solid var(--ink); border-radius: 999px;
  padding: 0.25rem 0.9rem; box-shadow: var(--shadow-sm); margin-bottom: 1.3rem;
}
.eyebrow--light { color: var(--ink); background: var(--cream); }
.lead { font-size: 1.14rem; line-height: 1.65; color: var(--ink-soft); max-width: 42rem; }

.squiggle {
  color: var(--coral);
  text-decoration: underline wavy var(--coral);
  text-decoration-thickness: 4px; text-underline-offset: 8px;
}

/* -------- Letter tiles -------- */
.tiles { display: inline-flex; gap: 0.35rem; }
.tile {
  display: inline-grid; place-items: center; position: relative;
  width: 44px; height: 44px; flex-shrink: 0;
  font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; line-height: 1;
  background: var(--tile); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 9px; box-shadow: var(--shadow-sm);
}
.tile .pt { position: absolute; right: 4px; bottom: 2px; font-size: 0.5rem; font-weight: 600; }
.tile--teal { background: var(--teal); color: var(--cream); }
.tile--coral { background: var(--coral); color: var(--cream); }
.tile--mustard { background: var(--mustard); color: var(--ink); }
.tile--cream { background: var(--tile); color: var(--ink); }
.tile--big { width: 76px; height: 76px; font-size: 2.7rem; border-radius: 14px; box-shadow: var(--shadow); transform: rotate(var(--r, 0deg)); }
.tile--lg { width: 60px; height: 60px; font-size: 2rem; border-radius: 12px; box-shadow: var(--shadow); }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--f-display); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 0.7rem 1.6rem; border: 2px solid var(--ink); border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-coral { background: var(--coral); color: var(--cream); }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line-light { background: transparent; color: var(--cream); border-color: var(--cream); box-shadow: 3px 3px 0 rgba(0,0,0,0.25); }
.btn-wide { width: 100%; margin-top: 0.4rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.9rem; }
.btn-row--center { justify-content: center; }

.more {
  font-family: var(--f-display); font-size: 0.95rem; font-weight: 600; color: var(--coral-dk);
  white-space: nowrap; border-bottom: 3px solid var(--mustard); padding-bottom: 2px;
}
.more:hover { color: var(--ink); }
.more--light { color: var(--cream); border-color: var(--cream); }

/* -------- Header -------- */
.head { position: sticky; top: 0; z-index: 40; background: var(--cream); border-bottom: 3px solid var(--ink); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 82px; }
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.brand-sub { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--teal-dk); font-weight: 600; margin-top: 2px; }

.head-nav { display: none; align-items: center; gap: 1.7rem; }
.head-nav a { font-family: var(--f-display); font-weight: 500; font-size: 1rem; color: var(--ink); transition: color 0.15s ease; }
.head-nav a:hover { color: var(--coral-dk); }
.head-cta { display: none; }
@media (min-width: 1040px) { .head-nav { display: flex; } .head-cta { display: inline-flex; } }

.nav-toggle-input { display: none; }
.nav-burger { display: inline-flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 9px; border: 2px solid var(--ink); border-radius: 10px; background: var(--mustard); box-shadow: var(--shadow-sm); }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); display: block; }
.mobile-menu { display: none; flex-direction: column; gap: 0.2rem; padding: 0.4rem 0 1.2rem; }
.mobile-menu a { font-family: var(--f-display); font-weight: 500; padding: 0.7rem 0.3rem; border-bottom: 1px solid var(--line); }
.nav-toggle-input:checked ~ .mobile-menu { display: flex; }
@media (min-width: 1040px) { .nav-burger { display: none; } }

/* -------- Hero -------- */
.hero { padding-block: 3.5rem 4rem; background: var(--cream); border-bottom: 3px solid var(--ink); }
@media (min-width: 768px) { .hero { padding-block: 5rem 5.5rem; } }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }
.hero-copy h1 { margin-block: 0.4rem 1.4rem; }
.hero-art { display: flex; justify-content: center; }
.tile-rack { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; max-width: 24rem; }

/* -------- Stat band -------- */
.stat-band { background: var(--mustard); border-bottom: 3px solid var(--ink); }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding-block: 2rem; }
@media (min-width: 620px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat-val { display: block; font-family: var(--f-display); font-weight: 700; font-size: 2.2rem; color: var(--ink); line-height: 1; }
.stat-cap { display: block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--coral-dk); margin-top: 0.5rem; }

/* -------- Sections -------- */
.section { padding-block: 4rem; }
@media (min-width: 768px) { .section { padding-block: 5.5rem; } }
.section--cream { background: var(--cream); }
.section--teal { background: var(--teal); color: var(--cream); border-block: 3px solid var(--ink); }
.section--coral { background: var(--coral); color: var(--cream); border-block: 3px solid var(--ink); }
.section--teal .lead, .section--coral .lead { color: rgba(251, 243, 226, 0.86); }
.section-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 2.4rem; }
.section-head h2 { margin-top: 0.4rem; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }

/* -------- Word games grid -------- */
.game-grid { display: grid; gap: 1.3rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
.game-card {
  display: block; padding: 1.6rem; background: var(--tile); border: 2px solid var(--ink);
  border-radius: 16px; box-shadow: var(--shadow); transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.game-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.game-tile { margin-bottom: 1rem; }
.game-kind { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal-dk); margin-bottom: 0.2rem; }
.game-card h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.game-card p { color: var(--ink-soft); font-size: 0.96rem; }

/* -------- Wordplay cards -------- */
.play-grid { display: grid; gap: 1.3rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .play-grid { grid-template-columns: repeat(2, 1fr); } }
.device-card {
  display: block; padding: 1.6rem; background: var(--cream); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.device-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.device-card h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.device-ex { font-family: var(--f-display); font-weight: 500; color: var(--coral-dk); font-size: 1.05rem; margin-bottom: 0.6rem; }
.device-desc { color: var(--ink-soft); font-size: 0.95rem; }

/* -------- Split -------- */
.split { display: grid; gap: 2.4rem; align-items: center; }
@media (min-width: 840px) { .split { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.split .display { font-size: clamp(1.8rem, 3.6vw, 2.7rem); margin-bottom: 1rem; }

/* -------- Lesson list (home) -------- */
.lesson-list { list-style: none; counter-reset: l; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.lesson-list li {
  counter-increment: l; position: relative; padding: 1rem 1.2rem 1rem 3.4rem;
  background: var(--tile); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.lesson-list li::before {
  content: counter(l); position: absolute; left: 0.8rem; top: 1rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; color: var(--cream); background: var(--teal);
  border: 2px solid var(--ink); border-radius: 8px;
}
.lesson-title { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; }
.lesson-intro { display: block; color: var(--ink-soft); font-size: 0.94rem; }

/* -------- CTA -------- */
.cta { text-align: center; max-width: 46rem; margin-inline: auto; }
.cta h2 { margin-block: 0.6rem 1rem; }

/* -------- Page head -------- */
.page-head { padding-block: 3rem 3rem; background: var(--cream); border-bottom: 3px solid var(--ink); }
@media (min-width: 768px) { .page-head { padding-block: 4.5rem 3.5rem; } }
.page-head h1 { margin-block: 0.3rem 1.2rem; }
.page-head--teal { background: var(--teal); color: var(--cream); }

/* -------- Entries (Games / Workshop pages) -------- */
.entry-stack { display: grid; gap: 1.6rem; }
.entry {
  display: grid; gap: 1.8rem; padding: 2rem; background: var(--tile);
  border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
}
@media (min-width: 820px) { .entry { grid-template-columns: 0.8fr 1.2fr; gap: 3rem; } }
.entry-mark h2 { font-size: 1.9rem; margin: 0.6rem 0 0.4rem; }
.entry-one { font-family: var(--f-display); font-weight: 500; color: var(--coral-dk); font-size: 1.05rem; }
.body-text { color: var(--ink-soft); }
.facts { display: grid; gap: 0; margin: 1.4rem 0; border-top: 2px dashed var(--line); }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 2px dashed var(--line); }
.facts dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal-dk); padding-top: 0.2rem; }
.facts dd { margin: 0; font-family: var(--f-display); font-weight: 500; }
.mini-head { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.8rem; }

.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.tick-list li { position: relative; padding-left: 1.7rem; }
.tick-list li::before { content: "◆"; position: absolute; left: 0; color: var(--coral); font-size: 0.7rem; top: 0.35rem; }

.step-list { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.step-list li {
  counter-increment: s; position: relative; padding: 0.7rem 1rem 0.7rem 3rem;
  background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.step-list li::before {
  content: counter(s); position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; color: var(--cream); background: var(--coral);
  border: 2px solid var(--ink); border-radius: 8px;
}

/* -------- Wordplay page grid -------- */
.device-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .device-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .device-grid { grid-template-columns: repeat(3, 1fr); } }
.device-block { padding: 1.7rem; background: var(--tile); border: 2px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); }
.device-block h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* -------- Glossary -------- */
.gloss-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .gloss-grid { grid-template-columns: repeat(2, 1fr); } }
.gloss-card { padding: 1.4rem; background: var(--tile); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); border-left: 8px solid var(--teal); }
.gloss-card h2 { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; color: var(--teal-dk); margin-bottom: 0.4rem; }
.gloss-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* -------- Contact / forms -------- */
.contact-list { display: grid; gap: 1.3rem; margin: 1.5rem 0 0; }
.contact-list div { display: flex; flex-direction: column; }
.contact-list dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--coral-dk); }
.contact-list dd { margin: 0.3rem 0 0; font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; }
.form-box { padding: 1.8rem; background: var(--tile); border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
.field { display: grid; margin-bottom: 1.1rem; }
.field label { font-family: var(--f-display); font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.req { color: var(--coral-dk); margin-left: 3px; }
.input, .textarea {
  width: 100%; font-family: var(--f-body); font-size: 1rem; color: var(--ink);
  background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; padding: 0.7rem 0.9rem; outline: none;
  transition: box-shadow 0.12s ease;
}
.textarea { resize: vertical; }
.input:focus, .textarea:focus { box-shadow: var(--shadow-sm); }
.form-done { display: flex; gap: 1.1rem; align-items: center; padding: 1.8rem; background: var(--tile); border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
.form-done[hidden] { display: none; }

/* -------- FAQ -------- */
.faq-group { margin-bottom: 2.4rem; }
.faq-item { background: var(--tile); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm); margin-bottom: 0.9rem; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1.1rem 1.3rem; display: flex; justify-content: space-between; gap: 1.2rem;
  font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--coral); font-weight: 700; font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.mini-head { display: block; }

/* -------- Prose (legal) -------- */
.prose { max-width: 46rem; }
.prose h2 { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; margin-top: 2.2rem; margin-bottom: 0.7rem; }
.prose p { margin-bottom: 1rem; color: var(--ink-soft); }
.prose a { color: var(--teal-dk); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* -------- Footer -------- */
.foot { background: var(--ink); color: var(--cream); border-top: 3px solid var(--ink); }
.foot-grid { display: grid; gap: 2.2rem; padding-block: 3.4rem; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 2fr repeat(3, 1fr); } }
.foot-brand .brand-name { color: var(--cream); }
.foot-brand .brand-sub { color: var(--mustard); }
.foot-brand p { margin-top: 1rem; color: rgba(251, 243, 226, 0.72); max-width: 24rem; font-size: 0.94rem; }
.foot-col h4 { font-family: var(--f-display); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--mustard); margin-bottom: 1rem; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 0.6rem; }
.foot-col li a { font-size: 0.94rem; color: rgba(251, 243, 226, 0.78); }
.foot-col li a:hover { color: var(--cream); }
.foot-base { display: flex; flex-direction: column; gap: 0.6rem; padding-block: 1.6rem; border-top: 1px solid rgba(251, 243, 226, 0.18); font-size: 0.84rem; color: rgba(251, 243, 226, 0.6); }
@media (min-width: 768px) { .foot-base { flex-direction: row; justify-content: space-between; align-items: center; } }
.foot-sign { color: var(--mustard); font-family: var(--f-display); font-weight: 500; }

/* -------- Skip link -------- */
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--coral); color: var(--cream); padding: 0.6rem 1rem; border: 2px solid var(--ink); border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .btn:hover, .game-card:hover, .device-card:hover { transform: none; }
}
