/* Homepage only. Colour tokens come from style.css, shared with the legal pages. */
.home {
  --green: #1B4D3E;
  --green-deep: #0F2F26;
  --saffron: #F5A623;
  --cream: #FAFBED;
  --on-green: #D5E4DA;
  --ink: #123529;
  --overhang: 56px;
}
.home ::selection { background: var(--saffron); color: var(--ink); }
.home :focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1192px; margin: 0 auto; padding: 0 32px; }
.home main { max-width: none; margin: 0; padding: 0; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0; padding: 24px 0; }
.brand { display: block; line-height: 0; }
.home .top img { width: 164px; height: auto; border-radius: 0; }
.top nav { display: flex; gap: 28px; }
.home .top nav a { position: relative; color: var(--muted); font-size: 17px; font-weight: 700; padding: 6px 0; }
.home .top nav a:hover { color: var(--text); }
.home .top nav a[aria-current] { color: var(--text); }
/* The current page is marked with the logo's pulli. */
.top nav a[aria-current]::after {
  content: ""; position: absolute; left: 50%; bottom: -3px;
  width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--saffron);
}

/* Hero: a green panel the phone breaks out of, top and bottom */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px;
  margin: calc(var(--overhang) + 8px) 0 calc(var(--overhang) + 72px);
  padding: 0 96px 0 64px;
  background: var(--green); border-radius: 56px; color: var(--cream);
}
.hero-copy { padding: 56px 0; text-align: center; }
.hero h1 {
  margin: 0 auto 16px; color: var(--cream);
  font-size: clamp(38px, 4.3vw, 56px); font-weight: 800; line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance;
}
.hero h1 span { display: block; color: var(--saffron); }
.home .hero-sub { max-width: 27em; margin: 0 auto 36px; color: var(--on-green); font-size: 21px; line-height: 1.4; text-wrap: balance; }
.home .hero-note { margin: 22px 0 0; color: var(--on-green); font-size: 15px; }
.hero-note strong { color: var(--cream); font-weight: 700; }

/* Store buttons: shown disabled until the listings are live */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.store {
  position: relative; display: inline-flex; align-items: center; gap: 10px; flex: 0 1 188px; min-width: 150px;
  padding: 11px 16px; border: 0; border-radius: 14px;
  background: var(--green-deep); color: var(--cream); box-shadow: inset 0 0 0 1px rgb(250 251 237 / 0.16);
  font: 800 18px/1.15 "Nunito", system-ui, sans-serif; text-align: left; white-space: nowrap; cursor: default;
}
.store svg { flex: none; width: 25px; height: 25px; fill: currentColor; }
.store-text small { display: block; color: var(--on-green); font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; }
.soon {
  position: absolute; top: -9px; right: -7px; padding: 2px 9px; border-radius: 999px;
  background: var(--saffron); color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 1.35;
  box-shadow: 0 2px 6px rgb(8 30 22 / 0.35);
}

