:root {
  --paper: #f5f2ec;
  --surface: #fffdf9;
  --ink: #25211d;
  --muted: #756d65;
  --line: #e8ded3;
  --brand: #d06b12;
  --brand-dark: #ac6842;
  --hero: #c55f0a;
  --brand-deep: #8d4c2d;
  --dark-brown: #4e301e;
  --peach: #ffe3d2;
  --green: #dfeee0;
  --blue: #dee9ff;
  --pink: #ffe1ee;
  --yellow: #fff0c6;
  --shadow: 0 12px 28px rgba(53, 39, 27, 0.12);
  --font-title: "Gilroy ExtraBold", "Gilroy-ExtraBold", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-body: "Gilroy Light", "GilroyLight", Inter, ui-sans-serif, system-ui, sans-serif;
}

@font-face {
  font-family: "Gilroy ExtraBold";
  src: local("Gilroy ExtraBold"), local("Gilroy-ExtraBold");
  font-weight: 800;
}

@font-face {
  font-family: "Gilroy Light";
  src: local("Gilroy Light"), local("Gilroy-Light"), local("GilroyLight");
  font-weight: 300;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 62px;
  padding: 0 5vw;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: #ef9f41;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.05rem;
}

.topbar-left,
.topbar-nav {
  min-width: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.topbar-nav form {
  margin: 0;
}

.muted-nav,
.back-link,
.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
}

.back-link:hover,
.nav-link:hover,
.text-link:hover,
.develop-link:hover {
  color: var(--brand);
}

.nav-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-button,
.button-primary {
  background: var(--brand);
  color: white;
}

.button-primary:hover,
.nav-button:hover {
  background: #b95d0f;
}

.button-light {
  background: white;
  color: var(--brand-deep);
}

.button-outline-light {
  background: transparent;
  border-color: white;
  color: white;
}

.button-secondary {
  background: white;
  border-color: var(--brand-dark);
  color: var(--brand-deep);
}

.button-saved {
  background: #e2f2e3;
  border-color: #78a878;
  color: #2b6a35;
}

.ghost-button {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: auto;
  cursor: pointer;
}

.full-width {
  width: 100%;
}

.hero,
.detail-hero,
.science-hero {
  background: var(--hero);
  color: white;
}

.hero-inner {
  width: min(1080px, calc(100% - 10vw));
  margin: 0 auto;
  padding: 72px 0 82px;
}

.hero h1,
.detail-hero h1,
.science-hero h1,
.account-header h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 2.35rem;
  line-height: 1.08;
}

.hero p {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.94);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 30px;
}

.page-flow,
.library-shell,
.detail-layout,
.science-flow,
.account-shell,
.how-it-works {
  width: min(1080px, calc(100% - 10vw));
  margin: 0 auto;
}

.page-flow,
.library-shell,
.detail-layout,
.science-flow,
.account-shell {
  padding: 54px 0 70px;
}

.section-block + .section-block {
  margin-top: 56px;
}

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

.section-heading h1,
.section-heading h2,
.how-it-works h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.28rem;
  line-height: 1.2;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.split-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.text-link,
.develop-link {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.9rem;
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
}

.home-tabs {
  width: 100%;
}

.home-see-all {
  margin-left: auto;
}

.platform-tab {
  min-width: 142px;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid #9c7c66;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-deep);
  cursor: pointer;
  font-weight: 800;
}

.platform-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.two-cols,
.library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--dark-brown);
}

.thumb-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eadccc;
}

.thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 16px;
  border-radius: 999px;
  color: #5a4637;
  background: var(--peach);
  font-weight: 800;
  font-size: 0.78rem;
}

.floating-pill {
  position: absolute;
  right: 12px;
  top: 10px;
}

.resilience {
  background: var(--yellow);
}

.empathie {
  background: var(--peach);
}

.language {
  background: var(--blue);
}

.regulation {
  background: var(--green);
}

.creativite {
  background: var(--pink);
}

