/* =========================================================
   Healthy Little Minds — Clean, Consistent Index Styles
   (CLEAN VERSION — duplicates removed, hidden fixed)
   ========================================================= */

/* ===== Respect the HTML hidden attribute (MUST be present) ===== */
[hidden]{
  display:none !important;
}

/* ===== Design tokens ===== */
:root{
  --ink:#254E70;
  --accent:#FF6B6B;
  --accent-dark:#b73030;
  --bg:#E6F4FA;
  --soft:#FFF7F0;
  --card:#ffffff;
  --muted:#555;
  --muted2:#777;
  --border:#eee;
  --radius:16px;
  --radius-lg:20px;
  --shadow:0 8px 20px rgba(0,0,0,.08);
  --shadow-soft:0 4px 12px rgba(0,0,0,.06);
  --header-h:80px;
}

/* Mobile header height tune (prevents “mystery gap” on iPhone) */
@media (max-width: 768px){
  :root{ --header-h: 64px; }
}

/* ===== Reset / base ===== */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family:'DM Sans', sans-serif;
  background:var(--bg);
  color:var(--ink);
  overflow-x:hidden;
}

body.index-page--tw{
  font-family:"Noto Sans TC", "DM Sans", "Microsoft JhengHei", Arial, sans-serif;
  line-height:1.7;
}

body.index-page--cn{
  font-family:"Noto Sans SC", "DM Sans", "Microsoft YaHei", Arial, sans-serif;
  line-height:1.7;
}

body.index-page--ja{
  font-family:"Noto Sans JP", "DM Sans", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height:1.72;
}

body.index-page--ko{
  font-family:"Noto Sans KR", "DM Sans", "Malgun Gothic", Arial, sans-serif;
  line-height:1.68;
}

.index-page--tw h1,
.index-page--tw h2,
.index-page--tw h3,
.index-page--tw .site-title,
.index-page--cn h1,
.index-page--cn h2,
.index-page--cn h3,
.index-page--cn .site-title,
.index-page--ja h1,
.index-page--ja h2,
.index-page--ja h3,
.index-page--ja .site-title,
.index-page--ko h1,
.index-page--ko h2,
.index-page--ko h3,
.index-page--ko .site-title{
  font-family:inherit;
  letter-spacing:0;
}

.loading-screen{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  background:#fff8f2;
  color:var(--ink);
  font-size:1rem;
}

.loading-screen .spinner{
  width:48px;
  height:48px;
  margin-bottom:1rem;
  border:5px solid #ffdd59;
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 1s linear infinite;
}

.loading-screen p{
  margin:0;
  font-weight:700;
}

/* Content wrapper gets spacing for the fixed header */
.page-container{
  padding-top: calc(var(--header-h) + 12px);
}

