/* eslabs.me shared brand tokens + base components
   Palette: Warm Hearth (night default, "Warm Paper" for day) · Fonts: Space Grotesk + Inter + JetBrains Mono
   Atmosphere: giant ghost ME + glass · Icons: centered ghost ME
   Per-app: set ONE class on <body> (e.g. app-gather) or override --app-1/--app-2
   Theme: <html data-theme="dark|light">, set by the head snippet + theme.js (see landing-template.html) */

:root {
  /* surfaces (night) */
  --bg: #1a1512;
  --surface: #272019;
  --surface-2: #322a21;
  --border: #3d332a;
  --text: #f6efe4;
  --muted: #b3a595;

  /* brand signature (same in both themes) */
  --brand-1: #ffb347;   /* amber */
  --brand-2: #ff6b4a;   /* coral */
  --brand: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --on-brand: #1a1512;

  /* text-safe accent + link colors (darkened in day mode for contrast) */
  --accent-text: var(--app-1);
  --link: #ffb347;
  --ok: #7bd8b0;

  /* atmosphere + glass */
  --ghost-ink: #fff;
  --ghost-opacity: .05;
  --stripe: rgba(255, 255, 255, .025);
  --glass-bg: rgba(255, 255, 255, .05);
  --glass-border: rgba(255, 255, 255, .12);
  --shadow: 0 14px 40px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(255, 179, 71, .25), 0 10px 40px rgba(255, 107, 74, .18);

  /* app hues (same saturation family) */
  --hue-orange: #ff8a5b;
  --hue-gold: #ffc857;
  --hue-sage: #7bd8b0;
  --hue-sky: #8ab4ff;
  --app-1: var(--brand-1);   /* overridden per app */
  --app-2: var(--brand-2);
  --app: linear-gradient(145deg, var(--app-1), var(--app-2));

  /* type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  /* shape + space */
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 40px; --s-7: 72px;
  --max: 1080px;
  color-scheme: dark;
}

