/* ============================================================
   Ludus Lark — landing page styles
   ============================================================ */

:root {
  --cream: #fdf6e8;
  --cream-deep: #f0e4d0;
  --ink: #1a1532;
  --ink-soft: #2a2247;
  --coral: #ff5a3d;
  --mint: #3fa380;
  --mint-light: #7cd9b8;
  --marigold: #f5b942;
  --rose: #f7a8a0;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1200px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -40px; left: 1rem;
  background: var(--ink); color: var(--cream);
  padding: 0.5rem 1rem; border-radius: 6px;
  text-decoration: none; z-index: 100;
}
.skip-link:focus { top: 1rem; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}

h1 { font-size: clamp(2.75rem, 8vw, 6rem); }
h2 { font-size: clamp(2rem, 5.5vw, 3.75rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); }

em {
  font-style: italic;
  color: var(--coral);
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
strong { font-weight: 700; }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  color: var(--ink);
  opacity: 0.65;
}
.eyebrow .star { color: var(--coral); opacity: 1; }

.lede {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  max-width: 56ch;
  line-height: 1.55;
}

.hl {
  position: relative;
  color: var(--coral);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%; bottom: -0.06em;
  height: 0.18em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><path d='M2 5 Q 50 1 100 4 T 198 4' stroke='%23f5b942' stroke-width='3' fill='none' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--pad);
  background: rgba(253, 246, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 21, 50, 0.08);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--ink);
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.wordmark strong { font-weight: 700; }
.wordmark-bird {
  width: 30px; height: auto;
  color: var(--coral);
  transition: transform 0.3s cubic-bezier(.5, 1.5, .5, 1);
}
.wordmark:hover .wordmark-bird { transform: rotate(-15deg) translateY(-3px); }

.primary-nav {
  display: flex;
  gap: 1.75rem;
  font-weight: 500;
}
.primary-nav a {
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding: 0.25rem 0;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--coral);
  transition: width 0.2s;
}
.primary-nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none; border: 0;
  width: 36px; height: 36px;
  flex-direction: column; justify-content: center; gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 720px) {
  .primary-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0.5rem;
    background: var(--cream);
    padding: 1rem var(--pad);
    border-bottom: 1px solid rgba(26, 21, 50, 0.08);
  }
  .primary-nav.open { display: flex; }
  .nav-toggle { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.95em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 4px 4px 0 var(--coral);
}
.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--coral);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--coral);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { color: var(--coral); transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 9vw, 7rem) var(--pad) clamp(4rem, 10vw, 8rem);
  max-width: var(--container);
  margin: 0 auto;
  overflow: hidden;
}
.hero h1 { max-width: 22ch; }

.hero-cta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.5rem;
}

/* Floaters */
.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.floater {
  position: absolute;
  width: clamp(70px, 9vw, 120px);
  filter: drop-shadow(4px 6px 0 rgba(26, 21, 50, 0.1));
}
.floater--screen { top: 9%;  right: 9%;  --r: -8deg; animation: bob 7s ease-in-out infinite; }
.floater--die    { top: 42%; right: 4%;  --r: 12deg; animation: bob 6s ease-in-out -2s infinite; }
.floater--card   { top: 68%; right: 22%; --r: -4deg; animation: bob 8s ease-in-out -4s infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0)     rotate(var(--r)); }
  50%      { transform: translateY(-14px) rotate(calc(var(--r) + 4deg)); }
}

@media (max-width: 900px) {
  .floater { opacity: 0.55; }
  .floater--card   { display: none; }
  .floater--screen { top: 2%; right: 4%; }
  .floater--die    { top: 18%; right: 70%; }
}

/* ---------- About (dark section) ---------- */
.section-dark {
  background: var(--ink);
  color: var(--cream);
}
.section-dark .eyebrow { color: var(--marigold); opacity: 1; }
.section-dark em { color: var(--marigold); }