/* Phone */
.phone {
  --w: 300px;
  position: relative; flex: none; width: var(--w); padding: calc(var(--w) * 0.034);
  background: #08100C; border-radius: calc(var(--w) * 0.165);
  box-shadow: 0 0 0 1.5px #39423D, 0 28px 56px -18px rgb(8 30 22 / 0.5), 0 8px 16px -8px rgb(8 30 22 / 0.3);
}
.phone::before, .phone::after { content: ""; position: absolute; width: 3px; background: #39423D; }
.phone::before { left: -3px; top: 22%; height: 11%; border-radius: 2px 0 0 2px; }
.phone::after { right: -3px; top: 27%; height: 15%; border-radius: 0 2px 2px 0; }
.phone img { display: block; width: 100%; height: auto; border-radius: calc(var(--w) * 0.132); }
.phone-hero { --w: 340px; margin: calc(var(--overhang) * -1) 0; animation: rise 1100ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes rise { from { transform: translateY(32px); } }

/* Story rows */
.story { display: flex; align-items: center; justify-content: center; gap: clamp(48px, 9vw, 128px); margin: 112px 0; }
.story-copy { flex: 0 1 30em; }
.home h2 { margin: 0 0 14px; color: var(--primary); font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
.story p { margin: 0 0 14px; font-size: 19px; line-height: 1.55; }
.story-flip { flex-direction: row-reverse; }

/* Jaffna and India side by side, set as type rather than a screenshot */
.contrast {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 64px;
  padding: 72px; background: var(--green); border-radius: 56px; color: var(--cream);
}
.home .contrast h2 { color: var(--cream); }
.home .contrast p { margin: 0; color: var(--on-green); font-size: 19px; line-height: 1.55; }
.pair dl { margin: 0; }
.home .contrast .pair-en { margin-bottom: 18px; color: var(--cream); font-size: 21px; font-weight: 700; }
.pair-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: baseline; padding: 16px 0; border-top: 1px solid rgb(250 251 237 / 0.2); }
.pair-row dt { color: var(--on-green); font-size: 15px; font-weight: 700; }
.pair-row dd { margin: 0; color: var(--on-green); font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.pair-row.is-jaffna dd { color: var(--saffron); font-weight: 800; }
.pair-row span[lang] { display: block; margin-top: 6px; color: var(--cream); font: 500 20px/1.4 "Noto Sans Tamil", "Nunito", sans-serif; }

/* Opening statement, set large with no panel */
.lead-in { max-width: 860px; margin: 0 0 96px; }
.home .lead-in h2 { color: var(--text); font-size: clamp(28px, 3.6vw, 44px); line-height: 1.18; text-wrap: pretty; }
.home .lead-in p { margin: 0; font-size: 21px; line-height: 1.45; max-width: 32em; }

/* Green and saffron side by side, the way the first two store images join */
.spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { display: flex; flex-direction: column; overflow: hidden; border-radius: 56px; }
.panel-copy { padding: 56px; }
.home .panel h2 { margin-bottom: 12px; }
.home .panel p { margin: 0 0 10px; font-size: 19px; line-height: 1.5; }
.tilted { display: block; width: 100%; height: auto; }
.panel-green { background: var(--green); }
.home .panel-green h2 { color: var(--cream); }
.home .panel-green p { color: var(--on-green); }
.panel-green .panel-copy { padding-bottom: 32px; }
.panel-green .tilted { width: 92%; margin: auto 0 0 auto; }
.panel-saffron { background: var(--saffron); }
.home .panel-saffron h2, .home .panel-saffron p { color: var(--ink); }
.panel-saffron .tilted { width: 92%; margin-left: auto; }
.panel-saffron .panel-copy { margin-top: auto; padding-top: 32px; }

/* Word tiles that play the app's own audio */
.words { margin: 96px 0 0; }
.home .words h2 { margin-bottom: 24px; }
.word-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.word {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 22px 24px; border: 1px solid var(--border); border-radius: 24px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  font-family: "Nunito", system-ui, sans-serif;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.word:hover { border-color: var(--primary); }
.word:active { transform: scale(0.98); }
.word svg { position: absolute; top: 22px; right: 20px; width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.word-latin { font-size: 25px; font-weight: 800; line-height: 1.2; }
.word-tamil { font: 500 18px/1.5 "Noto Sans Tamil", "Nunito", sans-serif; }
.word-en { margin-top: 8px; color: var(--muted); font-size: 15px; }
.word.is-playing { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }
.word.is-playing svg { stroke: var(--ink); }
.word.is-playing .word-en { color: var(--ink); }

/* A ladder that climbs, for the three levels in each pack */
.ladder { list-style: none; margin: 24px 0 0; padding: 0; }
.home .ladder li {
  width: fit-content; margin-top: 8px; padding: 9px 20px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 17px; font-weight: 700;
}
.ladder li:nth-child(2) { margin-left: 32px; }
.ladder li:nth-child(3) { margin-left: 64px; }

/* Two phones fanned between two notes */
.daily { margin: 128px 0; }
.daily-head { max-width: 34em; margin: 0 auto 64px; text-align: center; }
.home .daily-head p { margin: 0; font-size: 19px; line-height: 1.55; }
.daily-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 48px; }
.home .daily-note h3 { margin: 0 0 8px; color: var(--primary); font-size: 25px; font-weight: 800; line-height: 1.2; }
.home .daily-note p { margin: 0; font-size: 18px; line-height: 1.5; }
.daily-note:first-child { text-align: right; }
.fan { display: flex; padding: 12px 0; }
.fan .phone { --w: 256px; }
.fan .phone:first-child { rotate: -5deg; z-index: 1; }
.fan .phone:last-child { rotate: 5deg; margin: 28px 0 0 -8px; }

/* Closing panel */
.free { margin: 0 0 72px; padding: 72px 32px; background: var(--green); border-radius: 56px; text-align: center; }
.home .free h2 { color: var(--cream); }
.home .free p { max-width: 32em; margin: 0 auto 36px; color: var(--on-green); font-size: 19px; line-height: 1.5; text-wrap: balance; }

/* Footer */
.home footer { margin: 0; padding: 28px 0 40px; border-top: 1px solid var(--border); }
.home footer a { text-underline-offset: 3px; }
.home footer span { margin-left: auto; }

@media (max-width: 1040px) {
  .hero { padding: 0 48px 0 32px; gap: 32px; }
  .phone-hero { --w: 290px; }
  .contrast { grid-template-columns: 1fr; gap: 36px; padding: 56px 48px; }
  .panel-copy { padding: 40px; }
  .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .fan { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .daily-note:first-child { text-align: left; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .home { --overhang: 40px; }
  .top { padding: 16px 0; }
  .home .top img { width: 136px; }
  .top nav { gap: 20px; }
  .hero {
    grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px;
    margin: 8px 0 calc(var(--overhang) + 56px); padding: 0 20px; border-radius: 36px;
  }
  .hero-copy { padding: 44px 0 28px; }
  .home .hero-sub { font-size: 19px; margin-bottom: 28px; }
  .phone-hero { --w: min(72vw, 290px); margin: 0 0 calc(var(--overhang) * -1); }
  .story, .story-flip { flex-direction: column; align-items: flex-start; gap: 36px; margin: 72px 0; }
  .story .phone { --w: min(68vw, 270px); align-self: center; }
  .story-copy { flex: none; }
  .story p, .home .contrast p { font-size: 18px; }
  .contrast { padding: 40px 24px; border-radius: 36px; }
  .home footer span { margin-left: 0; flex-basis: 100%; }
  .lead-in { margin-bottom: 64px; }
  .spread { grid-template-columns: minmax(0, 1fr); }
  .panel { border-radius: 36px; }
  .panel-copy { padding: 32px 24px; }
  .home .panel p, .home .free p, .home .daily-head p { font-size: 18px; }
  .panel-green .panel-copy { padding-bottom: 24px; }
  .words { margin-top: 64px; }
  .word { padding: 18px; border-radius: 20px; }
  .word svg { top: 18px; right: 14px; width: 18px; height: 18px; }
  .word-latin { padding-right: 20px; font-size: 20px; }
  .ladder li:nth-child(2) { margin-left: 20px; }
  .ladder li:nth-child(3) { margin-left: 40px; }
  .daily { margin: 72px 0; }
  .daily-head { margin-bottom: 36px; text-align: left; }
  .daily-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .fan .phone { --w: min(44vw, 200px); }
  .fan .phone:last-child { margin-left: -2px; }
  .free { margin-bottom: 48px; padding: 48px 20px; border-radius: 36px; }
}

/* Phones settle into place as they scroll in. Offset only, so they are never hidden. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .story .phone, .fan .phone {
      animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 35%;
    }
    .panel-green .tilted {
      animation: settle-small linear both; animation-timeline: view(); animation-range: entry 0% cover 35%;
    }
    @keyframes settle { from { translate: 0 56px; } }
    @keyframes settle-small { from { translate: 0 32px; } }
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-hero { animation: none; }
  .word { transition: none; }
}
