:root {
  color-scheme: dark;
  --ink: #f6f7f3;
  --muted: #aeb7c7;
  --faint: #748095;
  --line: rgba(216, 229, 255, 0.16);
  --line-strong: rgba(216, 229, 255, 0.27);
  --canvas: #030615;
  --surface: rgba(12, 18, 38, 0.72);
  --surface-strong: rgba(16, 22, 45, 0.86);
  --surface-soft: rgba(6, 12, 28, 0.64);
  --lime: #c8ff38;
  --lime-soft: rgba(200, 255, 56, 0.14);
  --violet: #9d8aff;
  --violet-soft: rgba(157, 138, 255, 0.16);
  --cyan: #72efe1;
  --gold: #ffd36a;
  --success: #bdfd76;
  --warning: #ffcf6b;
  --error: #ff9d9d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --font-sans: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "DM Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--font-sans);
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #030615;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  inset: 0;
  background: url("./assets/page-background.webp") center / cover no-repeat;
  background-attachment: fixed;
}

body::after {
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 6, 21, 0.35), rgba(3, 6, 21, 0.5));
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.52; }
a { color: var(--lime); }
:focus-visible { outline: 3px solid rgba(200, 255, 56, 0.66); outline-offset: 3px; }

.shell { width: min(1240px, calc(100% - 72px)); margin: 0 auto; }

.skip-link {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 30;
  padding: 8px 12px;
  color: #07100b;
  background: var(--lime);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: 100%;
  margin: 0;
  padding: 1px 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.055em; text-decoration: none; }
