/* Shared look for the landing page and the tutorials (/learn/).
   Colours are the app's own themes (site/themes.js, generated from
   src/theme.js); the defaults below are Ultra dark, the public pages'
   default theme, so nothing flashes before site.js runs. */
:root {
  --bg: #000000;
  --panel-bg: #111111;
  --ink: #eaeaea;
  --ink-light: #8f8f8f;
  --accent: #7c9cff;
  --accent-light: rgba(124, 156, 255, 0.18);
  --border: #262626;
  --white: #151515;
  --on-accent: #000;
  --theme-gradient: radial-gradient(ellipse 75% 55% at 10% -10%, color-mix(in srgb, #7c9cff 26%, transparent), transparent 60%),
    radial-gradient(ellipse 70% 60% at 105% 105%, color-mix(in srgb, #111111 70%, transparent), transparent 62%),
    linear-gradient(160deg, #000000 0%, color-mix(in srgb, #000000 80%, #7c9cff 20%) 100%);
  --ring-tint: white;
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --glass-shade: rgba(0, 0, 0, 0.45);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glass: color-mix(in srgb, var(--white) 62%, transparent);
  --glass-strong: color-mix(in srgb, var(--white) 80%, transparent);
  --tint: color-mix(in srgb, var(--ink) 6%, transparent);
  --glass-ring: inset 1px 1px 1.5px var(--glass-highlight), inset -1px -1px 1.5px var(--glass-shade),
    inset 0 0 0 1px color-mix(in srgb, var(--bg) 72%, var(--ring-tint) 28%), var(--shadow);
  --max: 1120px;
  --bar-h: 64px;
  color-scheme: dark;
}
:root.is-light {
  --glass-highlight: rgba(255, 255, 255, 0.6);
  --glass-shade: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 24px rgba(43, 38, 33, 0.1);
  --shadow-lg: 0 24px 64px rgba(43, 38, 33, 0.2);
  color-scheme: light;
}
:root.theme-white-black { --ring-tint: black; --glass-highlight: rgba(0, 0, 0, 0.22); --glass-shade: rgba(255, 255, 255, 0.45); }

* { box-sizing: border-box; }
html { background-color: var(--bg); scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
/* In-page links ("See how it works ↓") glide to their section instead of jumping (2026-10-25). */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background-color: var(--bg);
  background-image: var(--theme-gradient);
  background-attachment: fixed;
  background-size: cover;
  overflow-x: hidden;
}
:root.has-pattern body { background-size: var(--pattern-size, cover); }
:root.theme-fading body, :root.theme-fading .bar, :root.theme-fading .glass {
  transition: background-color 0.45s ease, color 0.45s ease;
}
a { color: var(--accent); }
a:hover { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-light); }
.glass {
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: var(--glass-ring);
  border-radius: 22px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: none;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { color: var(--on-accent); filter: brightness(1.08); transform: translateY(-1px); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.05rem; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px; background: var(--accent-light); color: var(--accent); }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 20; height: var(--bar-h);
  background-color: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}
.bar .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink-light); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a.current { color: var(--ink); }
.nav a.current { font-weight: 600; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; border: none; background: var(--tint); color: var(--ink);
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.theme-btn:hover { background: var(--accent-light); }
.theme-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 60%, var(--ink) 40%); flex: none; }
.theme-btn .cycle { opacity: 0.6; }
.menu-btn { display: none; }
.menu {
  display: none; position: absolute; top: calc(var(--bar-h) - 6px); right: 16px; min-width: 200px; padding: 8px;
  flex-direction: column; z-index: 30;
}
.menu.open { display: flex; }
.menu a { padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.menu a:hover { background: var(--tint); }

/* Sections */
section { padding: 56px 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; padding: 80px 0 56px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; margin: 0 0 18px; }
.hero .lead { font-size: 1.15rem; color: var(--ink-light); margin: 0 0 26px; max-width: 34em; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-actions a.link { font-weight: 600; text-decoration: none; }
.small { font-size: 0.88rem; color: var(--ink-light); margin: 14px 0 0; }
.shot { border-radius: 18px; overflow: hidden; box-shadow: var(--glass-ring), var(--shadow-lg); background: var(--panel-bg); }
.shot img { width: 100%; }
.center { text-align: center; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin: 0 0 22px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 20px 22px; }
.tile b { display: block; font-size: 1.05rem; }
.tile span { color: var(--ink-light); font-size: 0.95rem; }
.row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 40px 0; }
.row.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.row.flip .shot { order: 2; }
.row h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin: 8px 0 12px; }
.row p { color: var(--ink-light); font-size: 1.05rem; margin: 0 0 14px; }
.row ul, .plan ul { margin: 0; padding-left: 20px; line-height: 1.85; }
.also { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.also .tile { padding: 16px 18px; }

.ai-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px 44px; }
.ai-card h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin: 12px 0 10px; }
.ai-card p { color: var(--ink-light); font-size: 1.05rem; margin: 0 0 12px; }
.fix-sample { padding: 20px 22px; border-radius: 16px; background: var(--tint); font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; line-height: 1.75; }
.fix-sample del { color: #e5534b; text-decoration-thickness: 2px; }
.fix-sample ins { text-decoration: none; background: var(--accent-light); border-radius: 4px; padding: 0 2px; }

/* Themes section */
.themes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: start; }
.themes h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin: 8px 0 12px; }
.themes > div > p { color: var(--ink-light); font-size: 1.05rem; margin: 0 0 18px; }
.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.point { padding: 14px 16px; border-radius: 16px; background: var(--tint); }
.point > b { display: block; font-size: 0.98rem; }
.point > span { color: var(--ink-light); font-size: 0.92rem; line-height: 1.45; display: block; margin-top: 2px; }
.point.own > span:last-child { color: var(--ink); margin-top: 0; }
.point.own { grid-column: 1 / -1; background: var(--accent-light); display: flex; gap: 12px; align-items: center; }
.point.own .tag { background: var(--glass-strong); flex: none; }
.picker { padding: 18px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; scrollbar-width: thin; }
.cat { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: none; background: var(--tint); color: var(--ink); font: inherit; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.cat[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.swatch { border: none; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; text-align: left; font: inherit; background: var(--tint); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent); transition: transform 0.15s ease; }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.swatch i { display: flex; align-items: flex-end; height: 58px; padding: 8px; }
.swatch i::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--sw-accent); }
.swatch span { display: block; padding: 6px 10px 8px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-note { margin: 12px 2px 0; font-size: 0.85rem; color: var(--ink-light); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plan { padding: 30px; }
.plan h3 { margin: 0 0 4px; font-size: 1.35rem; }
.plan .price { font-size: 1.9rem; font-weight: 800; }
.plan .price small { font-size: 0.95rem; font-weight: 400; color: var(--ink-light); }
.plan.pro { box-shadow: inset 0 0 0 2px var(--accent), var(--glass-ring); }
.plan .btn { margin-top: 18px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card-link { display: block; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform 0.15s ease; }
.card-link:hover { color: var(--ink); transform: translateY(-2px); }
.card-link .thumb { aspect-ratio: 16 / 9; background: var(--panel-bg); overflow: hidden; }
.card-link .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card-link .body { padding: 16px 18px 20px; }
.card-link h3 { font-size: 1.05rem; margin: 6px 0 4px; }
.card-link p { margin: 0; font-size: 0.93rem; color: var(--ink-light); line-height: 1.5; }
.card-link .meta { margin-top: 8px; font-size: 0.82rem; color: var(--ink-light); }
.head-row { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.head-row h2 { margin: 0; margin-right: auto; }
.final h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin: 0 0 22px; }

footer.foot { padding: 28px 0 44px; color: var(--ink-light); font-size: 0.9rem; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer.foot .wrap > span { margin-right: auto; }
footer.foot a { color: var(--ink-light); text-decoration: none; }
footer.foot a:hover { color: var(--ink); }

/* Tutorials */
.page-head { padding: 56px 0 26px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 8px; }
.page-head p { margin: 0; font-size: 1.1rem; color: var(--ink-light); }
.article { max-width: 760px; margin: 40px auto 0; padding: 40px clamp(20px, 5vw, 48px) 44px; overflow-wrap: break-word; }
.crumb { font-size: 0.9rem; color: var(--ink-light); }
.crumb a { text-decoration: none; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 800; margin: 12px 0 10px; }
.article .meta { font-size: 0.9rem; color: var(--ink-light); margin: 0 0 22px; }
.article .intro { font-size: 1.15rem; line-height: 1.7; }
.article p, .article li { font-size: 1.05rem; line-height: 1.75; }
.article h2 { font-size: 1.5rem; margin: 36px 0 10px; }
.article h3 { font-size: 1.15rem; margin: 26px 0 8px; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 4px 0; }
.article figure { margin: 24px 0; }
.article figure .shot { box-shadow: var(--glass-ring); }
.article figcaption { font-size: 0.88rem; color: var(--ink-light); text-align: center; margin-top: 8px; }
.tip { margin: 22px 0; padding: 16px 20px; border-radius: 14px; background: var(--accent-light); }
.tip p { margin: 0; font-size: 1rem; }
.tip b:first-child { color: var(--accent); }
.script {
  margin: 22px 0; padding: 22px 24px; border-radius: 14px; background: var(--tint); overflow-x: auto;
  font-family: "Courier Prime", "Courier New", Courier, monospace; font-size: 0.95rem; line-height: 1.55; white-space: pre;
}
.article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.97rem; display: block; overflow-x: auto; }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); vertical-align: top; }
.article th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-light); }
.try { margin: 36px 0 4px; padding: 24px 26px; border-radius: 20px; background: var(--glass-strong); box-shadow: inset 0 0 0 2px var(--accent); display: flex; align-items: center; gap: 20px; }
.try div { flex: 1; min-width: 0; }
.try b { display: block; font-size: 1.15rem; }
.try span { color: var(--ink-light); font-size: 0.95rem; }
.more { max-width: 760px; margin: 34px auto 0; }
.more h2 { font-size: 1.35rem; margin: 0 0 14px; }

