/* tribal.cx - public site.

   Two materials, the same two the add-on is made of: dark oiled wood for the
   frame, parchment for anything you read. Gold picks out what matters, ember
   is the one colour that means "do this". */

:root {
  --wood-950: #140e08;
  --wood-900: #1c140b;
  --wood-800: #241910;
  --wood-700: #2f2014;
  --wood-600: #3a2716;
  --wood-500: #4d341c;
  --leather: #7d510f;
  --leather-2: #94621f;
  --gold: #d9a441;
  --gold-2: #f2c96a;
  --gold-3: #a8761e;
  --ember: #c4561d;
  --ember-2: #df6d2e;
  --parch: #f4e4bc;
  --parch-2: #ead6a4;
  --parch-3: #e0c898;
  --parch-4: #fbf4e2;
  --text: #3b2a12;
  --text-2: #6b5424;
  --text-light: #efe2c2;
  --text-light-2: #bfa982;
  --green: #3f6a22;
  --green-2: #5f8f3a;
  --red: #a8321f;
  --blue: #3f6d8e;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, 'URW Palladio L', 'P052', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 14px 40px rgba(12, 7, 2, .45);
  --shadow-sm: 0 4px 14px rgba(12, 7, 2, .25);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--text-light);
  background: var(--wood-800);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 164, 65, .08), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--wood-800), var(--wood-900));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; overflow-x: clip; } /* stamp-in animations overhang for a moment; the page must never scroll sideways */