/* ===== Header (fixed) ===== */
.site-header{
  position:fixed;
  top:0; left:0; right:0;
  height:var(--header-h);
  z-index:1100;
  background:var(--card);
  border-bottom:1px solid var(--border);
  box-shadow:0 2px 8px rgba(0,0,0,.05);
  padding: 0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.header-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.brand-logo,
.brand-name-link{
  color:inherit;
  text-decoration:none;
}

.logo{
  height:34px;
  width:auto;
  display:block;
}

.site-title{
  font-family:"Nunito", sans-serif;
  font-size:1.25rem;
  font-weight:800;
  letter-spacing:.2px;
  color:var(--ink);
  white-space:nowrap;
}

.site-title span{ color:var(--accent); }

/* Desktop nav */
.main-nav{
  display:flex;
  align-items:center;
  gap:1rem;
}

.main-nav a{
  text-decoration:none;
  font-weight:600;
  color:var(--ink);
  white-space:nowrap;
}

.about-btn{
  padding:.45rem .9rem;
  border-radius:999px;
  border:1px solid #e7eef5;
  background:#f7fafc;
}

.about-btn:hover{
  background:#eef6ff;
}

/* Get Access button (one animation only) */
.get-access-btn{
  background-color: var(--accent-dark);
  color:#fff !important;
  padding: .55rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration:none;
  display:inline-block;
  transition: background-color .25s ease, box-shadow .25s ease, transform .2s ease;
  animation: glowPulse 1.6s infinite alternate;
}
.get-access-btn:hover{
  background-color:#a52828;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(217,59,59,.75);
  animation-play-state: paused;
}
@keyframes glowPulse{
  from { box-shadow: 0 0 6px rgba(217,59,59,.35), 0 0 12px rgba(217,59,59,.20); }
  to   { box-shadow: 0 0 18px rgba(217,59,59,.85), 0 0 28px rgba(217,59,59,.55); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .get-access-btn{ animation:none !important; }
  .fade-in, .login-box, .welcome-banner{ animation:none !important; }
}

/* ===== Mobile Hamburger + Dropdown ===== */
.hamburger{
  display:none;
  width:40px; height:40px;
  border:1px solid #e6e6e6;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:8px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.hamburger span{
  display:block;
  width:18px; height:2px;
  background:#1f2d3a;
  border-radius:2px;
}

/* Dropdown */
.menu-dropdown{
  position:fixed;
  top: calc(var(--header-h) + 8px);
  right:16px;
  width:240px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
  padding:8px;
  display:none;
  transform-origin: top right;
  transform: scale(.98) translateY(-6px);
  opacity:0;
  transition: transform .15s ease, opacity .15s ease;
  z-index:1099;
}
.menu-dropdown a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  margin:4px 0;
  border-radius:10px;
  color:var(--ink);
  text-decoration:none;
  font-weight:600;
}
.menu-dropdown a:hover{ background:#f7fafc; }

.menu-dropdown.open{
  display:block;
  transform: scale(1) translateY(0);
  opacity:1;
}

/* Backdrop under dropdown */
.menu-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
  z-index:1098;
}

/* Responsive nav behavior */
@media (max-width: 800px){
  .main-nav{ display:none; }
  .hamburger{ display:inline-flex; }
}

/* ===== Section / layout ===== */
.section{
  background:var(--card);
  padding:2rem;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  max-width: 1080px;
}

.preview-section{
  padding: 3rem 1rem;
  max-width: 1080px;
  margin: 0 auto;
}

/* Headings */
h2{
  text-align:center;
  font-size:2rem;
  font-weight:800;
  color:var(--ink);
  margin: 1.5rem 0 1rem;
}

/* ===== Welcome banner ===== */
.welcome-banner{
  background: linear-gradient(135deg, #fff7f5, #fffaf0);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  max-width: 900px;
  margin: 1.25rem auto 1.5rem;
  animation: fadeIn 1s ease-out;
}

.welcome-banner h2{
  margin: 0 0 .8rem;
  color: var(--accent);
  font-size: 1.8rem;
}

.welcome-banner p{
  font-size: 1.05rem;
  color: #444;
  margin: .5rem 0;
}

@keyframes fadeIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

/* ===== Video wrapper ===== */
.video-wrapper{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin: 1rem auto 2rem;
  padding: 0 1rem;
}

.video-wrapper h3{
  margin: .2rem 0 .75rem;
  text-align:center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}

.video-wrapper video{
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor:pointer;
}

.video-wrapper p{
  font-size:.9rem;
  color: var(--muted2);
  margin-top:.5rem;
  text-align:center;
}

.video-caption{
  max-width:360px;
  color:#536a7a;
}

/* ===== Login ===== */
.member-entry{
  width:min(920px, 92vw);
  margin:2.5rem auto;
}

.member-entry-grid{
  display:grid;
  grid-template-columns:minmax(300px, 1.05fr) minmax(290px, .95fr);
  gap:1rem;
  align-items:stretch;
}

.login-box{
  background: var(--card);
  padding:clamp(1.35rem, 3vw, 2rem);
  border:1px solid rgba(37,78,112,.1);
  border-radius:8px;
  box-shadow:0 12px 28px rgba(37,78,112,.08);
  text-align:center;
  display:flex;
  flex-direction:column;
  justify-content:center;
  animation: fadeInUp .6s ease forwards;
}

.entry-card-label{
  display:inline-flex;
  align-self:center;
  margin:0 0 .8rem;
  padding:.32rem .7rem;
  border-radius:999px;
  background:#edf6fb;
  color:var(--ink);
  font-size:.78rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.login-box h3,
.audiobook-card h3{
  margin:0 0 .5rem;
  color:var(--ink);
  font-family:"Nunito", sans-serif;
  font-size:1.45rem;
  line-height:1.25;
}

.login-box > p:not(.entry-card-label){
  margin:.15rem 0 .5rem;
  color:#526878;
}

input[type="password"]{
  padding:12px;
  width:100%;
  min-height:44px;           /* D1: 44px touch target */
  border:1px solid #ccc;
  border-radius:12px;
  margin-top:10px;
  font-size:1rem;
  font-family:inherit;       /* D1: inherit brand font */
}

button{
  margin-top: 15px;
  padding: 12px 20px;
  min-height: 44px;           /* D1: 44px touch target */
  background: var(--accent);
  color: #fff;
  border:none;
  border-radius: 30px;
  font-weight: 800;
  font-size: 1rem;
  font-family: inherit;       /* D1: inherit brand font */
  cursor:pointer;
  transition: background .25s ease, transform .2s ease;
  width:100%;
  max-width: 350px;
}
button:hover{
  background:#e74c3c;
  transform: translateY(-1px);
}

.login-actions{ margin-top:14px; }

.access-note{
  margin:0 0 .8rem;
  font-size:.94rem;
  color: var(--muted);
  text-align:center;
}

.access-note a{
  color: var(--accent);
  font-weight: 700;
  text-decoration:none;
}
.access-note a:hover{ text-decoration:underline; }

.dark-mode-toggle-container{
  margin-top:14px;
  text-align:center;
}

.dark-mode-toggle{
  background:#f3f8fb;
  color:var(--ink);
  border:1px solid #dce7eb;
  border-radius:7px;
  padding:8px 12px;
  font-size: .9rem;
  font-weight: 700;
  cursor:pointer;
  width: auto;
}

/* ===== Grid + Cards ===== */
.grid{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 1.5rem;
}

.card{
  width: 260px;
  min-height: 480px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding: 1rem;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
  text-align:center;
  position:relative;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor:pointer;
}

.card:hover{
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

.card img{
  height: 240px;
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.card h3{
  margin: .5rem 0 .25rem;
  font-size: 1.05rem;
  color: var(--ink);
}

.card p{
  font-size: .92rem;
  color: var(--muted);
  flex-grow: 1;
  margin: 0;
}

/* Buttons inside cards (use .btn in your HTML) */
.card .btn{
  margin-top: .8rem;
  display:inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration:none;
  background: var(--accent);
  color:#fff;
  transition: background .25s ease, transform .2s ease;
}
.card .btn:hover{
  background:#e74c3c;
  transform: translateY(-1px);
}

/* Members badge (single system) */
.card::after{
  content:"🔒 Members";
  position:absolute;
  top:10px;
  right:10px;
  background: var(--accent);
  color:#fff;
  font-size:.75rem;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight:800;
  z-index:2;
}
.card.free-access::after{ content:none; }

.index-page--tw .card:not(.free-access)::after{ content:"會員"; }
.index-page--cn .card:not(.free-access)::after{ content:"會員"; }
.index-page--ja .card:not(.free-access)::after{ content:"メンバー"; }
.index-page--ko .card:not(.free-access)::after{ content:"회원"; }

/* Free label (green) */
.label-free{
  position:absolute;
  top:10px;
  left:10px;
  background:#38b000;
  color:#fff;
  font-size:.75rem;
  font-weight:800;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0,0,0,.10);
  z-index:3;
}

/* ===== Characters ===== */
.character-showcase{
  width:min(1120px, 92vw);
  margin:2.25rem auto;
  padding:clamp(1.2rem, 3vw, 2rem);
  border:1px solid rgba(37,78,112,.08);
  border-radius:20px;
  background:#fff;
}

.character-instructions{
  text-align:center;
  font-size:1rem;
  color:var(--ink);
  margin-top:-.25rem;
  margin-bottom:1rem;
  font-weight:600;
}

.character-filters{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 0 auto 1.2rem;
  padding: 0 1rem;
  max-width: 980px;
}

.filter-btn{
  background:#f3f8fb;
  color:var(--ink);
  border:1px solid #dce7eb;
  border-radius:7px;
  padding:9px 15px;
  cursor:pointer;
  font-size:.95rem;
  font-weight:800;
  transition: background-color .2s ease, transform .15s ease;
}
.filter-btn:hover{
  background:#eaf5f8;
  transform: translateY(-1px);
}

.filter-btn.is-active{
  background:var(--ink);
  border-color:var(--ink);
  color:#fff;
}

.character-grid{
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  justify-content:center;
  padding: 0 1rem;
}

.character-card{
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,.10);
  width:min(220px, 100%);
  text-align:center;
  padding: 15px;
  cursor:pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  position:relative;
}

.character-card:hover{ transform: scale(1.03); }

.character-card:focus-visible{
  outline:3px solid #ffdd59;
  outline-offset:3px;
}

.character-card img{
  width:100%;
  border-radius:10px;
}

.character-name{
  font-size:1.2rem;
  font-weight:900;
  color: var(--accent);
  margin-top: .5rem;
}

.character-info{
  display:none;
  padding: 10px;
  background:#f9f9f9;
  border-radius: 10px;
  margin-top: .6rem;
  color:#333;
  text-align:left;
  font-size:.95rem;
  line-height:1.45;
}

.character-card.expanded .character-info{
  display:block;
}

/* Tooltip */
#mood-tooltip{
  position:absolute;
  background:#000;
  color:#fff;
  padding:5px 10px;
  border-radius:6px;
  font-size:14px;
  display:none;
  z-index:20;
}

/* ===== Audiobook card ===== */
.audiobook-card{
  position:relative;
  background: var(--card);
  padding:1.35rem;
  border:1px solid rgba(37,78,112,.1);
  border-radius:8px;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  box-shadow:0 12px 28px rgba(37,78,112,.08);
}

.audiobook-card img{
  width:min(230px, 100%);
  height:245px;
  object-fit:cover;
  border-radius: 8px;
  margin:.9rem auto .8rem;
}

.audio-label{
  position:absolute;
  top:12px;
  left:12px;
  background:#27c76a;
  color:#fff;
  font-size:.75rem;
  font-weight:900;
  padding: .35rem .7rem;
  border-radius:7px;
  z-index:2;
}

.audiobook-card h3{
  margin-top:1.2rem;
}

.audio-title{
  margin:0 0 .4rem;
  font-size: 1rem;
  font-weight:800;
  color:#333;
}

.audio-description{
  margin:0 0 .9rem;
  max-width:29ch;
  color:#526878;
  font-size:.92rem;
  line-height:1.45;
}

.audiobook-card .btn{
  margin-top:auto;
}

/* ===== Testimonials ===== */
.testimonial{
  min-height:155px;
  margin:0;
  padding:1.35rem;
  border:1px solid rgba(37,78,112,.1);
  border-radius:8px;
  background:#fff;
  color:#3d5667;
  font-size:1rem;
  line-height:1.65;
}

.testimonials{
  width:min(1120px, 92vw);
  margin:2.5rem auto;
}

.testimonial-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.8rem;
}

/* ===== Footer ===== */
footer{
  text-align:center;
  padding: 2rem 1rem;
  font-size: .95rem;
  background: var(--card);
  color: var(--muted2);
  border-top: 1px solid var(--border);
}

.site-footer{
  margin-top:2rem;
  background:#fff;
}

.copyright{
  margin:0;
  color:#526878;
}

.social-icons{
  display:flex;
  justify-content:center;
  gap:.45rem;
  margin-top:.9rem;
}

.social-icon{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border:1px solid var(--border);
  border-radius:8px;
}

.social-icons .social-icon img{
  margin:0;
}

.tool-card{
  color:inherit;
  text-decoration:none;
}

.tools-preview .tool-card{
  width:min(100%, 360px);
  margin-inline:auto;
}

.locale-intro,
.locale-note{
  text-align:center;
}

.locale-note{
  margin:.75rem 0 0;
  color:#4f6474;
}

.social-icons img{
  width:26px;
  height:26px;
  margin: 0 12px;
  transition: transform .2s ease;
  cursor:pointer;
}
.social-icons img:hover{ transform: scale(1.15); }

/* ===== Language switcher (fixed) ===== */
.language-switcher{
  position:fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255,255,255,.9);
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  z-index: 1200;
  display:flex;
  gap: 8px;
  align-items:center;
}
.language-switcher img{
  width:22px;
  height:22px;
  cursor:pointer;
  transition: transform .15s ease;
}
.language-switcher img:hover{ transform: scale(1.08); }