.science {
  background: #e3f2f1;
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.card-body h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1.25;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-watch {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.develop-link {
  font-size: 0.78rem;
}

.stat-band {
  display: flex;
  justify-content: center;
  gap: 76px;
  padding: 26px 5vw;
  background: var(--brand-dark);
  color: white;
  font-size: 1rem;
}

.stat-band span {
  display: inline-flex;
  align-items: center;
}

.how-it-works {
  padding: 48px 0 60px;
  background: var(--paper);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 28px;
  text-align: center;
}

.steps strong {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
}

.steps h3 {
  margin: 14px 0 6px;
  font-size: 0.98rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.library-shell {
  min-height: calc(100vh - 62px);
}

.library-title {
  margin: 16px 0 24px;
}

.tag-search-form {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.tag-search-form label {
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 0.86rem;
}

.tag-search-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.tag-search-form input {
  min-height: 44px;
  border: 1px solid #d6c9bd;
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
}

.tag-chip-row,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag-chip.active,
.tag-chip:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.ai-series-grid {
  margin-top: 22px;
}

.ai-series-card .card-body small {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-hero {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  padding: 0;
  background: #1e1a17;
}

.detail-hero-bg {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  filter: blur(4px);
  transform: scale(1.02);
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.detail-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 420px;
  width: min(1080px, calc(100% - 10vw));
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
}

.eyebrow {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  font-size: 1.05rem;
}

.detail-description {
  max-width: 650px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 1.12rem;
  line-height: 1.45;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.save-panel {
  min-width: 0;
}

.save-panel .button,
.watch-wide {
  width: 100%;
}

.save-panel p {
  margin: 10px 0 0;
  color: var(--dark-brown);
  font-size: 0.84rem;
  text-align: center;
}

.save-panel a:not(.button) {
  color: var(--dark-brown);
  font-weight: 800;
  text-decoration: underline;
}

.favorite-button {
  min-height: 56px;
  border: 2px solid var(--brand-dark);
  color: var(--brand-dark);
  font-size: 1rem;
}

.watch-wide {
  min-height: 56px;
  background: var(--brand-dark);
  font-size: 1rem;
}

.benefit-panel,
.warning-box,
.science-card,
.auth-card,
.account-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.benefit-panel {
  margin-top: 42px;
  padding: 28px;
  background: #ffe6d7;
  color: var(--dark-brown);
}

.benefit-panel h2 {
  margin: 0 0 18px;
  font-family: var(--font-title);
  font-size: 1.1rem;
}

.benefit-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit-panel li + li {
  margin-top: 18px;
}

.benefit-panel li {
  position: relative;
  padding-left: 28px;
  line-height: 1.45;
}

.benefit-panel li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brand);
}

.source-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.similar-block {
  margin-top: 62px;
}

.science-hero {
  padding: 70px 5vw 76px;
}

.science-hero h1,
.science-hero p {
  width: min(1080px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.science-hero p {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.92);
}

.science-flow {
  display: grid;
  gap: 28px;
}

.science-card {
  padding: 26px;
}

.science-card p {
  margin: 22px 0 10px;
}

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

.warning-box {
  display: grid;
  gap: 8px;
  padding: 24px 28px;
  background: var(--peach);
  color: var(--brand-deep);
  box-shadow: none;
}

.science-page .topbar {
  min-height: 64px;
}

.science-page .brand {
  color: #4d362b;
  font-size: 1.18rem;
}

.science-page .topbar-nav {
  display: none;
}

.science-page .back-link {
  color: #4d362b;
  font-size: 1rem;
}

.science-page .science-hero {
  padding: 58px 0 62px;
}

.science-page .science-hero h1,
.science-page .science-hero p,
.science-page .science-flow {
  width: min(648px, calc(100% - 80px));
}

.science-page .science-hero h1 {
  font-size: 2.05rem;
  line-height: 1.18;
}

.science-page .science-hero p {
  max-width: 430px;
  margin-top: 18px;
  margin-left: calc((100% - min(648px, calc(100% - 80px))) / 2);
  color: rgba(255, 255, 255, 0.94);
}

.science-page .science-flow {
  gap: 22px;
  padding: 54px 0 38px;
}

.science-page .science-card {
  border: 0;
  border-radius: 12px;
  padding: 18px 20px 17px;
  box-shadow: 0 10px 26px rgba(53, 39, 27, 0.1);
}

.science-page .science-card p {
  margin: 18px 0 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.science-page .science-card small {
  color: #60483a;
  font-size: 0.78rem;
  font-style: italic;
}

.science-page .pill {
  min-height: 27px;
  padding: 0 18px;
  font-size: 0.83rem;
}

.science-page .pill.resilience {
  background: #ffe1d1;
}

.science-page .pill.empathie {
  background: #fff0cf;
}

.science-page .pill.language {
  background: #e5dfff;
}

.science-page .pill.regulation {
  background: #fce5e8;
}

.science-warning {
  display: grid;
  gap: 2px;
  margin: 0 0 28px;
  color: #ad5f35;
  font-size: 0.78rem;
  line-height: 1.2;
}

.science-warning strong {
  font-weight: 800;
}

.science-cta {
  min-height: 50px;
  border-radius: 7px;
  background: var(--brand-dark);
  font-size: 1rem;
}

.science-page .source-note.centered {
  margin-top: 4px;
  color: #5a4637;
  font-size: 0.76rem;
}

.centered {
  text-align: center;
}

.centered-page {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 62px);
  padding: 24vh 5vw 80px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 34px;
  background: linear-gradient(180deg, #ffe1d0, #ffe8d8);
}

.auth-card h1 {
  margin: 0;
  font-family: var(--font-title);
  text-align: center;
  font-size: 1.35rem;
}

.auth-card p {
  margin: 10px 0 20px;
  color: var(--muted);
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.86rem;
}

.auth-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #d6c9bd;
  border-radius: 8px;
  padding: 0 14px;
  background: #faf5ee;
  color: var(--ink);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #dfc7b6;
}

.auth-card small {
  display: block;
  margin-top: 16px;
  color: var(--brand-deep);
  text-align: center;
}

.form-error {
  border: 1px solid #cf563d;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff3ef;
  color: #9d3322 !important;
  text-align: left !important;
}

.account-header {
  margin-bottom: 44px;
  padding: 30px;
}

.account-header .eyebrow {
  color: var(--brand);
}

.account-header p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed #cab9a8;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 78px;
  padding: 0 5vw;
  background: var(--surface);
  color: var(--brand-dark);
}

.footer-brand {
  color: #4d362b;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
}

.site-footer p {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-style: italic;
}

.footer-link {
  justify-self: end;
  color: var(--brand-dark);
  font-size: 1rem;
}

.footer-link:hover {
  color: var(--brand);
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand {
    order: 1;
  }

  .topbar-left {
    order: 0;
  }

  .topbar-nav {
    grid-column: 1 / -1;
    order: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-inner,
  .science-hero {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .detail-hero,
  .detail-hero-content {
    min-height: 390px;
  }

  .hero h1,
  .detail-hero h1,
  .science-hero h1,
  .account-header h1 {
    font-size: 2rem;
  }

  .page-flow,
  .library-shell,
  .detail-layout,
  .science-flow,
  .account-shell,
  .how-it-works {
    width: min(100% - 32px, 1080px);
  }

  .card-grid,
  .two-cols,
  .library-grid,
  .steps,
  .detail-actions {
    grid-template-columns: 1fr;
  }

  .stat-band {
    display: grid;
    gap: 8px;
    text-align: center;
  }

  .centered-page {
    padding-top: 72px;
  }

  .tag-search-form > div {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 16px;
    text-align: center;
  }

  .footer-link {
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .nav-button,
  .button,
  .platform-tab {
    width: 100%;
  }

  .platform-tabs,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .split-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 26px 20px;
  }
}
