:root {
  --page-bg: #fbfaf7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #1c2740;
  --muted: #6f798f;
  --line: rgba(28, 39, 64, 0.1);
  --accent: #635bff;
  --accent-soft: rgba(99, 91, 255, 0.12);
  --shadow: 0 28px 60px rgba(35, 45, 78, 0.12);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 14% 30%, rgba(255, 186, 173, 0.22), transparent 28%),
    radial-gradient(circle at 38% 52%, rgba(99, 91, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, var(--page-bg) 58%, #f5f2ec 100%);
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  border: 0;
  word-wrap: normal !important;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

.site-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #635bff 0%, #7e74ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
}

.brand-mark::before {
  top: 5px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
}

.brand-mark::after {
  top: 12px;
  width: 12px;
  height: 4px;
  border-radius: 999px;
}

.section-switch,
.main-nav a,
.hero-tags a,
.finder-field p,
.section-eyebrow,
.viewer-kicker,
.sidebar-eyebrow,
.benefit-card > p,
.collage-meta span {
  color: var(--muted);
}

.section-switch {
  font-size: 0.95rem;
  font-weight: 600;
}

.main-nav {
  display: inline-flex;
  justify-self: center;
  gap: 28px;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
}

.main-nav a,
.header-link,
.hero-tags a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.header-link:hover,
.hero-tags a:hover {
  color: var(--text);
}

.header-actions {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.header-link {
  font-size: 0.92rem;
  font-weight: 600;
}

.header-button,
.hero-primary,
.finder-action,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-button,
.finder-action {
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(99, 91, 255, 0.14);
}

.hero-primary {
  background: #18253d;
  color: #ffffff;
  box-shadow: 0 18px 30px rgba(24, 37, 61, 0.2);
}

.hero-secondary {
  border: 1px solid rgba(28, 39, 64, 0.14);
  background: rgba(255, 255, 255, 0.7);
}

.header-button:hover,
.hero-primary:hover,
.hero-secondary:hover,
.finder-action:hover {
  transform: translateY(-1px);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  gap: 56px;
  align-items: center;
  padding: 46px 0 0;
}

.hero-copy h1 {
  margin: 14px 0 20px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: clamp(3rem, 5vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-eyebrow,
.section-eyebrow,
.viewer-kicker,
.sidebar-eyebrow,
.benefit-card > p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-subcopy,
.section-heading p:last-child,
.viewer-card-top p,
.viewer-footnote,
.benefit-card p:last-child,
.sidebar-card li,
.finder-field span {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-subcopy {
  max-width: 34rem;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
  font-weight: 700;
}

.hero-collage {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: end;
}

.collage-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #f0ece5;
  box-shadow: var(--shadow);
}

.collage-card canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-card-wide {
  aspect-ratio: 1.2 / 0.82;
}

.collage-card-large {
  aspect-ratio: 1.2 / 0.92;
  margin-top: 14px;
}

.collage-card-tall {
  grid-column: 2;
  grid-row: 1 / span 2;
  aspect-ratio: 0.84 / 1.28;
}

.collage-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.collage-meta strong,
.finder-field strong,
.viewer-card-top h3,
.sidebar-card h3,
.benefit-card h3 {
  display: block;
  color: var(--text);
}

.finder-wrap {
  position: relative;
  z-index: 2;
  margin-top: clamp(22px, 3vw, 36px);
}

.finder-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0;
  align-items: center;
  padding: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 46px rgba(35, 45, 78, 0.16);
  backdrop-filter: blur(18px);
}

.finder-field {
  padding: 10px 22px;
}

.finder-field + .finder-field {
  border-left: 1px solid rgba(28, 39, 64, 0.08);
}

.finder-field p,
.finder-field strong,
.finder-field span {
  margin: 0;
}

.finder-field strong {
  margin: 2px 0 4px;
  font-size: 1.08rem;
}

.finder-action {
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  justify-self: end;
  font-size: 0.95rem;
}

.reader-section {
  padding-top: 84px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 10px 0 12px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.section-heading p:last-child {
  margin: 0;
}

.reader-layout {
  display: grid;
  gap: 22px;
  align-items: start;
}

.reader-sidebar {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sidebar-card,
.viewer-card,
.benefit-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 26px;
}

.sidebar-card h3,
.benefit-card h3 {
  margin: 10px 0 14px;
  font-size: 1.45rem;
  line-height: 1.18;
}

.sidebar-card ul {
  margin: 0;
  padding-left: 18px;
}

.sidebar-card li + li {
  margin-top: 10px;
}

.viewer-card {
  padding: 26px;
}

.viewer-card-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.viewer-card-top h3 {
  margin: 8px 0 4px;
  font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
  font-size: 1.9rem;
}

.viewer-card-top p {
  margin: 0;
}

.viewer-card-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.viewer-card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(28, 39, 64, 0.12);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  font-weight: 700;
}

#stoneSoupViewer {
  width: 100%;
  height: var(--stone-soup-viewer-height-desktop, min(920px, 82vh));
  border-radius: 30px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(28, 39, 64, 0.08);
}

.viewer-footnote {
  margin: 18px 4px 0;
}

.benefits-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 46px;
}

.benefit-card {
  --benefit-accent: #635bff;
  --benefit-tint: rgba(99, 91, 255, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 240px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at 88% 10%, var(--benefit-tint), transparent 42%);
  border-color: rgba(28, 39, 64, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 52px rgba(35, 45, 78, 0.1);
}

.benefit-card:nth-child(2) {
  --benefit-accent: #c66f28;
  --benefit-tint: rgba(198, 111, 40, 0.12);
}

.benefit-card:nth-child(3) {
  --benefit-accent: #237a64;
  --benefit-tint: rgba(35, 122, 100, 0.12);
}

.benefit-card::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--benefit-accent);
}