img, svg { max-width: 100%; }
a { color: var(--gold-2); text-underline-offset: 3px; }
a:hover { color: #fff1c6; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--parch); color: var(--text); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.game-ico { width: 32px; height: 32px; flex: none; }

/* ---- announcement + header ---------------------------------------------- */

.announce {
  background: linear-gradient(90deg, var(--leather), var(--leather-2), var(--leather));
  color: var(--parch-4); text-align: center; font-size: .9rem; padding: 7px var(--gutter);
}
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(28, 20, 11, .86);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid rgba(217, 164, 65, .22);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--parch); flex: none; }
.brand svg { width: 40px; height: 40px; }
.brand b { font-family: var(--serif); font-size: 1.22rem; letter-spacing: .14em; font-weight: 700; }
.brand small { display: block; font-family: var(--serif); color: var(--gold); font-size: .66rem; letter-spacing: .38em; margin-top: -2px; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  color: var(--text-light); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .96rem;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(217, 164, 65, .13); color: var(--gold-2); }
.head-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; background: none; border: 1px solid rgba(217, 164, 65, .4); color: var(--parch); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.menu-btn .ico { width: 22px; height: 22px; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column;
    background: var(--wood-900); border-bottom: 1px solid rgba(217, 164, 65, .25); padding: 10px var(--gutter) 16px; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1.05rem; }
  .head-actions .btn-ghost { display: none; }
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  --bg: var(--ember);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--sans); letter-spacing: .02em;
  color: #fff6e6; background: linear-gradient(180deg, var(--ember-2), var(--ember));
  border: 1px solid #8e3a10; border-radius: 999px; padding: 13px 22px; cursor: pointer;
  text-decoration: none; box-shadow: 0 6px 18px rgba(196, 86, 29, .35), inset 0 1px 0 rgba(255, 220, 180, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.btn:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 26px rgba(196, 86, 29, .45), inset 0 1px 0 rgba(255, 220, 180, .35); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-lg { padding: 17px 30px; font-size: 1.1rem; }
.btn-sm { padding: 9px 14px; font-size: .9rem; }
.btn-ghost {
  background: transparent; color: var(--gold-2); border: 1px solid rgba(217, 164, 65, .55); box-shadow: none;
}
.btn-ghost:hover { background: rgba(217, 164, 65, .12); color: #fff1c6; box-shadow: none; }
.btn-parch {
  background: linear-gradient(180deg, var(--parch-4), var(--parch-2)); color: var(--text);
  border-color: var(--leather); box-shadow: var(--shadow-sm);
}
.btn-parch:hover { color: var(--text); }
.btn-danger { background: linear-gradient(180deg, #c2402a, var(--red)); border-color: #6e1d10; box-shadow: none; }
.btn-block { width: 100%; }

/* ---- sections ------------------------------------------------------------ */

.section { padding-block: clamp(64px, 9vw, 120px); position: relative; }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; color: var(--gold);
  font: 700 .78rem/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; margin-bottom: 14px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-light-2); max-width: 62ch; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* Parchment: anything you are meant to read at length sits on paper. */
.parchment {
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 230, .7), transparent 70%),
    radial-gradient(ellipse at 100% 100%, rgba(170, 120, 50, .16), transparent 60%),
    repeating-linear-gradient(45deg, rgba(160, 120, 60, .025) 0 2px, transparent 2px 9px),
    var(--parch);
}
.parchment .lead { color: var(--text-2); }
.parchment .eyebrow { color: var(--leather); }
.parchment a:not(.btn) { color: var(--leather); }
.parchment a:not(.btn):hover { color: var(--ember); }
.parchment h1, .parchment h2, .parchment h3 { color: #2b1d0e; }

/* Where wood meets paper: a leather band with a gold rule, the paper shaded
   as if tucked under the frame, and a brass stud at the centre of the seam. */
.seam-top, .seam-bottom { position: relative; }
.seam-top { box-shadow: inset 0 3px 0 #4d2f08, inset 0 5px 0 #d9a441, inset 0 22px 22px -16px rgba(60, 36, 10, .38); }
.seam-bottom { box-shadow: inset 0 -3px 0 #4d2f08, inset 0 -5px 0 #d9a441, inset 0 -22px 22px -16px rgba(60, 36, 10, .38); }
.seam-top.seam-bottom {
  box-shadow: inset 0 3px 0 #4d2f08, inset 0 5px 0 #d9a441, inset 0 22px 22px -16px rgba(60, 36, 10, .38),
              inset 0 -3px 0 #4d2f08, inset 0 -5px 0 #d9a441, inset 0 -22px 22px -16px rgba(60, 36, 10, .38);
}
.seam-top::before, .seam-bottom::after {
  content: ""; position: absolute; left: 50%; width: 30px; height: 30px; z-index: 2; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23f6d27a'/%3E%3Cstop offset='1' stop-color='%23a8761e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M15 2 L28 15 L15 28 L2 15 Z' fill='url(%23g)' stroke='%232b1d0e' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M15 8.5 L21.5 15 L15 21.5 L8.5 15 Z' fill='%234d2f08'/%3E%3Ccircle cx='15' cy='15' r='2.2' fill='%23f2c96a'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.seam-top::before { top: -13px; transform: translateX(-50%); }
.seam-bottom::after { bottom: -13px; transform: translateX(-50%); }

/* ---- cards ---------------------------------------------------------------- */

.card {
  position: relative; color: var(--text);
  background: linear-gradient(180deg, var(--parch-4), var(--parch));
  border: 1px solid var(--leather); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.card::before, .card::after {
  content: ""; position: absolute; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2c96a, #8a5a1c 70%); box-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}
.card::before { left: 8px; } .card::after { right: 8px; }
.card h3 { color: #2b1d0e; }
.card p { color: var(--text-2); }
.card a:not(.btn) { color: var(--leather); }
.card a:not(.btn):hover { color: var(--ember); }
.card-dark a:not(.btn) { color: var(--gold-2); }
.card-dark {
  color: var(--text-light); background: linear-gradient(180deg, var(--wood-600), var(--wood-700));
  border-color: rgba(217, 164, 65, .3);
}
.card-dark p { color: var(--text-light-2); }
.card-dark h3 { color: var(--parch); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.feature-card .game-ico { width: 48px; height: 48px; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: .35em; }
.feature-card p { margin: 0; font-size: .96rem; }

/* ---- hero ----------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; min-height: min(92vh, 860px); display: flex; align-items: stretch; }
.hero-scene { position: absolute; inset: 0; }
.hero-scene svg { width: 100%; height: 100%; display: block; }
.hero-scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(20, 14, 8, .78) 0%, rgba(20, 14, 8, .45) 38%, rgba(20, 14, 8, 0) 62%),
              linear-gradient(0deg, rgba(20, 14, 8, .55), transparent 30%);
}
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; width: 100%; padding-block: 60px 90px; }
.hero h1 { color: #fff6e0; text-shadow: 0 3px 18px rgba(0, 0, 0, .55); }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lead { color: #efe2c2; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 18px; color: #e8d7ad; font-size: .92rem; display: flex; gap: 18px; flex-wrap: wrap; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-window { justify-self: end; width: min(100%, 470px); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .5)); animation: tw-float 7s ease-in-out infinite; }
.hero-window svg { width: 100%; height: auto; display: block; }
@keyframes tw-float { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-12px) rotate(.4deg); } }
@media (prefers-reduced-motion: reduce) { .hero-window { animation: none; } }
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 48px 70px; }
  .hero-window { justify-self: center; width: min(100%, 420px); }
  .hero-scene::after { background: linear-gradient(180deg, rgba(20, 14, 8, .72), rgba(20, 14, 8, .5) 50%, rgba(20, 14, 8, .75)); }
}

/* ---- trust strip ---------------------------------------------------------- */

.strip { border-block: 1px solid rgba(217, 164, 65, .2); background: rgba(12, 8, 4, .35); }
.strip .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding-block: 22px; }
.stat { display: flex; align-items: center; gap: 12px; }
.stat .game-ico { width: 40px; height: 40px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--parch); line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--text-light-2); }

/* ---- showcase ------------------------------------------------------------- */

.showcase { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.showcase-tabs { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.showcase-tab {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: var(--r); padding: 14px 16px;
  color: inherit; font: inherit; cursor: pointer; transition: background .2s, border-color .2s;
}
.showcase-tab .game-ico { width: 36px; height: 36px; }
.showcase-tab b { display: block; font-family: var(--serif); font-size: 1.12rem; color: #2b1d0e; }
.showcase-tab span { color: var(--text-2); font-size: .94rem; }
.showcase-tab[aria-selected="true"] { background: rgba(125, 81, 15, .1); border-color: rgba(125, 81, 15, .4); }
.showcase-tab:hover { background: rgba(125, 81, 15, .07); }
.showcase-stage { position: relative; min-height: 360px; }
.showcase-pane { display: none; }
.showcase-pane.on { display: block; animation: tw-fade .5s ease both; }
.showcase-pane svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(60, 35, 10, .35)); }
@keyframes tw-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .showcase { grid-template-columns: 1fr; gap: 24px; } }

/* ---- feature rows ---------------------------------------------------------- */

.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature-row + .feature-row { margin-top: clamp(56px, 8vw, 96px); }
.feature-row.flip > :first-child { order: 2; }
.feature-art svg { width: 100%; height: auto; display: block; border-radius: 14px; box-shadow: var(--shadow); }
/* The real panel, framed: it scrolls inside itself as it does in the game. */
.panel-frame { display: block; width: 100%; max-width: 540px; margin: 0 auto; border: 0; border-radius: 8px;
  background: #f4e4bc; box-shadow: var(--shadow), 0 0 0 1px rgba(43, 29, 14, .35); }
.feature-panel { position: relative; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks li .ico { color: var(--green-2); margin-top: .2em; }
.parchment .ticks li .ico { color: var(--green); }
@media (max-width: 860px) { .feature-row { grid-template-columns: 1fr; } .feature-row.flip > :first-child { order: 0; } }

/* ---- honesty block ---------------------------------------------------------- */

.oath {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  border: 1px solid rgba(217, 164, 65, .35); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(58, 39, 22, .9), rgba(28, 20, 11, .9));
}
.oath .seal { width: 110px; height: 110px; }
.oath ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--text-light-2); }
.oath li + li { margin-top: 6px; }
@media (max-width: 700px) { .oath { grid-template-columns: 1fr; text-align: center; } .oath .seal { margin: 0 auto; } .oath ul { text-align: left; } }

/* ---- pricing --------------------------------------------------------------- */

.price-card { max-width: 480px; margin: 0 auto; text-align: center; padding: 38px 32px; }
.price { font-family: var(--serif); font-size: clamp(3.2rem, 7vw, 4.6rem); line-height: 1; color: #2b1d0e; margin: 8px 0 4px; }
.price small { font-size: 1.1rem; color: var(--text-2); }
.price-card .ticks { text-align: left; margin: 24px 0 28px; }
.price-card .fine { color: var(--text-2); font-size: .86rem; margin-top: 14px; }
.wax {
  position: absolute; top: -8px; right: -25px; width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #d4523a, #8e2412 70%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 -4px 8px rgba(0, 0, 0, .25);
  display: grid; place-items: center; color: #ffe9cf; font: 700 .72rem/1.1 var(--serif); text-align: center; letter-spacing: .06em;
  transform: rotate(12deg); animation: tw-stamp .7s cubic-bezier(.2, 1.6, .4, 1) both .3s;
}
@keyframes tw-stamp { from { transform: rotate(40deg) scale(2); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wax { animation: none; } }
@media (max-width: 560px) { .wax { right: 3px; top: -5px; width: 74px; height: 74px; font-size: .64rem; } }

/* ---- FAQ ---------------------------------------------------------------------- */

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: rgba(255, 250, 235, .55); border: 1px solid rgba(125, 81, 15, .35); border-radius: var(--r); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-family: var(--serif); font-size: 1.12rem; font-weight: 700;
  display: flex; justify-content: space-between; gap: 14px; align-items: center; color: #2b1d0e;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform .2s; color: var(--leather); }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq details > div { padding: 0 20px 18px; color: var(--text-2); }

/* ---- CTA banner ------------------------------------------------------------- */

.banner {
  text-align: center; border-radius: var(--r-lg); padding: clamp(36px, 6vw, 64px) var(--gutter);
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(242, 201, 106, .18), transparent 70%),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  border: 1px solid rgba(217, 164, 65, .35);
}

/* ---- page headers ----------------------------------------------------------- */

.page-head { padding-block: clamp(56px, 8vw, 96px) clamp(36px, 5vw, 56px); text-align: center; }
.page-head .lead { margin-inline: auto; }

/* ---- forms ------------------------------------------------------------------ */

.form { display: grid; gap: 16px; }
.form > .btn { justify-self: start; }
.form > .btn-block { justify-self: stretch; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .92rem; }
.field .hint { font-size: .84rem; color: var(--text-2); }
.input, .field input:not([type]), .field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field input[type="search"], .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: #fffaf0; border: 1px solid #b9975a;
  border-radius: 8px; padding: 11px 13px;
}
.field textarea { min-height: 110px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--leather); box-shadow: 0 0 0 3px rgba(217, 164, 65, .35); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; }
.check input { margin-top: .3em; width: 18px; height: 18px; accent-color: var(--leather); flex: none; }
.auth-card { max-width: 440px; margin: 0 auto; }
.form-foot { text-align: center; font-size: .94rem; color: var(--text-2); }

.alert { border-radius: 8px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.alert .ico { margin-top: .15em; }
.alert-error { background: #f7d9cf; border: 1px solid #c77; color: #6e1d10; }
.alert-ok { background: #dcebc8; border: 1px solid #8fb36a; color: #2c4a14; }
.alert-info { background: #efe2bf; border: 1px solid #c9a86a; color: var(--text); }

/* ---- account ---------------------------------------------------------------- */

.account-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--text-2); font-size: .92rem; }
.kv dd { margin: 0; font-weight: 600; }
.license-key {
  display: flex; align-items: center; gap: 10px; font: 700 1.05rem/1 var(--mono); letter-spacing: .06em;
  background: #2b1d0e; color: var(--gold-2); border-radius: 8px; padding: 14px 16px; overflow-x: auto;
}
.license-key button { margin-left: auto; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em; background: #e3cd9b; color: var(--text);
}
.pill-ok { background: #cfe3b5; color: #2c4a14; }
.pill-warn { background: #f5dca3; color: #6b4410; }
.pill-bad { background: #f2c9bd; color: #6e1d10; }
.table-wrap { overflow-x: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #d9c18d; }
table.plain th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }

/* ---- download --------------------------------------------------------------- */

.steps { counter-reset: s; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.step::before {
  counter-increment: s; content: counter(s);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.2rem var(--serif); color: #fff4df; background: radial-gradient(circle at 35% 30%, #d4523a, #8e2412 70%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}
.step h3 { margin-bottom: .2em; }
.step p { margin: 0 0 .6em; color: var(--text-2); }

.changelog h3 { display: flex; gap: 10px; align-items: baseline; }
.changelog h3 small { font-family: var(--sans); font-size: .82rem; color: var(--text-2); font-weight: 400; }
.changelog pre { white-space: pre-wrap; font: .94rem/1.6 var(--sans); color: var(--text-2); margin: 0 0 22px; }

/* ---- prose (legal, guide) --------------------------------------------------- */

.guide-grid { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 40px; }
.guide-toc { position: sticky; top: 90px; align-self: start; }
@media (max-width: 800px) {
  .guide-grid { grid-template-columns: 1fr; gap: 20px; }
  .guide-toc { position: static; border-bottom: 1px solid #d9c18d; padding-bottom: 16px; }
}

.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.draft-note { border: 1px dashed var(--leather); border-radius: 8px; padding: 12px 14px; background: rgba(217, 164, 65, .12); color: var(--text-2); font-size: .92rem; }

/* ---- footer ------------------------------------------------------------------- */

.site-foot { background: var(--wood-950); border-top: 1px solid rgba(217, 164, 65, .2); color: var(--text-light-2); font-size: .94rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; padding-block: 52px 30px; }
.foot-grid h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--text-light); text-decoration: none; }
.foot-grid a:hover { color: var(--gold-2); }
.foot-legal { border-top: 1px solid rgba(217, 164, 65, .14); padding-block: 18px 26px; font-size: .82rem; line-height: 1.55; }
@media (max-width: 780px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---- scroll reveal ------------------------------------------------------------ */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal, .reduced .reveal { opacity: 1; transform: none; transition: none; }

/* ---- chat widget ---------------------------------------------------------------- */

.chat-launch {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 62px; height: 62px; border-radius: 50%; cursor: pointer; border: 2px solid #f2c96a;
  background: radial-gradient(circle at 35% 30%, #d4523a, #8e2412 72%); color: #fff4df;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45); display: grid; place-items: center;
  transition: transform .2s ease;
}
.chat-launch:hover { transform: scale(1.06) rotate(-4deg); }
.chat-launch .ico { width: 28px; height: 28px; }
.chat-launch .dot {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #6ccf5a; border: 2px solid var(--wood-900); display: none;
}
.chat-launch.online .dot { display: block; }
.chat-launch .count {
  position: absolute; top: -4px; left: -4px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px;
  background: var(--gold-2); color: #2b1d0e; font: 700 .78rem/22px var(--sans); text-align: center; display: none;
}
.chat-launch.unread .count { display: block; }
.chat-box {
  position: fixed; right: 20px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 61;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px));
  display: none; flex-direction: column; overflow: hidden;
  background: var(--parch); color: var(--text); border: 2px solid var(--leather); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.chat-box.open { display: flex; animation: tw-pop .22s ease both; }
@keyframes tw-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(180deg, #94621f, #6b4410); color: var(--parch);
}
.chat-head svg.mark { width: 30px; height: 30px; }
.chat-head b { font-family: var(--serif); letter-spacing: .06em; display: block; }
.chat-head small { font-size: .78rem; opacity: .9; display: flex; align-items: center; gap: 6px; }
.chat-head small i { width: 8px; height: 8px; border-radius: 50%; background: #b9a47a; display: inline-block; }
.chat-head small i.on { background: #6ccf5a; box-shadow: 0 0 0 3px rgba(108, 207, 90, .25); }
.chat-head button { margin-left: auto; background: rgba(244, 228, 188, .15); border: 0; color: var(--parch); border-radius: 8px; padding: 6px; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: .93rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg small { display: block; font-size: .72rem; opacity: .7; margin-top: 3px; }
.msg-visitor { align-self: flex-end; background: var(--leather); color: #fff4df; border-bottom-right-radius: 4px; }
.msg-agent { align-self: flex-start; background: #fffaf0; border: 1px solid #d9c18d; border-bottom-left-radius: 4px; }
.msg-system { align-self: center; background: transparent; color: var(--text-2); font-size: .8rem; font-style: italic; max-width: 100%; text-align: center; }
.chat-typing { font-size: .8rem; color: var(--text-2); padding: 0 14px 6px; min-height: 18px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #d9c18d; background: var(--parch-2); }
.chat-form textarea { flex: 1; resize: none; height: 44px; font: inherit; font-size: .94rem; border: 1px solid #b9975a; border-radius: 10px; padding: 10px; background: #fffaf0; color: var(--text); }
.chat-form button { flex: none; width: 44px; border-radius: 10px; border: 0; background: var(--ember); color: #fff4df; cursor: pointer; display: grid; place-items: center; }
.chat-intro { padding: 16px; display: grid; gap: 12px; overflow-y: auto; }
.chat-intro p { margin: 0; color: var(--text-2); font-size: .94rem; }
.chat-intro .input { padding: 9px 11px; }
@media (max-width: 480px) {
  .chat-box { right: 8px; left: 8px; width: auto; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); height: min(70vh, 540px); }
  .chat-launch { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- misc ------------------------------------------------------------------------ */

.divider { display: flex; align-items: center; gap: 14px; color: var(--gold); margin: 0 auto; max-width: 340px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.muted { color: var(--text-light-2); }
.parchment .muted, .card .muted { color: var(--text-2); }
.error-page { text-align: center; padding-block: 90px; }
.error-page .big { font: 700 clamp(4rem, 12vw, 8rem)/1 var(--serif); color: var(--gold); }
.copy-ok { color: var(--green) !important; }

/* Author display rules above would otherwise beat the `hidden` attribute. */
[hidden] { display: none !important; }
.nav-only-mobile { display: none; }
@media (max-width: 900px) { .nav-only-mobile { display: block; } }
.nav a.nav-cta { background: var(--ember); color: #fff6e6; text-align: center; font-weight: 700; margin-top: 6px; }
/* Too narrow for the brand and the buttons side by side: the buttons move
   into the menu, which already carries the same links. */
@media (max-width: 560px) {
  .head-actions .btn { display: none; }
  .brand b { font-size: 1.05rem; }
}

/* ---- confirm dialog (public pages and admin) ---------------------------------- */

.adm-dialog {
  border: 2px solid var(--leather); border-radius: 14px; padding: 22px; max-width: min(440px, calc(100vw - 32px));
  background: var(--parch); color: var(--text); box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
}
.adm-dialog::backdrop { background: rgba(20, 14, 8, .6); backdrop-filter: blur(2px); }
.adm-dialog p { margin: 0 0 18px; font-size: 1rem; }
.adm-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

