/* ============================================================
   Blade & Timber — official site
   Palette mirrors lib/src/style/palette.dart (wuxia ink-wash).
   ============================================================ */

@font-face {
  font-family: "BladeBrush";
  src: url("assets/fonts/blade-brush.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 700;
}

:root {
  /* palette.dart */
  --ink: #2b241f;
  --ink-soft: #564b41;
  --pen: #a63022;
  --red-pen: #b73829;
  --bg-main: #f4e7c5;
  --bg-play: #eadbb6;
  --bg-settings: #efe1bd;
  --bg-sage: #c6d8bd;
  --bg-tan: #d9c79b;
  --white: #ffffff;

  --maxw: 1120px;
  --radius: 18px;
  --shadow-sm: 0 2px 10px rgba(43, 36, 31, .08);
  --shadow-md: 0 14px 40px rgba(43, 36, 31, .16);
  --shadow-lg: 0 30px 70px rgba(43, 36, 31, .26);

  --brush: "BladeBrush", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--serif);
  color: var(--ink);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(166, 48, 34, .06), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(43, 36, 31, .05), transparent 55%);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--pen); text-decoration: none; }
a:hover { color: var(--red-pen); }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 600; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.brush { font-family: var(--brush); font-weight: 400; letter-spacing: .5px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg-main); padding: 10px 16px; border-radius: 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: var(--bg-main); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1;
  padding: 14px 24px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn-sm { padding: 10px 18px; font-size: 15px; }
.btn-primary { background: var(--pen); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--red-pen); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 231, 197, .82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); border-bottom-color: rgba(43, 36, 31, .1); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-name { font-size: 23px; color: var(--ink); white-space: nowrap; }
.site-nav { display: flex; gap: 26px; margin-left: auto; font-family: var(--sans); font-size: 15.5px; }
.site-nav a { color: var(--ink-soft); font-weight: 500; }
.site-nav a:hover { color: var(--pen); }
.header-cta { margin-left: 4px; }

.nav-toggle { display: none; margin-left: auto; width: 44px; height: 40px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; height: 2.5px; background: var(--ink); border-radius: 2px; margin: 5px 0; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-nav { display: none; flex-direction: column; gap: 4px; padding: 8px 24px 18px; font-family: var(--sans); }
.mobile-nav a { color: var(--ink); padding: 12px 4px; border-bottom: 1px solid rgba(43,36,31,.08); font-weight: 500; }
.mobile-nav a.btn { border-bottom: 0; margin-top: 10px; color: var(--white); justify-content: center; }
.mobile-nav.open { display: flex; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: 40px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-top: 36px; padding-bottom: 28px; }
.eyebrow {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .22em; font-size: 13px; font-weight: 700;
  color: var(--pen); margin: 0 0 14px;
}
.hero-title { font-size: clamp(44px, 11vw, 92px); margin: 0; color: var(--ink); overflow-wrap: break-word; }
.hero-tagline { font-family: var(--brush); font-size: clamp(26px, 3.4vw, 36px); color: var(--pen); margin: 6px 0 18px; }
.hero-lede { font-size: 19px; color: var(--ink-soft); max-width: 30ch; margin: 0 0 28px; }
.hero-meta { font-family: var(--sans); font-size: 13.5px; color: var(--ink-soft); margin: 18px 0 0; letter-spacing: .01em; }

.hero-copy { min-width: 0; }
.hero-art { position: relative; display: flex; justify-content: center; min-width: 0; }
.seal {
  position: absolute; top: 6px; right: 8%; z-index: 3;
  width: 62px; height: 62px; display: grid; place-items: center;
  font-family: var(--brush); font-size: 34px; color: var(--bg-main);
  background: radial-gradient(circle at 35% 30%, var(--red-pen), var(--pen) 70%);
  border-radius: 50%; box-shadow: 0 8px 22px rgba(166, 48, 34, .4);
  transform: rotate(-8deg);
}

/* phone / image cards */
.phone {
  position: relative; width: min(340px, 80vw); aspect-ratio: 9 / 16;
  border-radius: 30px; overflow: hidden;
  background: var(--bg-play);
  border: 1px solid rgba(43, 36, 31, .12);
  box-shadow: var(--shadow-lg);
}
.phone img { width: 100%; height: 100%; object-fit: cover; }
.phone-sm { width: min(240px, 70vw); border-radius: 24px; box-shadow: var(--shadow-md); }

/* trait ticker */
.traits { border-top: 1px solid rgba(43,36,31,.1); border-bottom: 1px solid rgba(43,36,31,.1); background: rgba(217, 199, 155, .35); }
.traits-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; padding: 16px 24px; font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: .04em; color: var(--ink-soft); text-transform: uppercase; }
.traits-row i { color: var(--pen); font-style: normal; }

/* ---------- generic section ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-settings); }
.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(34px, 5vw, 50px); color: var(--ink); display: inline-block; position: relative; padding-bottom: 18px; }
.section-head h2::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%) rotate(-1deg);
  width: 92px; height: 7px; border-radius: 40% 60% 55% 45% / 60%;
  background: linear-gradient(90deg, transparent, var(--pen) 18%, var(--red-pen) 82%, transparent);
  opacity: .9;
}
.section-head p { font-size: 19px; color: var(--ink-soft); margin: 18px auto 0; max-width: 56ch; }

/* ---------- features ---------- */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: var(--white); border: 1px solid rgba(43, 36, 31, .08); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: rgba(166, 48, 34, .1); margin-bottom: 16px; }
.feature-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--pen); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 21px; margin-bottom: 8px; }
.feature p { margin: 0; font-size: 16.5px; color: var(--ink-soft); }

