/* Alchemy website. Dark, warm, material-first. */
:root {
  --bg: #0c0b10;
  --bg-2: #13121a;
  --panel: #191822;
  --panel-2: #201f2b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ece9f3;
  --muted: #a39fb3;
  --faint: #6f6b80;
  --gold: #ffcf6b;
  --ember: #ff7a45;
  --rose: #d9366f;
  --accent: linear-gradient(120deg, var(--gold), var(--ember) 50%, var(--rose));
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1240px;
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: 0.88em; background: rgba(255, 255, 255, 0.06); padding: 0.1em 0.4em; border-radius: 6px; }

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

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 11, 16, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 20px var(--display); letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
/* Glass buttons: translucent fill, blur, a fine rim and a soft top reflection. No color. */
.btn, .chip {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; color: var(--text); font-family: inherit; cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px -12px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
/* the reflection: a soft highlight across the upper half */
.btn::before, .chip::before {
  content: ''; position: absolute; inset: 0 0 50% 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn { padding: 11px 22px; font-weight: 600; font-size: 15px; }
.btn:hover, .chip:hover {
  text-decoration: none; color: var(--text); background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px -12px rgba(0, 0, 0, 0.85);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .chip:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
.btn.primary { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.26); }
.btn.primary:hover { background: rgba(255, 255, 255, 0.19); }
.btn.small { padding: 8px 16px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto; height: 120%;
  background:
    radial-gradient(40% 50% at 70% 30%, rgba(217, 54, 111, 0.22), transparent 70%),
    radial-gradient(35% 45% at 30% 20%, rgba(255, 160, 80, 0.18), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero .hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 600; color: var(--gold); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(44px, 6vw, 76px); line-height: 1.02; margin: 14px 0 22px; }
h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; }
h3 { font-size: 22px; line-height: 1.2; }
.lede { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 18px; }
.hero-note { font-size: 13px; color: var(--faint); }
.hero-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; transform: rotate(-4deg) scale(1.04); }
.hero-mosaic img { aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9); }
.hero-mosaic img:nth-child(3n + 2) { transform: translateY(26px); }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 64px; }
.stat { background: var(--bg-2); padding: 20px 18px; }
.stat b { display: block; font: 600 34px/1 var(--display); }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- sections ---------- */
section { padding: 96px 0; border-top: 1px solid var(--line); }
section.alt { background: var(--bg-2); }
.sec-head { max-width: 760px; margin-bottom: 44px; }
.sec-head p { color: var(--muted); font-size: 18px; margin: 16px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip { padding: 7px 15px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chip.on { color: var(--text); background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.32); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: zoom-in; }
.card .img { position: relative; aspect-ratio: 1; }
.card .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.35s; }
.card .img img.alt { opacity: 0; }
.card:hover .img img.alt { opacity: 1; }
.card .meta { padding: 10px 12px 12px; }
.card .meta b { display: block; font-size: 14px; font-weight: 600; }
.card .meta span { font-size: 12px; color: var(--faint); }
.card .tag { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); color: var(--gold); }
.hint { font-size: 13px; color: var(--faint); margin-top: 14px; }

/* parameter combos */
.combo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; margin-bottom: 22px; }
.combo-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin-bottom: 6px; }
.combo-head code { color: var(--muted); }
.combo > p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.variant { cursor: zoom-in; }
.variant img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.variant h4 { margin: 10px 0 6px; font-size: 14px; font-weight: 600; }
.params { display: flex; flex-wrap: wrap; gap: 5px; }
.param { font: 11px/1.4 var(--mono); padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.param i { font-style: normal; color: var(--gold); }

/* maps */
.maps-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; align-items: start; }
.map-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #000; }
.map-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-stage .label { position: absolute; left: 14px; bottom: 14px; font: 600 13px var(--mono); padding: 5px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.map-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.map-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; position: relative; }
.map-thumbs button.on { border-color: var(--gold); }
.map-thumbs img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.map-thumbs span { position: absolute; left: 0; right: 0; bottom: 0; font: 600 10px var(--mono); padding: 3px 5px; background: rgba(0, 0, 0, 0.65); color: var(--text); text-align: left; }
.map-list { display: grid; gap: 12px; }
.map-list div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.map-list b { font-size: 15px; }
.map-list p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* features grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 207, 107, 0.1); color: var(--gold); margin-bottom: 14px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* split blocks */
.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: center; }
.split.rev { grid-template-columns: 1.2fr 0.8fr; }
.editor-head { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.split.rev > :first-child { order: 2; }
.shot { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9); cursor: zoom-in; background: var(--panel); }
.shot img { width: 100%; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--muted); }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 12px; height: 12px; border-radius: 4px; background: var(--accent); }
.ticks b { color: var(--text); font-weight: 600; }