/* Narrower screens */
@media (max-width: 980px) {
  .hero, .row, .row.flip, .ai-card, .themes { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .row.flip .shot { order: 0; }
  .hero { padding-top: 48px; }
  .also { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; border: none; background: var(--tint); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
  .theme-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .theme-btn .label, .theme-btn .cycle { display: none; }
  .theme-btn .theme-dot { width: 18px; height: 18px; }
  .bar .wrap { gap: 8px; }
  .bar .btn { min-height: 44px; padding: 0 14px; font-size: 0.9rem; }
  .bar .btn .long { display: none; }
  .wrap { padding: 0 16px; }
  section { padding: 36px 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .plans, .cards, .points { grid-template-columns: minmax(0, 1fr); }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-card { padding: 24px 20px; }
  .hero-actions .btn { width: 100%; }
  .try { flex-direction: column; align-items: stretch; text-align: left; }
  .article { margin-top: 20px; border-radius: 18px; }
  .head-row { flex-wrap: wrap; }
}
@media (max-width: 400px) {
  .also { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 1.02rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Language menu + "also in …" note (2026-10-26, multilingual). */
.lang-wrap { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px; border: none; background: var(--tint); color: var(--ink);
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.lang-btn:hover { background: var(--accent-light); }
.lang-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; padding: 8px;
  flex-direction: column; z-index: 40;
}
.lang-menu.open { display: flex; }
.lang-menu a, .menu-langs a { padding: 10px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.lang-menu a:hover, .menu-langs a:hover { background: var(--tint); }
.lang-menu a.current, .menu-langs a.current { background: var(--accent-light); font-weight: 600; }
.menu-langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line, rgba(127,127,127,.2)); margin-top: 6px; padding-top: 8px; }
.menu-langs span { grid-column: 1 / -1; font-size: 0.8rem; color: var(--ink-light); padding: 4px 14px; }
.menu-langs a { min-height: 44px; display: flex; align-items: center; }
.lang-note {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px; max-width: calc(100vw - 48px); box-sizing: border-box;
}
.lang-note span { font-size: 0.95rem; }
.lang-note .btn { min-height: 40px; white-space: nowrap; }
.lang-note-close { width: 40px; height: 40px; flex: none; border: none; border-radius: 50%; background: var(--tint); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 760px) {
  .lang-wrap { display: none; }
  .lang-note { left: 16px; right: 16px; bottom: 16px; border-radius: 22px; flex-wrap: wrap; padding: 12px; }
  .lang-note span { flex: 1 1 100%; }
  .lang-note .btn { min-height: 44px; flex: 1; justify-content: center; }
  .lang-note-close { width: 44px; height: 44px; }
}