.about { padding: clamp(4rem, 8vw, 7rem) 0; }
.about h2 { max-width: 14ch; }

/* ---------- Toy blocks (reusable) ---------- */
.toy-block {
  display: inline-block;
  width: clamp(54px, 7vw, 84px);
  flex-shrink: 0;
  filter: drop-shadow(3px 4px 0 rgba(26, 21, 50, 0.18));
}
.toy-block svg { width: 100%; height: auto; overflow: visible; }
.block-letter {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  fill: var(--block-text, #fdf6e8);
}

.toy-block--coral {
  --block-front: #ff5a3d; --block-top: #ff8c75;
  --block-side:  #cc4730; --block-text: #fdf6e8;
}
.toy-block--mint {
  --block-front: #3fa380; --block-top: #6fc4a3;
  --block-side:  #2d7659; --block-text: #fdf6e8;
}
.toy-block--marigold {
  --block-front: #f5b942; --block-top: #ffd278;
  --block-side:  #c9952f; --block-text: #1a1532;
}
.toy-block--rose {
  --block-front: #f7a8a0; --block-top: #fcc7c1;
  --block-side:  #c8857f; --block-text: #1a1532;
}
.toy-block--mint-light {
  --block-front: #7cd9b8; --block-top: #a8e8d0;
  --block-side:  #5cb597; --block-text: #1a1532;
}

/* ---------- Dictionary entry ---------- */
.dict-entry {
  border-top: 1.5px solid rgba(253, 246, 232, 0.18);
  padding: 2.25rem 0 0.5rem;
  margin: 0 0 2.75rem;
  max-width: 760px;
}
.dict-entry .headword {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Single block as the first letter of each headword */
.dict-block {
  width: clamp(48px, 5.5vw, 68px);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(.4, 1.6, .6, 1);
}
.dict-entry:nth-of-type(1) .dict-block { transform: rotate(-7deg); }
.dict-entry:nth-of-type(2) .dict-block { transform: rotate(5deg); }
.dict-entry .headword:hover .dict-block { transform: rotate(0); }
.dict-entry .headword dfn {
  font-style: normal;
  text-decoration: none;
}
.dict-entry .pronunciation {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.55;
}
.dict-entry .pos {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0.5rem 0 1.5rem;
  opacity: 0.7;
}
.dict-entry .defs {
  margin: 0;
  padding-left: 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
}
.dict-entry .defs li { margin-bottom: 0.85rem; padding-left: 0.4rem; }
.dict-entry .defs li::marker {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100;
  color: var(--marigold);
}
.dict-entry .aside { opacity: 0.55; font-style: italic; }

.dict-coda {
  margin: 0.5rem 0 3.5rem;
  font-size: 1.05rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid rgba(253, 246, 232, 0.18);
  max-width: 760px;
}
.dict-coda strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 1.2em;
  color: var(--mint-light);
  letter-spacing: -0.01em;
}

.pillars {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.pillar {
  background: var(--ink-soft);
  border: 1.5px solid rgba(253, 246, 232, 0.08);
  border-radius: 18px;
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}
.pillar:hover { transform: translateY(-4px); border-color: rgba(253, 246, 232, 0.18); }
.pillar h3 { margin: 1rem 0 0.5rem; }
.pillar p  { margin: 0; opacity: 0.82; font-size: 0.98rem; }

.pillar-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  padding: 10px;
}
.pillar-icon svg { width: 100%; height: 100%; }
.pillar--video .pillar-icon { background: var(--mint-light); color: var(--ink); }
.pillar--board .pillar-icon { background: var(--coral);      color: var(--ink); }
.pillar--card  .pillar-icon { background: var(--marigold);   color: var(--ink); }

@media (max-width: 720px) {
  .pillars { grid-template-columns: 1fr; }
}

.footnote {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  opacity: 0.5;
  font-style: italic;
}

/* ---------- Games ---------- */
.games {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--cream);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.game-card {
  background: var(--cream-deep);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 1.25rem;
  transition: transform 0.25s cubic-bezier(.4, 1.4, .6, 1), box-shadow 0.25s;
  box-shadow: 4px 4px 0 var(--ink);
}
.game-card:nth-child(1) { transform: rotate(-1deg); }
.game-card:nth-child(2) { transform: rotate(0.5deg); }
.game-card:nth-child(3) { transform: rotate(-0.5deg); }
.game-card:hover {
  transform: rotate(0) translate(-2px, -4px);
  box-shadow: 8px 10px 0 var(--ink);
}

.game-thumb {
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  margin-bottom: 1rem;
  aspect-ratio: 5 / 3;
}
.game-thumb svg { width: 100%; height: 100%; }

.game-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--ink); color: var(--cream);
  margin-bottom: 0.75rem;
}
.game-card h3 { margin: 0 0 0.5rem; }
.game-card > p { margin: 0 0 0.75rem; font-size: 0.98rem; }

