:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #151922;
  --panel-2: #1c212b;
  --text: #f5f1e8;
  --muted: #b8c5d4;
  --line: #303846;
  --accent: #63d999;
  --accent-2: #8fb9ff;
  --warn: #f4c95d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 18% 0%, rgba(99, 217, 153, 0.14), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(143, 185, 255, 0.15), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button {
  color: inherit;
  font: inherit;
}

.page-header {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 56px clamp(20px, 6vw, 88px) 34px;
  border-bottom: 1px solid var(--line);
}

.header-banner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.72) contrast(1.05);
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 180ms ease;
  z-index: 0;
}

.page-header::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 13, 16, 0.92), rgba(11, 13, 16, 0.7) 48%, rgba(11, 13, 16, 0.86)),
    linear-gradient(0deg, rgba(11, 13, 16, 0.84), rgba(11, 13, 16, 0.22) 54%, rgba(11, 13, 16, 0.72));
  content: "";
  z-index: 0;
}

.page-header.has-banner .header-banner-image {
  opacity: 0.35;
}

.page-header > :not(.header-banner-image) {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.dek {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.2rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-width: 260px;
}

nav a,
.notes-grid a,
.card a,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 34, 0.76);
  padding: 10px 13px;
  text-decoration: none;
}

main {
  padding: 0 clamp(20px, 6vw, 88px) 70px;
}

.quote-band {
  margin: 28px 0 0;
  border: 1px solid rgba(99, 217, 153, 0.45);
  border-radius: 8px;
  background: rgba(7, 8, 11, 0.42);
  box-shadow: var(--shadow);
}

.quote-band p {
  margin: 0;
  padding: 16px 18px;
  color: #eaf7ef;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1rem, 2vw, 1.45rem);
  line-height: 1.35;
}

.intro-band {
  max-width: 960px;
  padding: 32px 0 12px;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-grid {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.reader-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  max-width: 740px;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card,
.review-frame,
.log-reader-shell,
.reader-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 34, 0.88);
  box-shadow: var(--shadow);
}

.card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.card p {
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card button {
  cursor: pointer;
}

.reader-section {
  margin: 10px 0 34px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: clamp(520px, 82dvh, 900px);
  min-height: 360px;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  resize: vertical;
  padding: 24px;
}

.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.reader-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.article-body {
  max-width: 860px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 2px 18px 18px 0;
  scrollbar-color: rgba(122, 240, 181, 0.5) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.article-body::-webkit-scrollbar {
  width: 10px;
}

.article-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.article-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(122, 240, 181, 0.7), rgba(177, 106, 255, 0.55));
  border-radius: 999px;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  line-height: 1.15;
}

.article-body blockquote {
  margin-left: 0;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--muted);
}

.article-image {
  margin: 22px 0;
}

.article-image img {
  display: block;
  width: min(100%, 620px);
  max-height: 760px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #05070b;
}

.article-image figcaption {
  max-width: 620px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-body code,
code {
  font-family: "Cascadia Mono", Consolas, monospace;
  color: #d6f5ff;
}

.media-layout {
  display: grid;
  gap: 14px;
}

.review-frame {
  margin: 0;
  overflow: hidden;
}

.feature-box {
  display: grid;
  min-height: 360px;
  place-items: center;
  background: #07080b;
}

.feature-box video,
.feature-box audio,
.feature-box img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.feature-box p {
  max-width: 520px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.review-frame figcaption {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.media-list,
.log-list {
  display: grid;
  gap: 10px;
}

.media-list {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  align-items: stretch;
}

.media-item,
.log-item {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 33, 43, 0.74);
  min-width: 0;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.media-item {
  grid-template-columns: 1fr;
}

.media-item.selected,
.media-item[aria-current="true"] {
  border-color: rgba(99, 217, 153, 0.78);
  background: rgba(99, 217, 153, 0.12);
}

.media-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 6px;
  background: #090b0f;
  object-fit: cover;
}

.media-copy {
  min-width: 0;
}

.media-copy strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.media-kind,
.meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.media-description {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: #d7e2ee;
  font-size: 0.84rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.review-frame figcaption > span {
  color: var(--muted);
}

.media-caption-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.media-caption-bar span {
  color: var(--muted);
}

.media-share {
  flex: 0 0 auto;
  cursor: pointer;
}

.media-analysis {
  height: clamp(120px, 20vh, 250px);
  overflow: auto;
  resize: vertical;
  margin: 0;
  border: 1px solid rgba(48, 56, 70, 0.78);
  border-radius: 6px;
  background: rgba(7, 8, 11, 0.46);
  padding: 11px 12px;
  color: #d7e2ee;
  line-height: 1.45;
}

.media-analysis:empty {
  display: none;
}

.log-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 14px;
}

.log-item {
  display: block;
}

.log-item.selected,
.log-item[aria-current="true"] {
  border-color: rgba(99, 217, 153, 0.78);
  background: rgba(99, 217, 153, 0.12);
}

.log-reader-shell {
  margin: 0;
  overflow: hidden;
}

.log-reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.log-reader-header h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.log-reader-header a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 8, 11, 0.42);
  padding: 8px 11px;
  text-decoration: none;
}

.log-reader {
  height: clamp(360px, 62dvh, 760px);
  overflow: auto;
  resize: vertical;
  margin: 0;
  padding: 18px;
  scrollbar-color: rgba(122, 240, 181, 0.5) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.log-reader::-webkit-scrollbar {
  width: 10px;
}

.log-reader::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.log-reader::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(122, 240, 181, 0.7), rgba(177, 106, 255, 0.55));
  border-radius: 999px;
}

.log-reader.text-log {
  white-space: pre-wrap;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
  line-height: 1.45;
}

.transcript-text {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

.log-reader.markdown-log {
  white-space: normal;
}

.log-reader.markdown-log > * {
  max-width: 960px;
}

.log-reader.markdown-log h1,
.log-reader.markdown-log h2,
.log-reader.markdown-log h3 {
  line-height: 1.15;
}

.log-reader.markdown-log blockquote {
  margin-left: 0;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--muted);
}

.log-reader.markdown-log code {
  font-family: "Cascadia Mono", Consolas, monospace;
  color: #d6f5ff;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.empty {
  color: var(--muted);
}

@media (max-width: 820px) {
  .page-header {
    display: block;
  }

  nav {
    justify-content: flex-start;
    margin-top: 24px;
  }

  .reader-header {
    display: grid;
  }

  .reader-section {
    height: 74dvh;
    min-height: 420px;
    max-height: none;
    resize: none;
  }

  .article-body {
    height: 100%;
    padding-right: 10px;
  }

  .media-list {
    margin-top: 14px;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }

  .media-analysis {
    height: auto;
    max-height: 220px;
    resize: none;
  }

  .media-caption-bar {
    display: grid;
  }

  .log-reader-header {
    display: grid;
  }

  .log-reader {
    height: 64dvh;
    resize: none;
  }
}