/* ---------- how to play ---------- */
.steps { display: flex; flex-direction: column; gap: 42px; max-width: 880px; margin: 0 auto; }
.step { display: grid; grid-template-columns: 240px 1fr; gap: 38px; align-items: center; }
.step:nth-child(even) { grid-template-columns: 1fr 240px; }
.step:nth-child(even) .step-shot { order: 2; }
.step-shot { display: flex; justify-content: center; }
.step-num { font-family: var(--brush); font-size: 40px; color: var(--pen); opacity: .55; display: block; line-height: 1; }
.step-body h3 { font-size: 27px; margin: 6px 0 10px; }
.step-body p { margin: 0; font-size: 18px; color: var(--ink-soft); }

/* ---------- worlds ---------- */
.worlds-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.world { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 9 / 16; transition: transform .25s ease, box-shadow .25s ease; }
.world:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.world img { width: 100%; height: 100%; object-fit: cover; }
.world figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 16px; color: var(--white);
  background: linear-gradient(transparent, rgba(20, 16, 13, .82));
}
.world figcaption strong { display: block; font-family: var(--brush); font-size: 22px; font-weight: 400; }
.world figcaption span { display: block; font-size: 13px; opacity: .9; margin-top: 3px; line-height: 1.4; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.shot { width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 1px solid rgba(43,36,31,.12); background: var(--bg-play); cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.shot:hover img { transform: scale(1.05); }

/* ---------- download band ---------- */
.get-band {
  background:
    radial-gradient(900px 400px at 50% -40%, rgba(255,255,255,.12), transparent 60%),
    linear-gradient(135deg, var(--pen), #7e2419);
  color: var(--bg-main); text-align: center; padding: 80px 0;
}
.get-inner h2 { font-size: clamp(32px, 5vw, 50px); color: var(--white); }
.get-inner > p { font-size: 19px; opacity: .92; margin: 16px auto 30px; max-width: 46ch; }
.get-contact { font-size: 16px; opacity: .92; margin-top: 26px; }
.get-contact a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- store badges ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; }
.store-badges-light { justify-content: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 11px 20px 11px 18px;
  border-radius: 14px; background: var(--ink); color: var(--white);
  font-family: var(--sans); position: relative; user-select: none;
}
.store-badge-logo { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge-text small { font-size: 11px; opacity: .82; letter-spacing: .02em; }
.store-badge-text strong { font-size: 18px; font-weight: 600; }
.store-badge.is-soon { opacity: .92; cursor: default; }
.store-badge.is-soon::after {
  content: "SOON"; position: absolute; top: -9px; right: -8px;
  background: var(--pen); color: var(--white); font-size: 10px; font-weight: 700; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.store-badges-light .store-badge { background: var(--ink); }
.store-badges-light .store-badge.is-soon::after { background: var(--bg-main); color: var(--ink); }

/* ---------- faq ---------- */
.faq-wrap { max-width: 760px; }
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details {
  background: var(--white); border: 1px solid rgba(43,36,31,.08); border-radius: 14px;
  padding: 4px 22px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-size: 18.5px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pen); font-size: 26px; font-weight: 400; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-soft); font-size: 16.5px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--bg-tan); padding: 52px 0 30px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid rgba(244, 231, 197, .14); }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { border-radius: 12px; }
.footer-brand .brand-name { color: var(--bg-main); display: block; font-size: 21px; }
.footer-native { display: block; color: var(--bg-tan); opacity: .7; font-size: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--sans); font-size: 15px; }
.footer-links a { color: var(--bg-tan); }
.footer-links a:hover { color: var(--bg-main); }
.footer-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; font-family: var(--sans); font-size: 13px; color: rgba(217, 199, 155, .65); }
.footer-pkg { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; background: rgba(20, 16, 13, .9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); padding: 5vh 16px; }
.lightbox.open { display: grid; }
.lightbox-img { max-width: min(92vw, 460px); max-height: 90vh; border-radius: 22px; box-shadow: var(--shadow-lg); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(244, 231, 197, .12); color: var(--bg-main); border: 0; cursor: pointer;
  border-radius: 50%; width: 52px; height: 52px; font-size: 30px; line-height: 1; display: grid; place-items: center;
  transition: background .2s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(244, 231, 197, .26); }
.lightbox-close { top: 4vh; right: 4vw; font-size: 34px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: max(4vw, 16px); }
.lightbox-next { right: max(4vw, 16px); }

/* ---------- reveal-on-scroll (progressive enhancement: only hides when JS is on) ---------- */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .feature, .world, .btn, .shot img { transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .worlds-grid, .gallery { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; text-align: center; padding-top: 24px; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-lede { max-width: 46ch; }
  .store-badges { justify-content: center; }
  .seal { right: calc(50% - 150px); }
}

@media (max-width: 760px) {
  .site-nav, .header-cta { display: none; }
  .nav-toggle { display: block; }
  .section { padding: 64px 0; }
  .step, .step:nth-child(even) { grid-template-columns: 1fr; gap: 14px; justify-items: center; text-align: center; }
  .step:nth-child(even) .step-shot { order: 0; }
  .worlds-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 460px) {
  body { font-size: 17px; }
  .feature-grid { grid-template-columns: 1fr; }
  .store-badge { width: 100%; }
  .store-badges { width: 100%; max-width: 320px; }
}