.game-status {
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  margin: 0.5rem 0 0;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--coral    { background: var(--coral);    box-shadow: 0 0 0 3px rgba(255, 90, 61, 0.22); }
.dot--mint     { background: var(--mint);     box-shadow: 0 0 0 3px rgba(63, 163, 128, 0.22); }
.dot--marigold { background: var(--marigold); box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.28); }

@media (max-width: 900px) {
  .game-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .game-card { transform: none !important; }
}

/* ---------- Flock (color block) ---------- */
.section-color {
  background: var(--marigold);
  color: var(--ink);
  padding: clamp(4rem, 8vw, 6rem) 0;
  position: relative;
  overflow: hidden;
}
.section-color::before,
.section-color::after {
  content: "✦";
  position: absolute;
  font-family: var(--font-display);
  font-size: 8rem;
  opacity: 0.12;
  pointer-events: none;
}
.section-color::before { top: 8%;  left: -1%; transform: rotate(-12deg); }
.section-color::after  { bottom: 8%; right: -1%; transform: rotate(20deg); }

.section-color .eyebrow { opacity: 1; color: var(--coral); }

.flock-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.flock-copy h2 { max-width: 12ch; }
.flock-copy p { max-width: 42ch; }

@media (max-width: 800px) {
  .flock-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.signup {
  background: var(--cream);
  border-radius: 999px;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 6px 6px 0 var(--ink);
  border: 2px solid var(--ink);
  position: relative;
}
.signup input {
  flex: 1;
  padding: 0.85em 1.2em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.signup input::placeholder { color: rgba(26, 21, 50, 0.4); }
.signup input:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.signup button {
  padding: 0.85em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: var(--cream);
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}
.signup button:hover { background: var(--ink); }
.signup-status {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 1.2rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.signup-status.success::before { content: "✦  "; color: var(--coral); }
.signup-status.error::before   { content: "!  "; color: var(--coral); font-weight: 800; }

@media (max-width: 480px) {
  .signup { flex-direction: column; border-radius: 24px; padding: 0.75rem; }
  .signup input { width: 100%; padding: 0.85em 1rem; }
  .signup button { width: 100%; }
  .signup-status { position: static; margin-top: 0.6rem; padding-left: 0.5rem; }
}

/* ---------- Contact ---------- */
.contact { padding: clamp(4rem, 8vw, 7rem) 0; }
.contact h2 { max-width: 18ch; }

.contact-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.contact-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  opacity: 0.55;
}
.contact-link {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--coral);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.contact-link:hover { color: var(--coral); }

@media (max-width: 720px) {
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 3rem 0 2rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.footer-tag { margin: 0; opacity: 0.65; font-size: 0.92rem; max-width: 38ch; }

.socials {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-weight: 600;
}
.socials a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s, color 0.15s;
}
.socials a:hover { border-color: var(--coral); color: var(--marigold); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