/* ===== Animations ===== */
@keyframes fadeInUp{
  from{ opacity:0; transform: translateY(20px); }
  to{ opacity:1; transform: translateY(0); }
}

.fade-in{
  opacity:0;
  animation: fadeInUp .8s ease-out forwards;
  animation-delay: .1s;
}

@keyframes spin{
  0%{ transform: rotate(0deg); }
  100%{ transform: rotate(360deg); }
}

/* ===== Dark mode ===== */
body.dark-mode{
  background:#121212;
  color:#f5f5f5;
}

body.dark-mode .site-header{
  background:#1e1e1e;
  border-bottom:1px solid #2a2a2a;
  box-shadow:none;
}

body.dark-mode .main-nav a,
body.dark-mode .site-title{
  color:#f5f5f5;
}

body.dark-mode .section,
body.dark-mode .card,
body.dark-mode .character-card,
body.dark-mode .login-box,
body.dark-mode .audiobook-card,
body.dark-mode footer{
  background:#1f1f1f;
  color:#fff;
  border-color:#2a2a2a;
  box-shadow: 0 0 10px rgba(255,255,255,.05);
}

body.dark-mode .card p,
body.dark-mode .testimonial,
body.dark-mode .welcome-banner p{
  color:#ddd;
}

body.dark-mode .character-info{
  background:#2a2a2a;
  color:#fff;
}