/* day mode: "Warm Paper". Same hues, cream surfaces, darker text accents */
:root[data-theme="light"] {
  --bg: #fbf6ee;
  --surface: #fffdf9;
  --surface-2: #f3eadc;
  --border: #e6d9c6;
  --text: #2a211a;
  --muted: #6f6050;
  --accent-text: #b4530a;
  --link: #b4530a;
  --ok: #1f8a62;
  --brand-text: linear-gradient(135deg, #d97706, #e0442a); /* deeper amber→coral so headline gradient reads on cream */
  --ghost-ink: #2a211a;
  --ghost-opacity: .045;
  --stripe: rgba(42, 33, 26, .035);
  --glass-bg: rgba(255, 255, 255, .6);
  --glass-border: rgba(42, 33, 26, .1);
  --shadow: 0 14px 40px rgba(120, 80, 30, .14);
  --glow: 0 0 0 1px rgba(255, 107, 74, .25), 0 10px 30px rgba(255, 107, 74, .22);
  color-scheme: light;
}

/* per-app accents: pick one on <body> */
.app-gather { --app-1: #ffc857; --app-2: #ff6b4a; }
.app-rpg    { --app-1: #ff8a5b; --app-2: #c2410c; }
.app-sage   { --app-1: #7bd8b0; --app-2: #2f9e8a; }
.app-sky    { --app-1: #8ab4ff; --app-2: #4b6cf0; }
.app-map    { --app-1: #7bd8b0; --app-2: #4b6cf0; } /* My RPGMap Me: land to sea (app-rpg belongs to My RPG Me) */
/* --app is built from --app-1/--app-2, so it must be resolved where the app class sets them
   (a var() in :root is resolved at :root and would ignore the body's class) */
.app-gather, .app-rpg, .app-sage, .app-sky, .app-map { --app: linear-gradient(145deg, var(--app-1), var(--app-2)); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 var(--s-3); }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 var(--s-4); }
.muted { color: var(--muted); }
.kicker { font: 600 .8rem var(--font-mono); color: var(--accent-text); letter-spacing: .02em; margin-bottom: var(--s-3); display: block; }
.kicker::before { content: "// "; opacity: .6; }
.grad-text { background: var(--brand-text, var(--brand));-webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
section { padding-block: var(--s-7); position: relative; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 6px; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding-block: var(--s-4); gap: var(--s-3); }
.nav-right { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--text); font: 600 1.15rem var(--font-mono); }
.brand i { font-style: normal; color: var(--muted); }
.nav a.link { color: var(--muted); text-decoration: none; margin-right: var(--s-5); font-weight: 500; }
.nav a.link:hover { color: var(--text); }

/* day/night toggle */
.theme-toggle { width: 42px; height: 42px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--brand-2); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: var(--s-2); padding: 14px 26px; border-radius: var(--r-pill);
  font: 600 1rem var(--font-display); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand-2); }

/* store buttons (iOS / Android). Live = <a class="btn btn-store">; not released = <span class="btn btn-store is-soon" aria-disabled="true"> */
.btn-store { background: var(--surface); color: var(--text); border-color: var(--border); padding: 10px 20px; line-height: 1.15; text-align: left; }
.btn-store svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-store small { display: block; font: 500 .68rem var(--font-mono); opacity: .75; letter-spacing: .02em; }
.btn-store b { font: 600 .98rem var(--font-display); }
a.btn-store:hover { border-color: var(--brand-2); }
.btn-store.is-soon { opacity: .5; filter: grayscale(1); cursor: not-allowed; border-style: dashed; user-select: none; }
.btn-store.is-soon:hover { transform: none; border-color: var(--border); filter: grayscale(1); }

/* atmosphere: giant ghost ME + faint stripes */
.ghost-me { position: relative; overflow: hidden; isolation: isolate; }
.ghost-me::before { /* diagonal stripes */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--stripe) 14px 15px);
}
.ghost-me::after { /* giant ME */
  content: "ME"; position: absolute; z-index: -1; right: -2vw; top: -.1em;
  font: 700 clamp(220px, 34vw, 460px)/1 var(--font-display); letter-spacing: -.06em;
  color: var(--ghost-ink); opacity: var(--ghost-opacity); pointer-events: none; user-select: none;
}
.ghost-me.left::after { right: auto; left: -2vw; }

/* glass card */
.glass { background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: var(--s-5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.term { font: .9rem/1.7 var(--font-mono); }
.term .ok { color: var(--ok); } .term .cmd { color: var(--accent-text); }

/* hero */
.hero { display: grid; gap: var(--s-6); grid-template-columns: 1.1fr .9fr; align-items: center; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.cta-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-5); }
.app-icon { width: 84px; height: 84px; margin-bottom: var(--s-4); filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .3)); }
.hero-art { position: relative; }
.hero-art .scratch { width: 150px; position: absolute; right: -6px; bottom: -34px; }

/* features */
.cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--app); display: grid; place-items: center; margin-bottom: var(--s-4); }
.card .ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* screenshots */
.shots { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.shot { border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); aspect-ratio: 16/10; display: grid; place-items: center; color: var(--muted); font: .85rem var(--font-mono); overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }

/* faq */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); }
.faq summary { cursor: pointer; font: 600 1.05rem var(--font-display); list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--accent-text); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: var(--s-3) 0 0; color: var(--muted); }

/* cta + footer */
.cta { text-align: center; }
.cta .glass { padding: var(--s-6) var(--s-5); }
footer { border-top: 1px solid var(--border); padding-block: var(--s-5); color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); }
footer .mono { font-family: var(--font-mono); }
.foot-brand { color: var(--text); text-decoration: none; font-weight: 600; }
.foot-brand:hover { color: var(--accent-text); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art .scratch { width: 110px; bottom: -28px; }
  section { padding-block: var(--s-6); }
  .nav a.link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } .btn:hover { transform: none; } body { transition: none; }
}
