/* Avestruz — the project site. Dusk on the plain: indigo, with the purple
   Nostr is known by and the orange of a zap. No webfonts, no build step. */

:root {
  --night: #14101f;
  --night-2: #1b1629;
  --surface: #221c33;
  --line: #352c4d;
  --text: #ece8f5;
  --muted: #aaa2c0;
  --purple: #a970ff;
  --purple-2: #c9a6ff;
  --zap: #ffb347;
  --cream: #efe6d6;
  --radius: 16px;
  --wide: 72rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-2); text-underline-offset: 0.18em; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
code, kbd, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: rgb(255 255 255 / 0.07); padding: 0.1em 0.35em; border-radius: 0.35em; }
kbd { background: var(--night); border: 1px solid var(--line); border-bottom-width: 2px; padding: 0.05em 0.4em; border-radius: 0.4em; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 6px; }

/* ── The bar along the top ── */

.nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: 0.01em; }
.brand img, .footer-brand img { background: var(--cream); border-radius: 9px; padding: 3px; }
.nav nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav a:hover { color: var(--text); }
.nav .nav-gh { color: var(--text); border: 1px solid var(--line); padding: 0.3rem 0.8rem; border-radius: 999px; }

.modes { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: rgb(20 16 31 / 0.6); }
.modes[hidden] { display: none; }
.modes button {
  font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: 0.3rem 0.7rem; border-radius: 999px; cursor: pointer;
}
.modes button[aria-pressed="true"] { background: var(--purple); color: #160d26; }

/* ── The first screen ── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}
.hero-text { grid-column: 1; grid-row: 1; }
.stage { grid-column: 2; grid-row: 1; position: relative; }
.eyebrow { color: var(--purple-2); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; margin: 0 0 0.8rem; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; margin: 0 0 1.2rem; letter-spacing: -0.02em; }
.dusk { background: linear-gradient(90deg, var(--zap), #ff7d6b 45%, var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.8rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.6rem; }
.button { display: inline-block; padding: 0.7rem 1.3rem; border-radius: 999px; font-weight: 650; text-decoration: none; }
.button.primary { background: var(--purple); color: #160d26; }
.button.primary:hover { background: var(--purple-2); color: #160d26; }
.button.ghost { border: 1px solid var(--line); color: var(--text); background: rgb(20 16 31 / 0.5); }
.button.ghost:hover { border-color: var(--purple); }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; padding: 0; margin: 0; color: var(--muted); font-size: 0.92rem; }
.facts li::before { content: "✦"; color: var(--zap); margin-right: 0.45rem; font-size: 0.8em; }
.hint { display: none; }

.still { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 30px 80px rgb(0 0 0 / 0.5); }
.stage canvas, .stage-wait, .tour, .tour-strip, .stage-label { display: none; }
.stage-note { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.85rem; }

/* ── The first screen, with the scene ── */

.hifi .nav { position: absolute; inset: 0 0 auto; max-width: none; background: linear-gradient(rgb(12 8 20 / 0.75), transparent); }
.hifi .hero {
  display: block; position: relative; max-width: none; padding: 0;
  height: 100svh; min-height: 38rem; overflow: hidden; background: #0c0914;
}
.hifi .stage { position: absolute; inset: 0; }
.hifi .stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.hifi .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; box-shadow: none; transition: opacity 0.9s; }
.hifi.scene-ready .still { opacity: 0; pointer-events: none; }
.hifi.loading .stage-wait {
  display: block; position: absolute; left: 50%; bottom: 5.5rem; transform: translateX(-50%); margin: 0;
  padding: 0.4rem 1rem; border-radius: 999px; background: rgb(12 8 20 / 0.7); color: var(--muted); font-size: 0.85rem;
}
.hifi .hero-text {
  position: absolute; top: 5.5rem; left: clamp(1.5rem, 5vw, 5rem); max-width: 30rem;
  pointer-events: none; transition: opacity 0.4s;
}
/* The sky behind the words is bright where the sun went down. */
.hifi .stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity 0.4s;
  background: linear-gradient(100deg, rgb(12 8 20 / 0.8), rgb(12 8 20 / 0.55) 24%, transparent 46%);
}
.hifi .stage.touring::after { opacity: 0; }
.hifi .hero-text a { pointer-events: auto; }
.hifi h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); }
.hifi .lead { font-size: 1.05rem; color: #e2dcf0; max-width: 27rem; }
.hifi .facts { display: none; }
.hifi .hint { display: block; margin: 0; color: var(--purple-2); font-size: 0.9rem; max-width: 24rem; }
.hifi .stage.touring ~ .hero-text { opacity: 0; }
.hifi .stage.touring ~ .hero-text a { pointer-events: none; }

.hifi .stage-label {
  position: absolute; top: 0; left: 0; pointer-events: none; white-space: nowrap;
  padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 650;
  background: rgb(22 13 38 / 0.85); border: 1px solid var(--purple); color: #fff;
}
.hifi .stage-label:not([hidden]) { display: block; }

.hifi .tour-strip:not([hidden]) {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem;
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); width: min(60rem, 94vw);
}
.tour-strip button {
  font: inherit; font-size: 0.82rem; color: #ded7ef; cursor: pointer;
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid rgb(169 112 255 / 0.4); background: rgb(18 12 30 / 0.7);
  backdrop-filter: blur(6px);
}
.tour-strip button:hover { border-color: var(--purple); color: #fff; }
.tour-strip button[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #160d26; font-weight: 650; }

.hifi .tour:not([hidden]) {
  display: flex; flex-direction: column; position: absolute; top: 5.2rem; right: clamp(1rem, 3vw, 3rem);
  width: min(25rem, 92vw); max-height: calc(100% - 11rem);
  background: rgb(22 16 36 / 0.86); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
}
.tour-body { overflow-y: auto; padding: 1.4rem 1.5rem 0.6rem; }
.tour-body h3 { font-size: 1.5rem; margin: 0 0 0.6rem; line-height: 1.2; }
.tour-body p { margin: 0 0 0.8rem; color: #d6cfe6; font-size: 0.95rem; }
.tour-close {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem; border-radius: 50%;
  border: 0; background: rgb(255 255 255 / 0.08); color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.tour-nav { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem 0.8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.tour-nav button { font: inherit; font-size: 1.1rem; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 999px; width: 2.6rem; height: 2rem; cursor: pointer; }
.tour-nav button:hover, .tour-close:hover { border-color: var(--purple); background: rgb(169 112 255 / 0.2); }

/* ── Sections ── */

section { scroll-margin-top: 1rem; }
.band { background: var(--night-2); border-block: 1px solid rgb(53 44 77 / 0.5); }
.subjects, .features, .install, .security { padding: 4.5rem 1.5rem; }
.section-head, .subject-grid, .feature-grid, .install-grid, .trust-grid, .fineprint, .more { max-width: var(--wide); margin-inline: auto; }
.section-head { margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.section-head p { color: var(--muted); margin: 0; max-width: 44rem; font-size: 1.08rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.card h3 { margin: 0 0 0.45rem; font-size: 1.12rem; }
.card p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.95rem; }
.card p:last-child { margin-bottom: 0; }
.card strong, .card em { color: var(--text); }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1.1rem; }
.where { color: var(--zap); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; margin: 0 0 0.3rem; }
.card p.where { color: var(--zap); margin-bottom: 0.3rem; }
.nips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nips a { font-size: 0.75rem; font-weight: 650; text-decoration: none; color: var(--purple-2); border: 1px solid rgb(169 112 255 / 0.4); border-radius: 999px; padding: 0.1rem 0.6rem; }
.nips a:hover { background: var(--purple); color: #160d26; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1.1rem; }
.feature-grid svg { width: 2rem; height: 2rem; fill: none; stroke: var(--purple); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 0.7rem; }

.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.1rem; align-items: start; }
.code { position: relative; margin: 0.8rem 0; }
.code pre { margin: 0; padding: 0.9rem 1rem; background: var(--night); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.code code { background: none; padding: 0; }
.copy { position: absolute; top: 0.45rem; right: 0.45rem; font: inherit; font-size: 0.72rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.5rem; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--purple); }
.note, .card p.note { font-size: 0.85rem; }
.table-wrap { overflow-x: auto; margin: 0.8rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
th small { color: var(--muted); font-weight: 400; margin-left: 0.3rem; }
td a { margin-right: 0.8rem; }
.fineprint { color: var(--muted); font-size: 0.88rem; margin-top: 1.6rem; }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem; }
.trust h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.trust h3::before { content: ""; display: block; width: 2rem; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--zap), var(--purple)); margin-bottom: 0.9rem; }
.trust p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.footer { border-top: 1px solid var(--line); padding: 2.5rem 1.5rem 3rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.footer p { margin: 0.3rem 0; }
.legal { font-size: 0.8rem; opacity: 0.8; }

/* ── Narrow screens ── */

@media (max-width: 56rem) {
  .nav { flex-wrap: wrap; gap: 0.6rem 1rem; }
  .nav nav { gap: 0.9rem; flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.5rem; }
  .hero-text, .stage { grid-column: 1; grid-row: auto; }
  .hifi .hero-text { top: 9rem; }
  .hifi .lead { display: none; }
  .hifi .tour:not([hidden]) { top: auto; right: 50%; transform: translateX(50%); bottom: 6.5rem; max-height: 46%; }
  .hifi .tour-strip:not([hidden]) { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 0.3rem; }
  .tour-strip button { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