.benefit-card > p:first-child {
  align-self: flex-start;
  margin: 6px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--benefit-tint);
  color: var(--benefit-accent);
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: none;
}

.benefit-card h3 {
  margin: 0;
  max-width: 20rem;
  font-size: clamp(1.34rem, 2vw, 1.7rem);
}

.benefit-card p:last-child {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 1120px) {
  .site-header,
  .hero-section,
  .reader-layout,
  .benefits-section {
    grid-template-columns: 1fr;
  }

  .site-header {
    justify-items: start;
  }

  .main-nav {
    justify-self: start;
    flex-wrap: wrap;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .hero-section {
    gap: 28px;
  }

  .hero-collage {
    max-width: 760px;
  }

  #stoneSoupViewer {
    height: var(--stone-soup-viewer-height-tablet, min(780px, 78vh));
  }

  .finder-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 32px;
  }

  .finder-action {
    justify-self: stretch;
    width: auto;
    border-radius: 20px;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    padding-bottom: 48px;
  }

  .site-header {
    gap: 16px;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 12vw, 3.7rem);
  }

  .hero-collage {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .collage-card {
    border-radius: 20px;
  }

  .collage-card-tall {
    aspect-ratio: 0.9 / 1.12;
  }

  .finder-wrap {
    margin-top: 24px;
  }

  .finder-bar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .finder-field,
  .viewer-card,
  .sidebar-card,
  .benefit-card {
    padding: 18px;
  }

  .benefit-card {
    min-height: 0;
    border-radius: 20px;
  }

  .finder-field + .finder-field {
    border-left: 0;
    border-top: 1px solid rgba(28, 39, 64, 0.08);
  }

  .viewer-card-top {
    flex-direction: column;
  }

  #stoneSoupViewer {
    height: var(--stone-soup-viewer-height-mobile, min(680px, 72vh));
    border-radius: 24px;
  }

  .mpv-viewer .mpv-body {
    grid-template-columns: 1fr;
  }
}