body.dark-mode input[type="password"]{
  background:#2c2c2c;
  border:1px solid #555;
  color:#fff;
}

body.dark-mode .filter-btn{
  background:#2c2c2c;
  color:#fff;
  border:1px solid #555;
}

body.dark-mode .filter-btn.is-active{
  background:#e7f5f7;
  border-color:#e7f5f7;
  color:var(--ink);
}

body.dark-mode .dark-mode-toggle{
  background:#444;
  color:#fff;
}

/* Smooth theme transitions */
body,
.section,
.card,
.character-card,
.login-box{
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ===== Mobile tweaks ===== */
@media (max-width: 768px){
  body{
    padding-bottom:70px;
  }

  h2{ font-size: 1.6rem; }

  .grid{ flex-direction:column; }
  .card{
    width: min(92vw, 360px);
    min-height: auto;
  }
  .card img{
    height: 220px;
  }

  .character-grid{
    flex-direction:column;
    gap: 1rem;
    padding:0;
  }
  .character-card{
    width:100%;
    max-width:360px;
    margin: 0 auto;
  }

  .filter-btn{
    font-size: .88rem;
    padding: 8px 12px;
  }

  .language-switcher{
    bottom:max(12px, env(safe-area-inset-bottom));
    left:50%;
    right:auto;
    transform:translateX(-50%);
    padding:8px 12px;
    border-radius:999px;
    border-color:#dce7eb;
    box-shadow:0 8px 20px rgba(37,78,112,.16);
  }
}

/* ===== New Year banner (single, clean) ===== */
.newyear-banner{
  background: linear-gradient(135deg, #fff7f0, #fff1e6);
  border: 1px solid #ffe0c2;
  color: #254E70;
  padding: 14px 16px;
  border-radius: 14px;
  margin: 0 auto 1rem;
  max-width: 900px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(0,0,0,.06);

  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.newyear-banner p{
  margin:0;
  font-weight:600;
  font-size:1rem;
}

.newyear-banner button{
  background:#FF6B6B;
  color:#fff;
  border:none;
  border-radius:999px;
  padding:6px 14px;
  font-weight:700;
  cursor:pointer;
  width:auto;
  max-width:none;
  margin-top:0;
}

.newyear-banner button:hover{
  background:#e74c3c;
}

@keyframes softSparkle{
  0%, 100% { box-shadow: 0 0 0 rgba(255,107,107,0); }
  50% { box-shadow: 0 0 18px rgba(255,107,107,.25); }
}

.newyear-highlight{
  animation: softSparkle 2.5s ease-in-out infinite;
}

/* ===== Multilingual flags (single clean block) ===== */
.langs{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.langs img{
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: cover;
  border-radius: 50%;
  display:block;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.langs img:hover{
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}

@media (max-width: 480px){
  .langs{ gap:10px; }
  .langs img{
    width:30px !important;
    height:30px !important;
  }
}

/* ===== Welcome Audio Bar ===== */
.welcome-audio{
  margin: 2rem auto;
  max-width: 1100px;
  padding: 0 1rem;
}

.welcome-audio-inner{
  background:#ffffff;
  border-radius:20px;
  padding: 1rem 1.25rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.welcome-audio-left{
  display:flex;
  align-items:center;
  gap: .75rem;
}

.welcome-icon{
  width:42px;
  height:42px;
  border-radius:12px;
  background:#fff0f0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.4rem;
}

.welcome-title{
  font-weight:700;
  color:#254E70;
}

.welcome-subtitle{
  font-size:.95rem;
  font-weight:600;
  color:#254E70;
}

.welcome-helper{
  font-size:.85rem;
  color:#666;
}

.welcome-audio-right{
  display:flex;
  align-items:center;
  gap:.75rem;
}

.welcome-btn{
  background:#254E70;
  color:#fff;
  border:none;
  border-radius:999px;
  padding:.5rem 1rem;
  font-weight:600;
  cursor:pointer;
  width:auto;
  max-width:none;
  margin-top:0;
}

.welcome-btn:hover{
  background:#1e3f5f;
}

.welcome-link{
  color:#FF6B6B;
  font-weight:600;
  text-decoration:none;
  white-space:nowrap;
}

.welcome-link:hover{
  text-decoration:underline;
}

/* Mobile layout for audio bar */
@media (max-width: 768px){
  .welcome-audio-inner{
    flex-direction:column;
    align-items:flex-start;
  }
  .welcome-audio-right{
    width:100%;
    justify-content:space-between;
  }
}

/* ===== HERO SECTION ===== */

.hero-section {
  position: relative;
  overflow: hidden;

  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;

  background:
    linear-gradient(
      180deg,
      #fff9f4 0%,
      #f8f4ff 100%
    );
}


/* ===== CONTENT ===== */

.hero-content {
  position: relative;
  z-index: 2;

  max-width: 700px;
  text-align: center;
}


/* ===== TITLE ===== */

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);

  line-height: 1.1;

  color: #5b4b8a;

  font-weight: 800;

  letter-spacing: -0.03em;

  margin-bottom: 1.2rem;
}


/* ===== SUBTITLE ===== */

.hero-subtitle {
  font-size: 1.15rem;

  line-height: 1.8;

  color: #6d6d6d;

  max-width: 600px;

  margin: 0 auto 2rem auto;
}


/* ===== BUTTON ===== */

.hero-button {
  display: inline-block;

  padding: 1rem 2rem;

  border-radius: 999px;

  background: #7b68ee;

  color: white;

  text-decoration: none;

  font-weight: 600;

  transition: all 0.3s ease;

  box-shadow:
    0 10px 30px rgba(123, 104, 238, 0.2);
}

.hero-button:hover {
  transform: translateY(-4px);

  box-shadow:
    0 14px 35px rgba(123, 104, 238, 0.3);
}

/* ===== 2026 access page refinement ===== */
.access-hero{
  width:min(1120px, 92vw);
  margin: 1.25rem auto 1.5rem;
  display:grid;
  grid-template-columns:minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 1.25rem;
  align-items:stretch;
}

.access-hero-copy,
.access-hero-panel,
.library-heading{
  background:#fff;
  border:1px solid rgba(37,78,112,.08);
  box-shadow:0 14px 32px rgba(37,78,112,.09);
}

.access-hero-copy{
  border-radius:18px;
  padding:clamp(1.35rem, 2vw, 2.25rem);
}

.eyebrow{
  margin:0 0 .45rem;
  color:#b73030;
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.access-hero h1{
  margin:0;
  max-width: 760px;
  color:#254E70;
  font-family:"Nunito", sans-serif;
  font-size:clamp(2rem, 4vw, 4.25rem);
  line-height:1.02;
  letter-spacing:0;
}

.access-hero-copy > p:not(.eyebrow){
  max-width: 62ch;
  margin: 1rem 0 0;
  color:#3f5668;
  font-size:1.06rem;
  line-height:1.65;
}

.access-hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1.25rem;
}

.hero-primary,
.hero-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:.7rem 1rem;
  border-radius:999px;
  font-weight:900;
  text-decoration:none;
}

.hero-primary{
  background:#FF6B6B;
  color:#fff;
  box-shadow:0 10px 20px rgba(255,107,107,.24);
}

.hero-secondary{
  background:#F3FAFD;
  color:#254E70;
  border:1px solid #d9edf6;
}

.access-hero-panel{
  border-radius:18px;
  padding:1rem;
  display:grid;
  gap:.75rem;
}

.access-hero-panel div{
  padding:1rem;
  border-radius:14px;
  background:linear-gradient(135deg, #FFF7F0, #F5FBFF);
}

.access-hero-panel strong,
.access-hero-panel span{
  display:block;
}

.access-hero-panel strong{
  color:#254E70;
  font-family:"Nunito", sans-serif;
  font-size:1.05rem;
}

.access-hero-panel span{
  margin-top:.35rem;
  color:#4f6474;
  line-height:1.45;
  font-size:.94rem;
}

.library-preview{
  width:min(1120px, 92vw);
  margin:0 auto 2rem;
}

.library-heading{
  border-radius:16px;
  padding:1.25rem;
  text-align:center;
  margin-bottom:1rem;
}

.library-heading h2{
  margin:.15rem 0 .4rem;
}

.library-heading p:last-child{
  margin:0;
  color:#536a7a;
}

.library-preview .grid{
  align-items:stretch;
}

.library-preview .card{
  border:1px solid rgba(37,78,112,.08);
}

.library-preview .card p{
  font-weight:800;
  color:#254E70;
}

.welcome-banner{
  border:1px solid rgba(255,107,107,.16);
}

.video-wrapper{
  width:min(920px, 92vw);
  background:rgba(255,255,255,.58);
  border:1px solid rgba(37,78,112,.08);
  border-radius:18px;
  padding:1rem;
}

/* ===== Landing pathways and member value ===== */
.landing-heading{
  max-width:720px;
  margin:0 auto 1.35rem;
  text-align:center;
}

.landing-heading h2{
  margin:.1rem 0 .45rem;
  color:var(--ink);
  font-family:"Nunito", sans-serif;
  font-size:clamp(1.65rem, 3vw, 2.25rem);
  line-height:1.18;
}

.landing-heading > p:last-child{
  margin:0;
  color:#526878;
  line-height:1.55;
}

.pathways-section,
.journey-section,
.member-benefits,
.faq-section{
  width:min(1120px, 92vw);
  margin:2rem auto;
}

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

.pathway-card{
  --card-tint:#f3fafd;
  min-height:244px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:1.3rem;
  border:1px solid rgba(37,78,112,.08);
  border-radius:18px;
  background:linear-gradient(145deg, #fff, var(--card-tint));
  box-shadow:0 8px 24px rgba(37,78,112,.07);
}

.pathway-card--children{ --card-tint:#fff4eb; }
.pathway-card--parents{ --card-tint:#edf8f1; }
.pathway-card--teachers{ --card-tint:#edf5fc; }

.pathway-icon{
  display:grid;
  place-items:center;
  width:45px;
  height:45px;
  margin-bottom:.8rem;
  border-radius:13px;
  background:#fff;
  color:var(--accent);
  font-size:1.45rem;
  font-weight:800;
}

.pathway-card h3{
  margin:0 0 .4rem;
  font-family:"Nunito", sans-serif;
  color:var(--ink);
  font-size:1.3rem;
}

.pathway-card p{
  flex:1;
  margin:0 0 1rem;
  color:#526878;
  line-height:1.55;
}

.pathway-card a{
  color:var(--accent-dark);
  font-weight:800;
  text-decoration:none;
}

.pathway-card a:hover,
.pathway-card a:focus-visible{
  text-decoration:underline;
}

.journey-section{
  padding:clamp(1.25rem, 3vw, 2rem);
  border-radius:22px;
  background:#fff;
  border:1px solid rgba(37,78,112,.08);
}

.journey-steps{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:1rem;
}

.journey-step{
  position:relative;
  padding:1.1rem 1rem 1rem 3.6rem;
  border-radius:15px;
  background:#f7fbfd;
}

.journey-step > span{
  position:absolute;
  top:1.05rem;
  left:1rem;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:50%;
  background:#FFDD59;
  color:var(--ink);
  font-weight:900;
}

.journey-step h3{
  margin:0 0 .22rem;
  font-family:"Nunito", sans-serif;
  font-size:1.15rem;
}

.journey-step p{
  margin:0;
  color:#526878;
  font-size:.94rem;
  line-height:1.5;
}

.member-benefits{
  padding:clamp(1.3rem, 3vw, 2rem);
  border-radius:22px;
  background:linear-gradient(145deg, #fff8ee, #f3fbff);
  border:1px solid rgba(37,78,112,.08);
}

.access-comparison{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:1rem;
}

.access-card{
  padding:clamp(1.1rem, 3vw, 1.55rem);
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(37,78,112,.08);
}

.access-card--full{
  border-color:rgba(255,107,107,.25);
  box-shadow:0 12px 26px rgba(255,107,107,.1);
}

.access-label{
  display:inline-flex;
  margin:0 0 .7rem;
  padding:.25rem .65rem;
  border-radius:999px;
  background:#e7f5eb;
  color:#277148;
  font-size:.79rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.access-card--full .access-label{
  background:#ffe8e8;
  color:var(--accent-dark);
}

.access-card h3{
  margin:0 0 .65rem;
  color:var(--ink);
  font-family:"Nunito", sans-serif;
  font-size:1.35rem;
}

.access-card ul{
  margin:0 0 1.2rem;
  padding-left:1.2rem;
  color:#526878;
  line-height:1.7;
}

.compare-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:.68rem 1rem;
  border-radius:999px;
  background:var(--accent-dark);
  color:#fff;
  font-weight:900;
  text-decoration:none;
}

.compare-link--quiet{
  background:#edf6fb;
  color:var(--ink);
}

.access-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.8rem;
  align-items:center;
}

.member-login-link{
  color:var(--accent-dark);
  font-weight:800;
  text-decoration:none;
}

.trust-note{
  width:min(1040px, 92vw);
  margin:2.25rem auto;
  padding:clamp(1.2rem, 3vw, 1.65rem);
  border-radius:20px;
  border:1px solid #ddebf2;
  background:#f5fbfd;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1.5rem;
}

.trust-note h2{
  margin:.05rem 0 .45rem;
  font-family:"Nunito", sans-serif;
  color:var(--ink);
}

.trust-note p:last-child{
  max-width:690px;
  margin:0;
  color:#526878;
  line-height:1.58;
}

.trust-link{
  flex:0 0 auto;
  padding:.7rem 1.05rem;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  font-weight:800;
  text-decoration:none;
}

.faq-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:.85rem;
}

.faq-grid details{
  padding:1rem 1.05rem;
  border:1px solid rgba(37,78,112,.1);
  border-radius:15px;
  background:#fff;
}

.faq-grid summary{
  color:var(--ink);
  cursor:pointer;
  font-weight:800;
  list-style-position:outside;
}

.faq-grid p{
  margin:.75rem 0 0;
  color:#526878;
  line-height:1.55;
}

body.dark-mode .pathway-card,
body.dark-mode .journey-section,
body.dark-mode .journey-step,
body.dark-mode .member-benefits,
body.dark-mode .access-card,
body.dark-mode .trust-note,
body.dark-mode .faq-grid details{
  background:#1f1f1f;
  color:#fff;
  border-color:#313131;
}

body.dark-mode .landing-heading h2,
body.dark-mode .pathway-card h3,
body.dark-mode .journey-step h3,
body.dark-mode .access-card h3,
body.dark-mode .login-box h3,
body.dark-mode .audiobook-card h3,
body.dark-mode .trust-note h2,
body.dark-mode .faq-grid summary{
  color:#fff;
}

body.dark-mode .landing-heading > p:last-child,
body.dark-mode .pathway-card p,
body.dark-mode .journey-step p,
body.dark-mode .access-card ul,
body.dark-mode .login-box > p:not(.entry-card-label),
body.dark-mode .audio-description,
body.dark-mode .trust-note p:last-child,
body.dark-mode .faq-grid p{
  color:#ddd;
}

@media (max-width: 820px){
  .access-hero{
    grid-template-columns:1fr;
  }

  .access-hero-actions a{
    flex:1 1 210px;
  }

  .pathway-grid,
  .journey-steps,
  .access-comparison,
  .member-entry-grid,
  .faq-grid,
  .testimonial-grid{
    grid-template-columns:1fr;
  }

  .pathway-card{
    min-height:auto;
  }

  .trust-note{
    flex-direction:column;
    align-items:flex-start;
  }

  .member-entry{
    width:min(94vw, 420px);
  }

  .testimonial{
    min-height:auto;
  }
}

@media (max-width: 520px){
  .access-hero,
  .library-preview,
  .pathways-section,
  .journey-section,
  .member-benefits,
  .faq-section,
  .trust-note,
  .character-showcase,
  .testimonials{
    width:min(94vw, 420px);
  }

  .access-hero-copy,
  .access-hero-panel,
  .library-heading{
    border-radius:14px;
  }

  .access-hero-actions{
    flex-direction:column;
  }

  .access-card-actions{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* =====================================================
   Phase A additions — footer lang nav + testimonial attribution
   ===================================================== */

/* Footer language links */
.footer-langs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-langs a {
  display: inline-flex;
  align-items: center;
}

.footer-langs img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: transform .15s ease;
}

.footer-langs img:hover {
  transform: scale(1.1);
}

/* Testimonial attribution line inside blockquote */
.testimonial footer {
  display: block;
  margin-top: .65rem;
  font-size: .88rem;
  font-weight: 700;
  color: #7a9aae;
}

/* Testimonial blockquote reset */
.testimonial p:first-child {
  margin: 0 0 .4rem;
  font-size: .95rem;
}

.testimonial p:last-of-type {
  margin: 0;
  font-style: italic;
}

/* =====================================================
   Phase D additions — style-index.css
   ===================================================== */

/* D2 — Login error message (replaces inline styles from Phase C JS)
   The JS still creates the element dynamically; these classes give
   it proper themed styling instead of hardcoded inline CSS. */
#login-error-msg {
  margin: 0.6rem 0 0;
  padding: 0.65rem 0.9rem;
  background: #fff3cd;
  border: 1.5px solid #ffe082;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #5a3e00;
  white-space: pre-line;
  text-align: left;
}

body.dark-mode #login-error-msg {
  background: #3a2e00;
  border-color: #7a5a00;
  color: #ffe082;
}

/* D4 — Dark mode toggle remembers state via data-theme attribute
   set on <body> on load (see index.js Phase D update) */
[data-theme="dark"] body,
body.dark-mode {
  /* already covered by body.dark-mode rules — this selector ensures
     the attribute approach also works if used in future */
}

/* D1 — Ensure dark-mode-toggle button has a 44px touch target
   (it uses width:auto so the global button rule's max-width is
    overridden — we just need min-height to be explicit) */
.dark-mode-toggle {
  min-height: 44px;
}

/* D1 — Member entry section: ensure the login button specifically
   has full 44px height even on very small screens */
.login-box #loginButton {
  min-height: 48px;   /* slightly taller — this is the primary CTA */
  font-size: 1.05rem;
}

/* D1 — Mobile: stack login + audiobook card cleanly on 380px screens */
@media (max-width: 420px) {
  .member-entry-grid {
    grid-template-columns: 1fr;
  }

  .login-box,
  .audiobook-card {
    width: 100%;
  }

  input[type="password"],
  .login-box button {
    font-size: 1rem;   /* prevent iOS zoom on focus (needs 16px+) */
  }
}

/* D2 — Prevent iOS font-size zoom on password input (must be 16px) */
@media (max-width: 768px) {
  input[type="password"] {
    font-size: 16px;
  }
}

/* =====================================================
   Gentle motion layer
   Order: entrance, card lift, button feedback, selective glow.
   ===================================================== */
@keyframes hlm-index-soft-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hlm-index-glow {
  0%,
  100% {
    box-shadow: 0 14px 34px rgba(37, 78, 112, 0.1);
  }

  50% {
    box-shadow: 0 18px 42px rgba(20, 184, 166, 0.18);
  }
}

/* 1. Page and section entrance */
main > section,
.hero,
.section,
.member-entry,
.testimonial,
.audiobook-card,
.login-box {
  animation: hlm-index-soft-rise 0.56s ease-out both;
}

/* 2. Card hover lift */
.audiobook-card,
.login-box,
.testimonial,
.resource-card,
.story-card,
.book-card {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
  will-change: transform;
}

.audiobook-card:hover,
.login-box:hover,
.testimonial:hover,
.resource-card:hover,
.story-card:hover,
.book-card:hover {
  transform: translateY(-4px);
}

/* 3. Button press feedback */
.btn,
.login-box button,
.dark-mode-toggle {
  transition:
    transform 0.18s ease,
    box-shadow 0.24s ease,
    background-color 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease;
}

.btn:active,
.login-box button:active,
.dark-mode-toggle:active {
  transform: scale(0.98);
}

/* 4. Selective glow for featured entry points */
.audiobook-card,
.newyear-banner:not([hidden]) {
  animation:
    hlm-index-soft-rise 0.56s ease-out both,
    hlm-index-glow 5s ease-in-out infinite 0.8s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
