/* =============================================================
   LeskoAudio — site styles
   Every page uses the same reading column, header and footer.
   Plain CSS, no framework.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg:          #0a0c10;
  --bg-elev:     #0e1116;
  --surface:     #13171e;
  --surface-2:   #181d26;
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);

  --text:    #eceef2;
  --body:    #d7dbe2;
  --muted:   #9aa2ad;
  --muted-2: #6b727d;

  --accent:   #4f9dff;
  --accent-2: #25d4ee;

  --radius: 10px;
  --col:    45.5rem;  /* the reading column, about 68 characters of body text */

  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(900px 600px at 80% -10%, rgba(79, 157, 255, 0.08), transparent 60%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }
sub { line-height: 0; }  /* V_RMS subscripts shouldn't open up the line spacing */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  background: var(--accent);
  color: #04101f;
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Links that leave the site get an arrow */
.nav-links a[href^="http"]::after,
.nb-list a[href^="http"]::after { content: "\2009\2197"; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  width: min(var(--col), 100% - 2rem);
  margin-inline: auto;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}
.brand { display: inline-flex; }
.brand img { height: 28px; width: auto; opacity: 0.96; }
.brand:hover img { opacity: 1; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 -0.6rem 0 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }

@media (max-width: 560px) {
  .site-header { position: static; }
  .nav { padding: 0.9rem 0 0.4rem; }
  .nav > nav { width: 100%; }
  .nav-links { margin: 0 0 0 -0.6rem; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-row {
  width: min(var(--col), 100% - 2rem);
  margin-inline: auto;
  padding: 1.6rem 0 2.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.4rem;
  color: var(--muted-2);
  font-size: 0.9rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Reading column (every page) ---------- */
.notebook {
  width: min(var(--col), 100% - 2rem);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
  color: var(--body);
  font-size: 1.06rem;
  line-height: 1.7;
}
.notebook > * + *,
.notebook section > * + * { margin-top: 1.1rem; }
.notebook h1 { font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.15; margin: 0; color: var(--text); }
.notebook h2 { font-size: 1.35rem; margin-top: 2.6rem; color: var(--text); }
.notebook a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.notebook a:hover { color: var(--accent-2); }
.notebook h2 a { color: inherit; text-decoration: none; }
.notebook h2 a:hover { color: var(--accent); }
.notebook strong { color: var(--text); font-weight: 600; }
.notebook code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}
.notebook pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  font-size: 0.84rem;
  line-height: 1.55;
}
.notebook pre code { padding: 0; background: none; font-size: inherit; color: #c9d1dc; }
.notebook ul:not(.nb-list), .notebook ol { padding-left: 1.3rem; }
.notebook ul:not(.nb-list) li + li, .notebook ol li + li { margin-top: 0.35rem; }

.nb-lead { font-size: 1.16rem; color: var(--text); }
.notebook h1 + .nb-lead { margin-top: 1.4rem; }

/* Figures */
.nb-figure { margin: 2rem 0; }
.nb-figure img {
  width: 100%;
  height: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.nb-figure figcaption { margin-top: 0.7rem; color: var(--muted-2); font-size: 0.88rem; line-height: 1.5; }
/* Tall renders: cap the width (set per image in --fig-w) and let the height follow the aspect ratio */
.nb-figure-tall img { width: min(100%, var(--fig-w, 100%)); height: auto; margin: 0 auto; }

/* Dated lists: the Forge log, Writing, and the home page */
.nb-list { list-style: none; margin: 0.9rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.nb-list li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.2rem 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.nb-list time { color: var(--muted-2); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.notebook .nb-list a { font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; color: var(--text); text-decoration: none; }
.notebook .nb-list a:hover { color: var(--accent); }
.nb-list p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.96rem; line-height: 1.55; }
.nb-list .nb-src { color: var(--muted-2); font-size: 0.88rem; }
@media (max-width: 560px) { .nb-list li { grid-template-columns: 1fr; } }

/* A single note */
.nb-crumb { font-size: 0.9rem; color: var(--muted-2); }
.notebook .nb-crumb a { color: var(--muted); text-decoration: none; }
.notebook .nb-crumb a:hover { color: var(--accent); }
.note h1 { margin-top: 0.6rem; }
.nb-meta { color: var(--muted-2); font-size: 0.92rem; }
.notebook h1 + .nb-meta { margin-top: 0.5rem; }
.nb-aside { padding-left: 1rem; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 0.98rem; }

/* A set of posts on one prototype */
.nb-series {
  margin-top: 1.6rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  font-size: 0.94rem;
}
.nb-series-title { margin: 0 0 0.4rem; color: var(--muted-2); font-size: 0.86rem; }
.notebook .nb-series-title a { color: var(--muted); text-decoration: none; font-weight: 600; }
.notebook .nb-series ol { margin: 0; padding-left: 1.4rem; color: var(--muted-2); }
.notebook .nb-series li + li { margin-top: 0.2rem; }
.notebook .nb-series a { color: var(--muted); text-decoration: none; }
.notebook .nb-series a:hover { color: var(--accent); }
.nb-series li[aria-current="page"] { color: var(--text); font-weight: 500; }

.nb-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.notebook .nb-pager a { text-decoration: none; color: var(--text); font-family: var(--font-head); font-weight: 600; line-height: 1.35; }
.notebook .nb-pager a:hover { color: var(--accent); }
.nb-pager a span { display: block; margin-bottom: 0.2rem; color: var(--muted-2); font-family: var(--font-body); font-size: 0.82rem; font-weight: 400; }
.nb-pager a[rel="next"] { text-align: right; grid-column: 2; }

/* Project page: posts grouped by prototype */
.nb-bundle { margin-top: 1.4rem; }
.notebook .nb-bundle h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.nb-bundle-meta { margin: 0.3rem 0 0; color: var(--muted-2); font-size: 0.9rem; }

/* ---------- Tables ---------- */
.spec-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.notebook .spec-wrap { margin-top: 1.2rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.spec-table th, .spec-table td { text-align: left; padding: 0.75rem 1rem; vertical-align: top; }
.spec-table thead th {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}
.spec-table tbody tr + tr { border-top: 1px solid var(--line); }
.spec-table tbody th { font-weight: 500; color: var(--text); }
.spec-table tbody td { color: var(--muted); }
.spec-table.targets tbody th { width: 22%; }
.spec-table.short-keys th:first-child { white-space: nowrap; }
.notebook .spec-wrap + .nb-note { margin-top: 0.6rem; color: var(--muted-2); font-size: 0.88rem; }
@media (max-width: 620px) {
  .spec-table { font-size: 0.86rem; }
  .spec-table th, .spec-table td { padding: 0.65rem 0.7rem; }
  .spec-table.targets thead { display: none; }
  .spec-table.targets, .spec-table.targets tbody, .spec-table.targets tr,
  .spec-table.targets th, .spec-table.targets td { display: block; width: auto !important; }
  .spec-table.targets tbody tr { padding: 0.8rem 1rem; }
  .spec-table.targets tbody th, .spec-table.targets tbody td { padding: 0; }
  .spec-table.targets tbody th { margin-bottom: 0.25rem; }
}

/* ---------- Home: landing ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: clip;  /* the glows may spill down into the content, never sideways */
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(79, 157, 255, 0.22), transparent 62%);
  filter: blur(8px);
  pointer-events: none;
}
/* Centered on the landing's bottom edge, so it fades into the content instead of stopping at a line */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -50vh;
  height: 100vh;
  background: radial-gradient(60% 50% at 50% 50%, rgba(37, 212, 238, 0.09), transparent 70%);
  pointer-events: none;
}
/* Content below the landing sits above the glow */
#work { position: relative; z-index: 1; }

/* Where the landing ends: a thin line that fades out at both ends, with a small glow at its center */
.hero-rule {
  position: relative;
  z-index: 1;
  width: min(var(--col), 100% - 2rem);
  height: 1px;
  margin: 0 auto;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(79, 157, 255, 0.55) 30%, rgba(37, 212, 238, 0.55) 70%, transparent);
  overflow: visible;
}
.hero-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent-2);
  box-shadow: 0 0 12px 3px rgba(37, 212, 238, 0.45);
}
.hero-rule + #work { padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 3rem 1rem;
  max-width: 720px;
}
.hero-logo {
  width: min(540px, 82vw);
  height: auto;
  filter: drop-shadow(0 6px 34px rgba(79, 157, 255, 0.28));
}
.hero-role {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.hero-role strong { color: var(--text); font-weight: 600; }
.hero .tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  color: var(--muted);
  max-width: 36ch;
  font-weight: 400;
}
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04101f;
  box-shadow: 0 10px 26px -10px rgba(79, 157, 255, 0.65);
}
.btn-primary:hover { color: #04101f; transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(79, 157, 255, 0.8); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { color: var(--text); transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); border-color: var(--accent); }

/* Equalizer motif */
.eq { display: flex; align-items: flex-end; gap: 5px; height: 40px; margin-top: 0.4rem; }
.eq span {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transform-origin: bottom;
  transform: scaleY(0.3);
  animation: eq 1.2s ease-in-out infinite;
  opacity: 0.85;
}
.eq span:nth-child(1) { animation-delay: -1.0s; animation-duration: 1.3s; }
.eq span:nth-child(2) { animation-delay: -0.4s; animation-duration: 1.0s; }
.eq span:nth-child(3) { animation-delay: -0.7s; animation-duration: 1.5s; }
.eq span:nth-child(4) { animation-delay: -0.2s; animation-duration: 1.1s; }
.eq span:nth-child(5) { animation-delay: -0.9s; animation-duration: 1.35s; }
.eq span:nth-child(6) { animation-delay: -0.5s; animation-duration: 0.95s; }
.eq span:nth-child(7) { animation-delay: -0.3s; animation-duration: 1.25s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.25); }
  50%      { transform: scaleY(1); }
}

