:root {
  --bg: #ebf0f3;
  --ink: #101820;
  --ink-soft: #2a3945;
  --muted: #5d6e7a;
  --accent: #0f6b73;
  --accent-deep: #0a4f55;
  --line: rgba(16, 24, 32, 0.1);
  --surface: #ffffff;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.1);
  --radius: 22px;
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(15, 107, 115, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(16, 24, 32, 0.06), transparent 50%),
    linear-gradient(180deg, #f4f7f9 0%, var(--bg) 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(244, 247, 249, 0.86);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.28rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(15, 107, 115, 0.08);
}

.nav-links a[aria-current="page"] {
  color: #fff;
  background: var(--ink);
}

.nav-links .nav-cta {
  background: var(--accent);
  color: #fff !important;
}

.nav-links .nav-cta:hover {
  background: var(--accent-deep);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: #f5f8f9;
  box-shadow: 0 10px 22px rgba(16, 24, 32, 0.16);
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #f5fbfb;
  box-shadow: 0 10px 22px rgba(15, 107, 115, 0.2);
}

.btn-accent:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.viewer-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.viewer-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 2.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(16, 24, 32, 0.05);
}

.viewer-label {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.viewer-bar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.viewer-sub {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 44rem;
  line-height: 1.5;
}

.viewer-sub a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.viewer-sub a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.viewer-stage {
  flex: 1;
  min-height: calc(100vh - 250px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.viewer-frame {
  width: 100%;
  height: calc(100vh - 250px);
  min-height: 740px;
  border: 0;
  display: block;
  background: #e7ecef;
}

.viewer-stage-image {
  background:
    linear-gradient(180deg, #d8dee4 0%, #cfd6dd 100%);
  min-height: calc(100vh - 320px);
}

.transcript-scroll {
  height: calc(100vh - 320px);
  min-height: 740px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.transcript-full {
  width: min(920px, 100%);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(16, 24, 32, 0.22);
  background: #fff;
}

.viewer-summary {
  margin-top: 0.15rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat {
  padding: 1.15rem 1rem;
  border-radius: 18px;
  background: var(--ink);
  color: #f4f7f7;
  text-align: center;
  box-shadow: 0 12px 28px rgba(16, 24, 32, 0.12);
}

.stat:nth-child(2) {
  background: linear-gradient(145deg, #178088, #0f6b73);
}

.stat:nth-child(3) {
  background: linear-gradient(145deg, #243541, #101820);
}

.stat-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.viewer-fallback {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .viewer-frame,
  .transcript-scroll {
    min-height: 560px;
    height: calc(100vh - 280px);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .transcript-scroll {
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:hover {
    transform: none;
  }
}
