/* ==========================================================================
   Alquerque — Landing Page Styles
   ========================================================================== */

:root {
  /* Warm parchment & gold palette (Marble theme inspired) */
  --bg:            #fbf6ec;
  --bg-soft:       #f3ead7;
  --bg-card:       #ffffff;
  --ink:           #2c1e12;
  --ink-soft:      #5a4632;
  --ink-mute:      #8a7157;

  --accent:        #c9884d;   /* warm amber */
  --accent-dark:   #a3672f;
  --accent-soft:   #f5e0c4;

  --gold:          #d4a24a;
  --rose:          #c47b64;
  --forest:        #5c7849;
  --indigo:        #3e4a7a;

  /* Pieces */
  --piece-white:   #f7ead2;
  --piece-white-rim:#b59568;
  --piece-black:   #2a1a0d;
  --piece-black-rim:#0f0806;

  --line:          #a87d4e;

  --radius:        18px;
  --radius-lg:     28px;
  --shadow-sm:     0 2px 6px rgba(60,30,10,.08);
  --shadow-md:     0 8px 28px rgba(60,30,10,.12);
  --shadow-lg:     0 18px 60px rgba(60,30,10,.18);

  --serif:         "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:          -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max:           1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1b130c;
    --bg-soft:     #251a10;
    --bg-card:     #2a1e14;
    --ink:         #f4e8d2;
    --ink-soft:    #d4c2a3;
    --ink-mute:    #a38d6e;
    --accent:      #e7a45c;
    --accent-dark: #c9884d;
    --accent-soft: #4a3622;
    --line:        #c78c4d;
    --shadow-sm:   0 2px 6px rgba(0,0,0,.35);
    --shadow-md:   0 8px 28px rgba(0,0,0,.45);
    --shadow-lg:   0 18px 60px rgba(0,0,0,.6);
  }
}

/* Fonts ------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700&display=swap');

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.8rem, 6vw, 4.8rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

p { margin: 0 0 1em; color: var(--ink-soft); }

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

/* Decorative parchment noise background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 10% 0%, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(201,136,77,.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  opacity: .55;
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 236, .85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(168,125,78,.15);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(27,19,12,.85); }
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
}
.brand svg { width: 28px; height: 28px; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: .95rem;
}
.nav a { color: var(--ink-soft); font-weight: 500; }
.nav a:hover { color: var(--accent-dark); }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.lang-switch a {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink-mute);
}
.lang-switch a.active,
.lang-switch a:hover {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 720px) {
  .nav { display: none; }
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(201,136,77,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(201,136,77,.45);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(168,125,78,.3);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
}
.btn-appstore {
  background: #000;
  color: #fff;
  padding: 10px 22px;
  gap: 12px;
}
.btn-appstore:hover { background: #1a1a1a; color: #fff; transform: translateY(-2px); }
.btn-appstore .label-small { font-size: .7rem; opacity: .85; letter-spacing: .05em; }
.btn-appstore .label-big   { font-size: 1.2rem; font-weight: 600; line-height: 1; margin-top: 2px; font-family: var(--sans); }
.btn-appstore .stack { text-align: left; display: flex; flex-direction: column; }

/* Hero -------------------------------------------------------------------- */
.hero {
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 60px;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  color: var(--ink-soft);
  margin-bottom: 28px;
  max-width: 32ch;
}
.hero-lead {
  font-size: 1.1rem;
  max-width: 42ch;
  margin-bottom: 32px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: .9rem;
  color: var(--ink-mute);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Animated board ---------------------------------------------------------- */
.board-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin: 0 auto;
  filter: drop-shadow(0 24px 48px rgba(60,30,10,.25));
}
.board-stage svg { width: 100%; height: 100%; }
.board-stage .line { stroke: var(--line); stroke-width: 2.2; stroke-linecap: round; }
.board-stage .dot  { fill: var(--line); }
.board-stage .piece-white { fill: var(--piece-white); stroke: var(--piece-white-rim); stroke-width: 1.2; }
.board-stage .piece-black { fill: var(--piece-black); stroke: var(--piece-black-rim); stroke-width: 1.2; }
.board-stage .piece-hint  { fill: var(--accent); opacity: 0; animation: hint 2.6s ease-in-out infinite; }

@keyframes hint {
  0%, 100% { opacity: 0; transform: scale(.8); transform-origin: center; }
  50%      { opacity: .85; transform: scale(1.1); }
}
.piece-hint { transform-box: fill-box; }

