/* Shax website. Colours match lib/shax_theme.dart (ShaxColors). */

@font-face { font-family: "Roboto"; src: url("/fonts/Roboto-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/Roboto-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/Roboto-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("/fonts/Roboto-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

:root {
  --table: #9B6231;
  --table-dark: #7E4E25;
  --board: #BD8556;
  --walnut: #4A2C12;
  --walnut-deep: #2F1B0A;
  --cream: #F7EBD3;
  --cream-deep: #EEDCB8;
  --ink: #2E1D0E;
  --ink-soft: #5A4330;
  --amber: #F2B447;
  --amber-deep: #D9962A;
  --hint: #2E7D32;
  --danger: #C62828;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(20, 10, 2, .35);
  --container: 1120px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--cream);
  background: var(--walnut-deep);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); font-weight: 900; letter-spacing: -.02em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 760px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 10px; background: var(--amber); color: var(--ink); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .85em 1.35em; border-radius: 14px; border: 0;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: var(--ink);
  background: linear-gradient(180deg, #F7C565, var(--amber) 55%, var(--amber-deep));
  box-shadow: 0 10px 24px rgba(217, 150, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(217, 150, 42, .45), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-lg { font-size: 1.1rem; padding: 1em 1.6em; }
.btn-sm { font-size: .92rem; padding: .55em 1em; border-radius: 12px; }

.store-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.store-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-width: 11.5rem; padding: .55rem 1rem; border-radius: 12px;
  background: rgba(20, 10, 2, .55); border: 1px solid rgba(247, 235, 211, .25);
  color: var(--cream); text-decoration: none; line-height: 1.2;
  transition: border-color .18s ease, transform .18s ease;
}
.store-btn .icon { width: 1.6rem; height: 1.6rem; }
.store-btn small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.store-btn strong { font-size: 1.05rem; }
a.store-btn:hover { border-color: var(--amber); transform: translateY(-2px); }
.store-btn.is-soon { opacity: .8; cursor: default; }
.store-btn.is-soon small { color: var(--amber); opacity: 1; }

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(47, 27, 10, .78);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(247, 235, 211, .08);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 900; font-size: 1.35rem; letter-spacing: .01em; text-decoration: none; }
.brand img { border-radius: 8px; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
.main-nav > a { text-decoration: none; font-weight: 500; opacity: .85; transition: opacity .15s ease, color .15s ease; }
.main-nav > a:hover { opacity: 1; color: var(--amber); }
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(247, 235, 211, .1); }
.lang-switch a { padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-decoration: none; opacity: .75; }
.lang-switch a:hover { opacity: 1; }
.lang-switch a.is-current { background: var(--cream); color: var(--ink); opacity: 1; }
.nav-toggle { display: none; margin-left: .25rem; padding: .45rem; border: 0; border-radius: 10px; background: rgba(247, 235, 211, .12); color: var(--cream); cursor: pointer; }
.nav-toggle .icon { width: 1.5rem; height: 1.5rem; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .header-play { margin-left: auto; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: .5rem 1.25rem 1.25rem; margin: 0;
    background: rgba(47, 27, 10, .97); border-bottom: 1px solid rgba(247, 235, 211, .1);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav > a { width: 100%; padding: .8rem 0; border-bottom: 1px solid rgba(247, 235, 211, .08); }
  .main-nav .lang-switch { margin-top: 1rem; }
}

/* Language hint ------------------------------------------------------------ */
.lang-hint { background: var(--amber); color: var(--ink); font-size: .95rem; }
.lang-hint .container { display: flex; align-items: center; gap: 1rem; padding-block: .55rem; }
.lang-hint a { font-weight: 700; }
.lang-hint button { margin-left: auto; padding: .25rem; border: 0; background: none; color: inherit; cursor: pointer; }

/* Hero ------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(3rem, 2rem + 5vw, 6.5rem) 0 clamp(4rem, 3rem + 5vw, 7.5rem);
  background:
    radial-gradient(60% 70% at 78% 45%, rgba(242, 180, 71, .28), transparent 70%),
    radial-gradient(80% 90% at 10% 0%, rgba(155, 98, 49, .55), transparent 70%),
    linear-gradient(160deg, var(--walnut) 0%, var(--walnut-deep) 55%, #24140A 100%);
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: .16; mix-blend-mode: overlay; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }
.eyebrow {
  display: inline-block; margin-bottom: 1.2rem; padding: .35rem .9rem; border-radius: 999px;
  background: rgba(242, 180, 71, .15); border: 1px solid rgba(242, 180, 71, .4);
  color: var(--amber); font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.wordmark {
  font-size: clamp(4.5rem, 3rem + 9vw, 9.5rem); font-weight: 900; line-height: .9; letter-spacing: -.045em;
  margin: 0 0 1.5rem;
  background: linear-gradient(180deg, #FFF6E2 0%, var(--cream) 45%, #E8C98F 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); color: rgba(247, 235, 211, .88); max-width: 34rem; margin-bottom: 2rem; }
.cta-row { margin-bottom: 1.25rem; }
.hero-note { margin: 1.4rem 0 0; font-size: .92rem; letter-spacing: .03em; color: rgba(247, 235, 211, .65); }
.hero-visual { display: flex; justify-content: center; perspective: 1400px; }
.board-stage {
  width: min(100%, 470px); aspect-ratio: 1;
  transform: rotateX(8deg) rotateZ(-3deg);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, .5)) drop-shadow(0 0 60px rgba(242, 180, 71, .15));
}
.board-stage:hover { transform: rotateX(0) rotateZ(0); }
.board { width: 100%; height: auto; }

/* Board animation (site.js) */
.board .pc-enter { transform-box: fill-box; transform-origin: center; animation: piece-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.board .pc-move { transition: transform .7s cubic-bezier(.45, 0, .2, 1); }
.board .pc-leave { transform-box: fill-box; transform-origin: center; animation: piece-out .5s ease both; }
.board .mark-in { transform-box: fill-box; transform-origin: center; animation: mark-in .35s ease both; }
.board .glow { animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes piece-in { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes piece-out { to { transform: scale(.3); opacity: 0; } }
@keyframes mark-in { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes glow { from { stroke-opacity: .55; } to { stroke-opacity: 1; } }

/* Sections ------------------------------------------------------------------ */
.section { position: relative; padding: clamp(4rem, 3rem + 4vw, 7rem) 0; }
.section-cream { background: var(--cream); color: var(--ink); }
.section-wood { background: linear-gradient(180deg, var(--table), var(--table-dark)); isolation: isolate; }
.section-wood::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: .12; mix-blend-mode: overlay; }
.section-dark { background: radial-gradient(70% 60% at 50% 100%, rgba(242, 180, 71, .16), transparent 70%), var(--walnut-deep); }
.section-head { max-width: 40rem; margin: 0 auto clamp(2.5rem, 4vw, 3.5rem); text-align: center; }
.section-head p { font-size: 1.1rem; opacity: .85; }
.section-foot { margin: 2.5rem 0 0; text-align: center; opacity: .85; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.about-copy p { color: var(--ink-soft); font-size: 1.08rem; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.facts li {
  padding: 1.4rem 1.2rem; border-radius: var(--radius);
  background: #fff8ea; border: 1px solid rgba(74, 44, 18, .1);
  box-shadow: 0 8px 22px rgba(74, 44, 18, .08);
}
.facts strong { display: block; font-size: 2.6rem; font-weight: 900; line-height: 1; color: var(--table); letter-spacing: -.03em; }
.facts span { display: block; margin-top: .4rem; font-size: .95rem; color: var(--ink-soft); line-height: 1.35; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.step {
  display: flex; flex-direction: column;
  padding: 1rem 1rem 1.4rem; border-radius: var(--radius);
  background: var(--cream); color: var(--ink);
  box-shadow: var(--shadow);
}
.step-board { margin-bottom: 1.1rem; border-radius: 14px; overflow: hidden; }
.step h3 { display: flex; align-items: center; gap: .6rem; }
.step-num { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--walnut); color: var(--cream); font-size: .9rem; font-weight: 900; }
.step p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* Screenshots */
.phones { display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.phone {
  margin: 0; flex: 0 1 250px; padding: 9px; border-radius: 40px;
  background: linear-gradient(145deg, #3B2410, #140A03);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(247, 235, 211, .12);
}
.phone img { width: 100%; height: auto; border-radius: 34px; }
.phone-side { transform: scale(.88); opacity: .92; }
.phone-side:first-child { transform: scale(.88) rotate(-4deg); }
.phone-side:last-child { transform: scale(.88) rotate(4deg); }

/* Features */
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  padding: 1.6rem; border-radius: var(--radius);
  background: #fff8ea; border: 1px solid rgba(74, 44, 18, .1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(74, 44, 18, .14); }
.feature-icon { width: 2.75rem; height: 2.75rem; padding: .55rem; margin-bottom: 1rem; border-radius: 14px; background: var(--walnut); color: var(--amber); }
.feature p { margin: 0; color: var(--ink-soft); }

/* FAQ */
.faq { display: grid; gap: .75rem; }
.faq details { border-radius: 16px; background: var(--cream); color: var(--ink); box-shadow: 0 8px 24px rgba(20, 10, 2, .18); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; font-weight: 700; font-size: 1.05rem; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s ease; color: var(--table); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.faq details a { color: var(--walnut); font-weight: 700; }

/* Final call to action */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: clamp(4rem, 3rem + 4vw, 6.5rem) 0;
  background: radial-gradient(50% 80% at 50% 0%, rgba(242, 180, 71, .3), transparent 70%), linear-gradient(180deg, var(--walnut), var(--walnut-deep));
}
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: .14; mix-blend-mode: overlay; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.cta-inner p { font-size: 1.15rem; opacity: .85; margin: 0 0 .5rem; }
.cta-inner .store-row { justify-content: center; }

/* Text pages (privacy, legal, 404) */
.page { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; }
.page h1 { font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; }
.page h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.page p { color: rgba(247, 235, 211, .86); }
.page a { color: var(--amber); }
.page-meta { font-size: .9rem; opacity: .7; }
.not-found { padding: clamp(3rem, 2rem + 4vw, 6rem) 0; text-align: center; }
.not-found-board { width: 180px; margin: 0 auto 2rem; transform: rotate(-6deg); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .45)); }

/* Footer */
.site-footer { padding: 3rem 0 2rem; background: #1F1107; border-top: 1px solid rgba(247, 235, 211, .08); font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-brand { display: flex; align-items: center; gap: .9rem; }
.footer-brand img { border-radius: 10px; }
.footer-brand strong { font-size: 1.2rem; font-weight: 900; }
.footer-brand p { margin: 0; opacity: .7; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { text-decoration: none; opacity: .8; }
.footer-links a:hover { opacity: 1; color: var(--amber); }
.fine-print { margin-top: 2rem; font-size: .8rem; opacity: .5; }

/* Reveal on scroll (site.js adds .is-visible) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1020px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .store-row { justify-content: center; }
  .board-stage { width: min(100%, 380px); transform: none; }
  .about-grid { grid-template-columns: 1fr; }
  .phones { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 1rem 1.25rem 2rem; margin-inline: -1.25rem; }
  .phone, .phone-side, .phone-side:first-child, .phone-side:last-child { flex: 0 0 72%; transform: none; opacity: 1; scroll-snap-align: center; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .steps, .features { grid-template-columns: 1fr; }
  .header-inner { gap: .75rem; }
  .store-btn { min-width: 0; flex: 1 1 10rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .board-stage { transform: none; }
}
