/* SuperPlacer (superplacer.io). Copyright 2024-2026 Matvei Khamidulin. All Rights Reserved. */
/* The site's main page (Site/README.md): its styles. The sections' spacing, texts, sizes and lines come from the site's
   config (page/page.js sets them as custom properties). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0a0a0b;
  --bg-card:    #111113;
  --border:     #1e1e22;
  --border-hi:  #2e2e34;
  --text:       #e8e8ea;
  --muted:      #8d8d93;
  --faint:      #5a5a64;
  --accent:     #FFC400;
  --accent-dim: #d9a700;
  --accent-bg:  rgba(255,196,0,0.08);
  --font-mono:  'DM Mono', monospace;
  --font-sans:  'DM Sans', sans-serif;
  --max-w:      min(80vw, 1400px);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap { max-width: var(--max-w); margin: 0 auto; }

/* ── NAV ──────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,11,0.90);
  backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 40px; width: auto; }

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.08em;
}

.nav-right { display: flex; align-items: center; gap: 20px; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--accent); }

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-sm { font-size: 11px; padding: 7px 16px; }
.btn-lg { font-size: 13px; padding: 15px 30px; }

.btn-primary { background: var(--accent); color: #0a0a0b; border: 1px solid var(--accent); }
a.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); transform: translateY(-2px); }

/* The Fab listing is not live yet: the button only announces it. */
.btn-primary.is-soon { background: transparent; color: var(--accent); border-color: rgba(255,196,0,0.45); cursor: default; }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-hi); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── SECTIONS: page/page.js puts them in the config's order; each — the space above its content (--top), the content
   (.sec-in), the space below it (--bottom), the line below the section (.sec-line: its look comes from the config) ── */
.sec { position: relative; padding-top: var(--top, 64px); }
.sec[hidden] { display: none; }
.sec-in { padding-bottom: var(--bottom, 64px); }
.sec-line { height: 1px; margin: 0 auto; background: var(--border); }
.sec-line[hidden] { display: none; }

/* a section's heading and caption (the alignment: --align) */
.sec-title {
  font-size: clamp(20px, 6vw, var(--title-size, 32px));
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-align: var(--align, center);
  margin-bottom: var(--title-gap, 28px);
}

.sec-title strong { font-weight: 500; }

.sec-caption {
  margin-top: var(--caption-gap, 18px);
  font-size: var(--caption-size, 16px);
  line-height: 1.5;
  color: var(--muted);
  text-align: var(--align, center);
}

.sec-title[hidden], .sec-caption[hidden] { display: none; }

/* ── SANDBOX: the first screen — SuperPlacer over the stock editor, WebGL (hero/), the full width of the window: its
   coordinate grid runs out to the screen's edges. The poster stays when there is no WebGL. data-sandbox="off" on
   #heroScene — the demo only. index.html?dev opens the dev panel. ── */
.sec-sandbox { width: 100%; }

.scene {
  position: relative;
  height: min(var(--scene-h, 860px), calc(100vh - 64px));
  min-height: 320px;
  background: var(--bg) url('../hero/assets/poster.jpg') center / contain no-repeat;
  animation: fadeUp 0.5s ease backwards;
}

.scene.is-live { background-image: none; }

/* ── VIDEO DEMONSTRATION: the video as wide as the config says (% of the column), placed by the alignment ── */
.demo-player { --player-w: var(--video-w, 100%); margin: 0 auto; }
.sec[data-align="left"] .demo-player { margin-left: 0; }
.sec[data-align="right"] .demo-player { margin-right: 0; }

/* ── FEATURES: the player of their clips ─────────── */
/* As wide as the column, as high as the screen leaves it (--player-w: the script fits the block to one screen). Two
   videos: the one on screen and the next clip loading behind it, they cross-fade. */
.player {
  position: relative;
  width: var(--player-w, 100%);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background: #000;
  cursor: pointer;
  animation: fadeUp 0.5s 0.05s ease backwards;
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.player video.is-on { opacity: 1; }

.player-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.player.is-paused .player-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.player-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.player-missing[hidden] { display: none; }

/* the clip's progress */
.player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
}

.player-track { position: relative; width: 100%; height: 3px; background: rgba(255,255,255,0.14); transition: height 0.15s; pointer-events: none; }
.player-bar:hover .player-track { height: 6px; }
.player-fill { height: 100%; width: 0%; background: var(--accent); }