.board-floats {
  position: absolute; inset: -30px;
  pointer-events: none;
}
.float-piece {
  position: absolute;
  width: 38px; height: 38px;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0,0,0,.18), inset 0 -3px 0 rgba(0,0,0,.18);
  animation: floaty 7s ease-in-out infinite;
}
.float-piece.w { background: radial-gradient(circle at 35% 30%, #fff6e0, #d9bd85 75%); }
.float-piece.b { background: radial-gradient(circle at 35% 30%, #5a3d22, #0d0604 70%); }
.float-piece:nth-child(1) { top: -8px;  left: -2%;  animation-delay: 0s;  }
.float-piece:nth-child(2) { top: 52%;   right: -4%; animation-delay: 1.5s; width: 28px; height: 28px; }
.float-piece:nth-child(3) { bottom: 6%; left: 4%;  animation-delay: 3s;   width: 32px; height: 32px; }
.float-piece:nth-child(4) { top: 20%;   right: 8%; animation-delay: 4.2s; width: 24px; height: 24px; }

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  50%      { transform: translate(6px, -12px) rotate(12deg); }
}

/* Sections ---------------------------------------------------------------- */
section { padding: 80px 0; position: relative; }
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.section-eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 10px;
}

/* Story / About ----------------------------------------------------------- */
.story {
  background: var(--bg-soft);
  border-top: 1px solid rgba(168,125,78,.15);
  border-bottom: 1px solid rgba(168,125,78,.15);
}
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 820px) { .story-grid { grid-template-columns: 1fr; } }
.story h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.story p  { font-size: 1.05rem; }
.story-timeline {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(168,125,78,.12);
}
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(168,125,78,.2);
  gap: 16px;
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-year {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.timeline-text { font-size: .95rem; color: var(--ink-soft); margin: 0; }

/* Features grid ----------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(168,125,78,.1);
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  display: grid; place-items: center;
  margin-bottom: 18px;
  color: #fff;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 6px; }
.feature p  { font-size: .95rem; margin: 0; }

/* Characters -------------------------------------------------------------- */
.characters {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.tier-row {
  margin-bottom: 44px;
}
.tier-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-soft);
}
.tier-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
}
.tier-tag {
  font-size: .85rem;
  color: var(--ink-mute);
  font-style: italic;
}

.char-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .char-row { grid-template-columns: 1fr; } }

.char {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(168,125,78,.12);
  text-align: center;
  transition: transform .2s;
}
.char:hover { transform: translateY(-3px); }
.char-avatar {
  width: 70px; height: 70px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  display: grid; place-items: center;
  font-size: 2rem;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.1);
}
.char-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.char-role { font-size: .85rem; color: var(--ink-mute); margin: 0; }

.tier-apprentice .char-avatar { background: linear-gradient(135deg, #9fc487, #5c7849); }
.tier-learned    .char-avatar { background: linear-gradient(135deg, #7fa0d4, #3e4a7a); }
.tier-noble      .char-avatar { background: linear-gradient(135deg, #e7c068, #a3672f); }

.tier-apprentice .tier-name { color: var(--forest); }
.tier-learned    .tier-name { color: var(--indigo); }
.tier-noble      .tier-name { color: var(--accent-dark); }

/* How to play ------------------------------------------------------------- */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 820px) { .rules-grid { grid-template-columns: 1fr; } }

.rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: rule;
}
.rule-list li {
  counter-increment: rule;
  padding: 16px 0 16px 60px;
  position: relative;
  border-bottom: 1px dashed rgba(168,125,78,.2);
}
.rule-list li:last-child { border-bottom: 0; }
.rule-list li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.rule-list strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 2px;
}
.rule-list span { font-size: .95rem; color: var(--ink-soft); }

/* CTA band ---------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  color: #fff;
  text-align: center;
  padding: 80px 0;
  border-radius: var(--radius-lg);
  margin: 40px 24px;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.12) 0 20%, transparent 21%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.08) 0 15%, transparent 16%);
  pointer-events: none;
}
.cta-band h2, .cta-band p { color: #fff; position: relative; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p  { opacity: .92; max-width: 44ch; margin: 0 auto 28px; }
.cta-band .btn-appstore { margin-top: 10px; }

/* Footer ------------------------------------------------------------------ */
.site-footer {
  background: var(--bg-soft);
  padding: 60px 0 30px;
  margin-top: 20px;
  border-top: 1px solid rgba(168,125,78,.2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h4 {
  font-family: var(--sans);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a  { color: var(--ink-soft); font-size: .95rem; }
.footer-col a:hover { color: var(--accent-dark); }

.footer-brand p {
  font-size: .95rem;
  max-width: 28ch;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(168,125,78,.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .85rem;
  color: var(--ink-mute);
}
.footer-bottom .lang-switch { background: transparent; padding: 0; }

/* Subpage (privacy / support) wrapper ------------------------------------- */
.doc-page {
  padding: 60px 0 120px;
  max-width: 860px;
  margin: 0 auto;
}
.doc-page h1 { margin-bottom: .2em; }
.doc-page .doc-date { color: var(--ink-mute); font-size: .95rem; margin-bottom: 40px; }
.doc-page h2 { margin-top: 48px; }
.doc-page h3 { margin-top: 24px; }
.doc-page p, .doc-page li { font-size: 1rem; color: var(--ink-soft); }
.doc-page ul { padding-left: 24px; }
.doc-page .lang-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.doc-page .lang-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.doc-page .lang-tabs a.active { background: var(--accent); color: #fff; }
.doc-page .doc-lang { display: none; }
.doc-page .doc-lang.active { display: block; }

/* Responsiveness small helpers ------------------------------------------- */
@media (max-width: 640px) {
  section { padding: 60px 0; }
  .hero   { padding: 40px 0 60px; }
  .cta-band { margin: 20px 16px; padding: 60px 20px; }
}
