:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #102a46;
  background: #f7fcfd;
  color-scheme: light;
  --navy: #102a46;
  --purple: #271650;
  --teal: #007c7c;
  --page-width: 1280px;
  --gutter: clamp(18px, 3.2vw, 44px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 45%, white 24%, transparent 68%), #f1fcfd;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid #006e73; outline-offset: 4px; }

.page-width {
  width: min(100%, var(--page-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.topbar {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #ebfbfc, #fff 68%);
  border-bottom: 1px solid #b6e3e844;
}
.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 30px);
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--purple);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 850;
  letter-spacing: -.05em;
  white-space: nowrap;
}
.brand img { display: block; border-radius: 50%; }
.brand strong, .hero h1 strong { color: var(--teal); font-weight: inherit; }
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #b7f5f4;
  font-size: 13px;
  font-weight: 700;
}
.home-link:hover { background: #9ceae9; }
.topbar svg { width: 16px; height: 16px; flex: none; }
.account-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  --control-height: 34px;
}
.account-menu { display: flex; align-items: center; gap: 7px; }
.mobile-menu-toggle { display: none; }
.account-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--control-height);
  padding: 0 11px;
  border: 1px solid #dce7eb;
  border-radius: 999px;
  background: #f4f7f8;
  color: var(--navy);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.account-control.mobile-home-link { display: none; }