.brand-accent { color: var(--violet); }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 22px; height: 24px; }
.brand-mark span { width: 5px; border-radius: 10px; background: var(--violet); transform: rotate(-22deg); }
.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 19px; background: var(--lime); }
.brand-mark span:nth-child(3) { height: 24px; }
.site-nav { display: flex; align-items: center; gap: 27px; font-size: 0.76rem; font-weight: 700; }
.site-nav a { color: var(--ink); text-decoration: none; transition: color 140ms ease; }
.site-nav a:hover { color: var(--lime); }
.site-nav .nav-cta { padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; }
.site-nav .nav-cta:hover { color: var(--canvas); background: var(--ink); border-color: var(--ink); }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 84px 0 44px; }
.hero h1 { max-width: 740px; margin: 10px 0 17px; font-size: clamp(2.7rem, 6vw, 5.9rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.075em; }
.hero h1 em { color: var(--violet); font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.08em; }
.hero__lede { max-width: 590px; margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.7; }
.hero__actions { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }

.eyebrow { margin: 0; color: var(--lime); font-family: var(--font-mono); font-size: 0.65rem; font-weight: 500; letter-spacing: 0.13em; line-height: 1.5; text-transform: uppercase; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 1.45rem; font-weight: 750; letter-spacing: -0.04em; line-height: 1.15; }
h3 { font-size: 0.98rem; line-height: 1.25; }

.panel {
  padding: 28px;
  background: linear-gradient(142deg, rgba(16, 24, 51, 0.74), rgba(7, 12, 30, 0.72));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}
.panel__intro p:last-child { max-width: 560px; margin: 10px 0 0; color: var(--muted); }
.connection-panel { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px 48px; align-items: end; }
.connection-form { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; }
.connection-form label:last-of-type { grid-column: 1 / -1; }
.connection-form .button { grid-column: 2; justify-self: start; }

label { display: grid; gap: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 0.67rem; font-weight: 500; letter-spacing: 0.02em; }
input, textarea { width: 100%; color: var(--ink); background: rgba(3, 7, 20, 0.72); border: 1px solid rgba(216, 229, 255, 0.19); border-radius: 9px; outline: none; transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
input { min-height: 44px; padding: 9px 12px; }
textarea { min-height: 118px; padding: 12px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(200, 255, 56, 0.12), 0 0 22px rgba(200, 255, 56, 0.08); background: rgba(4, 9, 25, 0.94); }
input::placeholder, textarea::placeholder { color: var(--faint); }

.button { min-height: 44px; padding: 9px 17px; border: 1px solid transparent; border-radius: 999px; font-size: 0.78rem; font-weight: 800; transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { color: #0a1307; background: var(--lime); box-shadow: 0 0 25px rgba(200, 255, 56, 0.18); }
.button--primary:hover:not(:disabled) { background: #dbff7e; box-shadow: 0 0 32px rgba(200, 255, 56, 0.38); }
.button--quiet { color: var(--ink); background: rgba(157, 138, 255, 0.11); border-color: rgba(157, 138, 255, 0.34); }
.button--quiet:hover:not(:disabled) { color: #080916; background: var(--violet); border-color: var(--violet); }

.status { min-height: 1.25em; margin: 10px 0 0; color: var(--muted); font-family: var(--font-mono); font-size: 0.65rem; line-height: 1.5; }
.status--success { color: var(--success); }
.status--warning { color: var(--warning); }
.status--error { color: var(--error); }

.capsule { margin: 58px 0 90px; }
.capsule-empty { position: relative; padding: 80px 24px; text-align: center; background: rgba(7, 13, 31, 0.54); border: 1px dashed rgba(216, 229, 255, 0.22); border-radius: 18px; box-shadow: inset 0 0 80px rgba(74, 62, 186, 0.07); backdrop-filter: blur(16px); }
.capsule-empty h2 { margin: 15px 0 10px; }
.capsule-empty p { max-width: 540px; margin: 0 auto; color: var(--muted); }
.empty-mark { display: grid; width: 54px; height: 54px; margin: 0 auto; place-items: center; color: var(--lime); background: var(--lime-soft); border: 1px solid rgba(200, 255, 56, 0.26); border-radius: 50%; box-shadow: 0 0 28px rgba(200, 255, 56, 0.16); font-size: 1.5rem; }
.capsule-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.capsule-heading h2 { margin: 8px 0 8px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -0.07em; }
.capsule-heading__meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 0.68rem; }
.dot { color: var(--violet); }

.capsule-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr); gap: 26px; align-items: start; }
.capsule-main, .capsule-aside { display: grid; gap: 28px; min-width: 0; }
.panel__heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel__heading { margin-bottom: 22px; }
.panel__heading h2, .section-heading h2 { margin-top: 5px; }
.editor-panel form { display: grid; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; }

.timeline-section { padding-top: 2px; }
.timeline { position: relative; display: grid; gap: 12px; margin-top: 18px; }
.timeline::before { position: absolute; top: 16px; bottom: 16px; left: 11px; width: 1px; background: linear-gradient(var(--lime), var(--violet)); box-shadow: 0 0 10px rgba(157, 138, 255, 0.36); content: ""; }
.timeline-card { position: relative; margin-left: 32px; padding: 19px 20px 18px; background: linear-gradient(142deg, rgba(19, 29, 60, 0.78), rgba(8, 14, 33, 0.76)); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.04); backdrop-filter: blur(16px); }
.timeline-card::before { position: absolute; top: 23px; left: -27px; width: 9px; height: 9px; background: var(--canvas); border: 2px solid var(--lime); border-radius: 50%; box-shadow: 0 0 12px rgba(200, 255, 56, 0.54); content: ""; }
.timeline-card--chunk { background: rgba(8, 13, 30, 0.53); border-style: dashed; box-shadow: none; }
.timeline-card--chunk::before { border-color: var(--violet); box-shadow: 0 0 12px rgba(157, 138, 255, 0.48); }
.timeline-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.timeline-card__title { margin: 4px 0 0; font-size: 1.02rem; font-weight: 800; }
.timeline-card__meta { margin: 9px 0 0; color: var(--muted); font-family: var(--font-mono); font-size: 0.66rem; }
.timeline-card__note { margin: 12px 0 0; color: #e0e5ee; white-space: pre-wrap; }
.icon-button { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: var(--faint); background: rgba(157, 138, 255, 0.07); border: 1px solid var(--line); border-radius: 50%; font-size: 1.22rem; line-height: 1; }
.icon-button:hover:not(:disabled), .icon-button.is-favorite { color: var(--gold); border-color: rgba(255, 211, 106, 0.62); background: rgba(255, 211, 106, 0.12); box-shadow: 0 0 18px rgba(255, 211, 106, 0.16); }
.location-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 15px; padding-top: 12px; color: var(--muted); border-top: 1px solid rgba(216, 229, 255, 0.11); font-family: var(--font-mono); font-size: 0.63rem; }
.location-row__accuracy { color: var(--faint); }
.text-link { color: var(--lime); font-weight: 700; }

.transcript-panel, .search-panel { padding: 24px; }
.transcript-list, .search-results { display: grid; gap: 11px; margin-top: 18px; }
.transcript-item { padding: 14px; background: rgba(5, 10, 26, 0.6); border: 1px solid rgba(216, 229, 255, 0.12); border-radius: 11px; }
.transcript-item__time { display: block; margin-bottom: 7px; color: var(--violet); font-family: var(--font-mono); font-size: 0.61rem; }
.transcript-item__text { margin: 0 0 9px; font-size: 0.87rem; }
.source-pill { display: inline-block; padding: 2px 7px; color: var(--muted); background: var(--violet-soft); border-radius: 999px; font-family: var(--font-mono); font-size: 0.59rem; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }
.search-form input { min-width: 0; }
.search-panel .status { margin-top: 9px; }
.search-result { padding: 14px; border-bottom: 1px solid var(--line); }
.search-result:last-child { border-bottom: 0; }
.search-result__header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 0.59rem; }
.search-result__time { white-space: nowrap; }
.search-result__title { margin: 0 0 5px; font-size: 0.95rem; }
.search-result__excerpt { margin: 0; color: var(--muted); font-size: 0.81rem; }
.favorite-label { display: inline-block; margin-top: 9px; color: var(--gold); font-family: var(--font-mono); font-size: 0.6rem; }

.inline-empty { padding: 22px 4px 4px; color: var(--muted); }
.inline-empty h3 { margin-bottom: 5px; color: var(--ink); }
.inline-empty p { margin-bottom: 0; font-size: 0.81rem; }
.site-footer { padding-bottom: 32px; color: var(--faint); font-family: var(--font-mono); font-size: 0.62rem; }
.site-footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 860px) {
  .shell { width: min(100% - 48px, 1240px); }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 62px; }
  .connection-panel, .capsule-grid { grid-template-columns: 1fr; }
  .connection-form { grid-template-columns: 1fr 1fr; }
  .capsule-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1240px); }
  .site-header { width: 100%; padding: 15px 14px; }
  .site-nav { gap: 12px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .site-nav .nav-cta { padding: 9px 12px; font-size: 0.71rem; }
  .hero { gap: 22px; padding: 48px 0 30px; }
  .hero h1 { font-size: clamp(2.55rem, 14vw, 4rem); }
  .hero__lede { font-size: 0.93rem; line-height: 1.6; }
  .hero__actions { align-items: flex-start; flex-direction: column; }
  .panel { padding: 20px; border-radius: 14px; }
  .connection-form, .connection-form .button { grid-template-columns: 1fr; grid-column: auto; }
  .connection-form { display: grid; }
  .connection-form .button { justify-self: stretch; }
  .capsule { margin-top: 36px; }
  .capsule-heading { flex-direction: column; }
  .capsule-aside { grid-template-columns: 1fr; }
  .search-form { grid-template-columns: 1fr; }
  .search-form .button { width: 100%; }
  .timeline-card { padding: 17px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