/* faces */
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 56px; }
.faces figure { margin: 0; }
.faces figcaption { padding: 10px 12px 12px; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* screenshot tour */
.tour { display: flex; gap: 18px; overflow-x: auto; padding: 4px max(24px, calc((100vw - var(--maxw)) / 2 + 24px)) 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tour figure { margin: 0; flex: 0 0 min(640px, 82vw); scroll-snap-align: center; cursor: zoom-in; }
.tour img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line-strong); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.tour figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.faces figcaption b { color: var(--text); display: block; font-size: 14px; }

/* tiling */
.tiling { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tile-frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-strong); aspect-ratio: 1; }
.tile-frame .tiled { position: absolute; inset: 0; background-size: 33.333% 33.333%; background-repeat: repeat; transition: background-size 0.3s; }
.tile-frame .grid-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background-image: linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px); }
.tile-frame.show-grid .grid-overlay { opacity: 1; }
.tile-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.tile-controls input[type='range'] { accent-color: var(--ember); width: 180px; }
.tile-controls label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* engines table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }
td code { font-size: 12px; }

/* library */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lib div { padding: 16px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.lib b { font-size: 15px; }
.lib b em { font-style: normal; color: var(--gold); font-family: var(--mono); font-size: 13px; margin-left: 6px; }
.lib p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* code */
pre.code { margin: 0; background: #08070b; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: #d8d4e6; }
pre.code .c { color: #6f6b80; }
pre.code .s { color: var(--gold); }
pre.code .k { color: #ff9a7a; }

/* closing */
.closing { text-align: center; padding: 110px 0; position: relative; overflow: hidden; }
.closing::before { content: ''; position: absolute; inset: 0; background: radial-gradient(50% 60% at 50% 100%, rgba(255, 255, 255, 0.05), transparent 70%); pointer-events: none; }
.closing img.logo { width: 96px; height: 96px; margin: 0 auto 24px; }
.closing p { color: var(--muted); max-width: 620px; margin: 18px auto 30px; font-size: 18px; }
.closing .hero-cta { justify-content: center; }
.req { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--faint); margin-top: 26px; }

footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--faint); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 8, 0.92); display: none; align-items: center; justify-content: center; padding: 32px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: min(1400px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox img { max-height: calc(100vh - 140px); max-width: 100%; border-radius: 12px; object-fit: contain; }
.lightbox figcaption { color: var(--muted); font-size: 14px; text-align: center; max-width: 780px; }
.lightbox figcaption b { color: var(--text); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 1000px) {
  .hero .hero-grid, .split, .split.rev, .editor-head, .maps-layout, .tiling { grid-template-columns: 1fr; }
  .split.rev > :first-child { order: 0; }
  .features, .faces { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .nav-links { display: none; }
  .hero-mosaic { transform: none; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  section { padding: 72px 0; }
  .hero { padding: 64px 0 48px; }
  .combo { padding: 18px; }
  .map-thumbs { grid-template-columns: repeat(3, 1fr); }
  .gallery, .variants, .faces { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .meta b, .variant h4 { font-size: 13px; }
  .faces figcaption { font-size: 12px; }
}

/* Grid children may shrink below their content (wide code blocks scroll instead). */
.split > *, .editor-head > *, .maps-layout > *, .tiling > *, .hero-grid > * { min-width: 0; }