/* Content below the landing: keep the anchor clear of the sticky header */
#work { scroll-margin-top: 64px; }

/* ---------- Home: the Forge block ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}
.feature-img img {
  width: 100%;
  height: auto;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color 0.2s ease;
}
.feature-img:hover img { border-color: var(--line-strong); }
.feature-text > * + * { margin-top: 0.9rem; }
@media (max-width: 620px) {
  .feature { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ---------- Home: one video, linking out ---------- */
.notebook .video-link { display: block; width: min(100%, 26rem); margin-inline: auto; text-align: center; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.video-link img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.video-link span { display: block; margin-top: 0.5rem; }
.notebook .video-link:hover { color: var(--text); }
.video-link:hover img { border-color: var(--line-strong); }
.video-link span::after { content: "\2009\2197"; }

/* ---------- About: photo beside the intro ---------- */
.about-intro {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.about-photo { margin: 0; }
.about-intro p { margin: 0; }
.about-intro p + p { margin-top: 1.1rem; }
.about-stack { grid-template-columns: 1fr; }
.about-stack .about-photo { width: 12rem; }
.notebook .intro-name { margin: 0 0 0.6rem; font-size: 1.6rem; }
.about-photo img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
@media (max-width: 560px) {
  .about-intro { grid-template-columns: 1fr; }
  .about-photo { width: 10rem; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