/* ── A PHRASE BETWEEN THE SECTIONS (an insert: the dev panel adds them) ── */
.phrase-text {
  max-width: min(100%, var(--phrase-w, 980px));
  margin: 0 auto;
  font-size: clamp(22px, 5.5vw, var(--phrase-size, 44px));
  font-weight: var(--phrase-weight, 300);
  font-style: var(--phrase-style, normal);
  color: var(--phrase-color, var(--text));
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: var(--align, center);
}

.phrase-text strong { font-weight: 500; color: var(--phrase-accent, var(--accent)); }
.phrase-text[hidden] { display: none; }
.sec[data-align="left"] .phrase-text { margin-left: 0; }
.sec[data-align="right"] .phrase-text { margin-right: 0; }

/* ── THE LOGO AND A FEW WORDS (the alignment: --align, data-align) ── */
.sec-about .sec-in { text-align: var(--align, center); }

.about-logo { display: block; height: var(--logo-h, 56px); width: auto; margin: 0 auto var(--logo-gap, 26px); }
.sec[data-align="left"] .about-logo { margin-left: 0; }
.sec[data-align="right"] .about-logo { margin-right: 0; }

.about-text {
  font-size: clamp(22px, 6vw, var(--text-size, 40px));
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 18px;
}

.about-text strong { font-weight: 500; }

.about-lead { max-width: 760px; margin: 0 auto 14px; font-size: var(--lead-size, 19px); color: var(--muted); }
.sec[data-align="left"] .about-lead { margin-left: 0; }
.sec[data-align="right"] .about-lead { margin-right: 0; }

.about-tagline { font-size: var(--tagline-size, 20px); font-style: italic; color: var(--faint); margin-top: 26px; }

.about-logo[hidden], .about-text[hidden], .about-lead[hidden], .about-tagline[hidden] { display: none; }

/* ── FAB: the button (the soon text until the listing is live), the documentation, Discord and X ── */
.sec-fab .sec-in { text-align: center; }

.cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.cta-row + .social-row { margin-top: 44px; }
.cta-row [hidden], .social-row[hidden] { display: none; }

.social-row { display: flex; align-items: center; justify-content: center; gap: 28px; }

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}

.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover { color: var(--accent); }

/* ── FEATURES: the names, the player, what plays — one screen ── */
.features-in { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* the names only, in the order of the old groups: a dense table — rows of cells as wide as their names, every row
   justified to the full width, hairlines between the cells (the table's colour shows through the 1px gaps); the
   last row keeps its cells at their size (the filler takes the rest) */
.feat-table {
  align-self: stretch;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.feat-table::after { content: ''; flex: 1000 1 0; background: var(--bg); }

.feat {
  position: relative;
  flex: 1 1 auto;
  padding: 6px 14px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

/* a feature with a clip: a click plays it */
.feat.has-clip { cursor: pointer; }
.feat.has-clip:hover { color: var(--text); background-color: var(--bg-card); }
.feat.has-clip:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

/* the feature that plays: its name lit, the clip's progress along its top */
.feat.is-now { color: var(--accent); background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--bg); }
.feat.is-now::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: calc(var(--p, 0) * 100%);
  background: var(--accent);
}

/* under the video, what plays: the feature, its description, its page */
.feat-caption {
  width: var(--player-w, 100%);
  max-width: 100%;
  min-height: 3em;            /* two lines: the player keeps its size when the text changes */
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.feat-caption-name { color: var(--text); font-weight: 500; }
.feat-caption-name:not(:empty)::after { content: ' \2014  '; color: var(--faint); font-weight: 400; }

.feat-caption-doc {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.feat-caption-doc:hover { color: var(--accent); }
.feat-caption-doc[hidden] { display: none; }

/* ── FOOTER ───────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 28px 0; }

.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.footer-copy { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }

.footer-links { display: flex; align-items: center; gap: 20px; }

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

.footer-social { display: flex; align-items: center; gap: 18px; }
.footer-social a { display: inline-flex; }
.footer-social svg { width: 16px; height: 16px; fill: currentColor; }

/* ── ANIM ─────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
  :root { --max-w: calc(100vw - 32px); }
  .nav-logo img { height: 30px; }
  .nav-right { gap: 12px; }
  .nav-right .btn-sm { display: none; }   /* the hero has the same button */
  .about-text br { display: none; }
  .features-in { gap: 14px; }
  .feat { font-size: 13px; padding: 5px 9px; }
  .feat-caption { font-size: 14px; min-height: 6em; }
}