.account-control:hover { border-color: #8fc9cf; background: #e7f5f6; }
.logout:disabled { opacity: .6; cursor: wait; }
#logout-error:not(:empty) {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, 80vw);
  padding: 8px 12px;
  border: 1px solid #e9b6b5;
  border-radius: 8px;
  background: #fff6f6;
  color: #892d32;
  font-size: 13px;
}
.site-language {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  width: 82px;
  height: var(--control-height);
  padding: 2px;
  border: 1px solid #deeeee;
  border-radius: 999px;
  background: #fff;
}
.site-language button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 0 5px;
  background: transparent;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.site-language button:hover { background: #def8f8; }
.site-language button[aria-pressed=true] { background: var(--teal); color: #fff; }

.hero {
  --hero-height: clamp(246px, 37svh, 360px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #bef6f9 0%, #f8ffff 26%, #e9fafb 70%, #bff2f5 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 24% auto auto -155px;
  width: min(58%, 750px);
  min-width: 340px;
  height: 85%;
  border-radius: 48% 62% 42% 34%;
  background: #fff8;
  transform: rotate(-16deg);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--hero-height);
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: 47%;
  padding: 22px 0;
  padding-left: clamp(0px, 2vw, 28px);
}
.hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(35px, 4.65vw, 64px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.063em;
}
.tagline {
  margin: 9px 0 7px;
  color: var(--purple);
  font-size: clamp(17px, 1.95vw, 25px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.description {
  max-width: 440px;
  margin: 0;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.46;
}
.hero-visual {
  position: absolute;
  inset: 0 clamp(-44px, (var(--page-width) - 100vw) / 2, 0px) 0 auto;
  width: min(57vw, calc(var(--hero-height) * 2.05));
}
.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #edfbfc, #effcfcdd 5%, #f4fdfc00 25%),
    linear-gradient(0deg, #f5fcfd 0%, #f7fdfe00 14%);
  pointer-events: none;
}

.featured {
  padding-top: clamp(14px, 2.6svh, 27px);
  background: radial-gradient(ellipse at 50% 25%, #fff 24%, #fff0 72%);
}
.featured-heading { text-align: center; margin-bottom: clamp(8px, 1.5svh, 16px); }
.featured-heading h2 {
  margin: 0 0 5px;
  color: var(--purple);
  font-size: clamp(22px, 2.75vw, 35px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.035em;
}
.featured-heading p { margin: 0; font-size: clamp(14px, 1.2vw, 16px); line-height: 1.4; }
.destinations {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(162px, 1fr);
  gap: clamp(10px, 1.4vw, 20px);
  margin-inline: -10px;
  padding: 8px 10px 16px;
  overflow-x: auto;
  --book-height: clamp(120px, min(31svh, 24vw, 100svh - 440px), 280px);
}
.feature {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(10px, 1.5svh, 16px) 10px;
  border: 1px solid #fff;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f8fdfeef 70%, #e9faffeb);
  box-shadow: 0 7px 14px #397f8f12, inset 0 0 0 1px #cfedf140;
}
a.feature:focus-visible { outline-offset: 1px; }
.home-book {
  position: relative;
  height: var(--book-height);
  aspect-ratio: 2 / 3;
  border-radius: 5px 7px 7px 4px;
  border-left: 3px solid #263d55;
  overflow: hidden;
  color: #fff;
  background: #132b40;
  box-shadow: 2px 2px #8aa1b1, 4px 3px #c3d2dc, 4px 10px 12px #1b506739;
  transform: perspective(600px) rotateY(-9deg) rotateZ(-1deg);
  transition: transform .2s ease;
}
@media (hover: hover) {
  a.feature:hover { border-color: #a6dcdf; }
  a.feature:hover .home-book { transform: perspective(600px) rotateY(0deg) translateY(-3px); }
}
.home-book img { display: block; width: 100%; height: 100%; object-fit: contain; }
.kids-home-card .home-book { border-left-color: #6f375a; background: #d7f3ff; }
.my-videos-card .home-book { background: #091a39; }
.free-card .home-book {
  background: linear-gradient(180deg, #07172449, #07172420 39%, #071724ee 71%), url("/free-lessons-cover.jpg") center / cover, #102631;
}
.hotels-card .home-book {
  background: linear-gradient(180deg, transparent 37%, #101927f5), url("/api/library/hotels-cover") center / cover, #142436;
}
.conversations-card .home-book {
  border-left-color: #347578;
  background: radial-gradient(ellipse at 85% 6%, #247e83, transparent 70%),
    linear-gradient(147deg, #10354a, #0a1c32 74%);
}
.conversations-card .card-copy h3 { font-size: clamp(14px, calc(var(--book-height) * .092), 20px); }
.home-book-brand, .home-free-label, .home-book-foot { font-size: clamp(6px, .65vw, 9px); font-weight: 800; line-height: 1.15; }
.home-book-brand { display: block; padding: 9% 8%; color: #e4fafa; }
.home-free-label { display: block; color: #b7eff3; }
.home-book-foot { display: block; margin-top: 5px; color: #f1d77e; }
.card-copy {
  position: absolute;
  inset: auto 8% 8%;
  text-shadow: 0 1px 3px #081627;
}
.card-copy h3 {
  margin: 3px 0 4px;
  font-size: clamp(16px, calc(var(--book-height) * .104), 22px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -.04em;
}
.card-copy p { margin: 0; color: #e5f6fa; font-size: clamp(8px, calc(var(--book-height) * .057), 12px); line-height: 1.2; }
.hotels-free-lessons { font-weight: 750; }

.site-footer {
  position: relative;
  display: grid;
  align-items: end;
  flex: 1 0 auto;
  min-height: 58px;
  overflow: hidden;
  padding: 10px 12px 18px;
  background: radial-gradient(ellipse at 50% 0%, #fff, #f1fcfd 65%);
}
.site-footer::before, .site-footer::after {
  content: "";
  position: absolute;
  pointer-events: none;
  bottom: -27px;
  height: 72px;
  width: 42%;
  border-radius: 50%;
  background: #b4f1f6a6;
}
.site-footer::before { left: -17%; transform: rotate(12deg); }
.site-footer::after { right: -17%; transform: rotate(-12deg); }
.legal-links { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
.legal-links a { color: #007173; font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: .17em; }
.legal-links a + a { padding-left: 16px; border-left: 1px solid #8db1ba; }

@media (min-width: 1369px) {
  .hero-visual::after {
    background:
      linear-gradient(90deg, #edfbfc, #effcfcdd 5%, #f4fdfc00 25%),
      linear-gradient(0deg, #f5fcfd 0%, #f7fdfe00 14%),
      linear-gradient(270deg, #c9f4f6, #c9f4f600 12%);
  }
}
@media (max-width: 760px) {
  .topbar-inner {
    min-height: 56px;
    gap: 8px;
    padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }
  .brand { gap: 7px; font-size: clamp(15px, 4.45vw, 23px); }
  .brand img { width: clamp(32px, 9vw, 42px); height: auto; }
  .home-link { display: none; }
  .account-actions { gap: clamp(5px, 3vw, 18px); --control-height: 32px; }
  .site-language { width: clamp(63px, 18.4vw, 83px); }
  .mobile-menu-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #dce7eb;
    border-radius: 50%;
    background: #f4f7f8;
    color: var(--navy);
    cursor: pointer;
  }
  .mobile-menu-toggle svg { width: 22px; height: 22px; }
  .mobile-menu-toggle[aria-expanded=true] { border-color: #8fc9cf; background: #e7f5f6; }
  .mobile-menu-toggle[aria-expanded=false] + .account-menu { display: none; }
  .account-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 162px;
    padding: 8px;
    border: 1px solid #d1e8eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px #102a4626;
  }
  .account-menu .account-control { justify-content: flex-start; height: 44px; border-radius: 8px; }
  .account-control.mobile-home-link { display: inline-flex; }
  #logout-error:not(:empty) { position: static; width: 100%; max-width: 200px; }

  .hero {
    --hero-height: clamp(195px, 53vw, 302px);
    --hero-fade: linear-gradient(black calc(100% - clamp(23px, 7vw, 38px)), transparent);
    -webkit-mask-image: var(--hero-fade);
    mask-image: var(--hero-fade);
  }
  .hero::before {
    inset: auto auto -19px -12%;
    width: 72%;
    min-width: 0;
    height: 59px;
    transform: rotate(6deg);
    background: #a9edf4a8;
  }
  .hero-inner { align-items: flex-start; padding: 0; }
  .hero-copy { width: 56%; padding: clamp(12px, 4vw, 28px) 2px 12px 8px; text-align: center; }
  .hero h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tagline { margin: 0 0 10px; font-size: clamp(14px, 4vw, 23px); line-height: 1.05; }
  .tagline span { display: block; }
  .description { margin-inline: auto; font-size: clamp(11px, 2.85vw, 15px); line-height: 1.29; }
  .hero-visual {
    inset: 0 0 0 auto;
    width: 72%;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 16%);
    mask-image: linear-gradient(90deg, transparent, black 16%);
  }
  .hero-visual img { object-position: 29% 58%; }
  .hero-visual::after {
    background: radial-gradient(ellipse at 0 20%, #f4fdfc 6%, #f4fdfc00 52%);
  }

  .featured { --gutter: clamp(13px, 4.6vw, 26px); padding-top: 5px; background: transparent; }
  .featured-heading { margin-bottom: clamp(13px, 4.7vw, 24px); }
  .featured-heading h2 { font-size: clamp(18px, 4.5vw, 25px); }
  .featured-heading p { font-size: clamp(11px, 2.75vw, 15px); }
  .destinations {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    max-width: 510px;
    gap: clamp(13px, 5vw, 26px);
    margin-inline: auto;
    padding: 5px 2px 12px;
    --book-height: clamp(166px, 60vw, 370px);
  }
  .feature { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .home-book { width: 100%; height: auto; }
  .home-book img { position: absolute; inset: 0; }
  .kids-home-card .home-book img { object-fit: cover; }
  .home-book-brand, .home-free-label, .home-book-foot { font-size: clamp(7px, 1.9vw, 10px); }
}
@media (max-width: 355px) {
  .topbar-inner { gap: 5px; padding-inline: 8px; }
  .brand { gap: 4px; font-size: 15px; }
  .account-actions { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-book { transition: none; }
  a.feature:hover .home-book { transform: perspective(600px) rotateY(-9deg) rotateZ(-1deg); }
}
