/* ============================================================
   SURFI — Survival Finnish
   Brand: Finland Blue #003F88 | Amber Gold #FFB81C
   Font: Plus Jakarta Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #0E5C73;
  --blue-dark:  #0A3F4F;
  --blue-light: #e6f2f3;
  --pine:       #1F6F4F;
  --pine-dark:  #154E37;
  --gold:       #F4A700;
  --gold-dark:  #CC8A00;
  --white:      #ffffff;
  --gray-50:    #f7faf9;
  --gray-100:   #ebf1f0;
  --gray-300:   #c2cfcd;
  --gray-500:   #5f7672;
  --gray-700:   #324341;
  --text:       #15201e;
  --radius:     10px;
  --shadow-sm:  0 2px 8px rgba(14,92,115,.10);
  --shadow-md:  0 6px 24px rgba(14,92,115,.16);
  --nav-h:      68px;
  --font:       'Plus Jakarta Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* bottom nav bar offset on mobile */
@media (max-width: 768px) {
  body { padding-bottom: 68px; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography Scale ─────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem);  font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
p  { max-width: 68ch; }

/* ── Nav ──────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(95deg, var(--blue) 0%, var(--pine-dark) 100%);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0,0,0,.22);
  transition: box-shadow .3s, background .3s;
}

.site-nav.scrolled {
  box-shadow: 0 4px 28px rgba(0,0,0,.32);
  background: linear-gradient(95deg, var(--blue-dark) 0%, var(--pine-dark) 100%);
}

body {
  padding-top: var(--nav-h);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-spacer { width: 44px; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 24px;
  flex-shrink: 0;
}

.nav-brand .wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-brand .wordmark span {
  color: var(--gold);
}

.nav-brand .tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
}

.nav-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  transition: background .18s, color .18s;
  position: relative;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-links a .fi-label {
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255,255,255,.35);
  letter-spacing: 0.06em;
  margin-top: 1px;
  transition: color .18s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
}

.nav-links a:hover .fi-label,
.nav-links a.active .fi-label {
  color: var(--gold);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}

/* ── Page Header (inner pages) ────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 56px 24px 48px;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,184,28,.08) 0%, transparent 70%);
  pointer-events: none;
}

.page-header .eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.page-header h1 { color: var(--white); position: relative; }

.page-header p {
  color: rgba(255,255,255,.72);
  font-size: 1.05rem;
  margin: 12px auto 0;
  max-width: 55ch;
  position: relative;
}

/* ── Container ────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--gray-50); }

.section-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 40px;
}

.section-title .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

/* ── Cards ────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--blue-light);
}

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.card h3 { margin-bottom: 6px; }
.card p  { font-size: 0.9rem; color: var(--gray-500); }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
  transition: gap .18s;
}

.card-link:hover { gap: 9px; color: var(--blue-dark); }
.card-link::after { content: '→'; }

/* ── Vocab Table ──────────────────────────────────────────── */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.vocab-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.vocab-table th:first-child { border-radius: 8px 0 0 0; }
.vocab-table th:last-child  { border-radius: 0 8px 0 0; }

.vocab-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.vocab-table tr:last-child td { border-bottom: none; }
.vocab-table tr:nth-child(even) td { background: var(--gray-50); }

.vocab-table .fi { font-weight: 700; color: var(--blue); font-size: 1rem; }
.vocab-table .pron { color: var(--gray-500); font-style: italic; font-size: 0.88rem; }

/* ── Alphabet Grid ────────────────────────────────────────── */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.letter-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: 10px;
  padding: 16px 10px 12px;
  text-align: center;
  cursor: default;
  transition: border-color .18s, background .18s;
}

.letter-card:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.letter-card:hover .letter { color: var(--blue); }

.letter-card.special {
  border-color: var(--gold);
  background: #fffbf0;
}

.letter-card.special .letter { color: var(--gold-dark); }

.letter { font-size: 2rem; font-weight: 800; color: var(--gray-700); line-height: 1; }
.letter-pron { font-size: 0.7rem; color: var(--gray-500); margin-top: 5px; font-style: italic; }

/* ── Grammar Blocks ───────────────────────────────────────── */
.rule-block {
  background: var(--white);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.rule-block h3 { color: var(--blue); margin-bottom: 6px; }
.rule-block p  { font-size: 0.95rem; color: var(--gray-700); }

.rule-block .example {
  margin-top: 12px;
  background: var(--gray-50);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.rule-block .example .fi { font-weight: 700; color: var(--blue-dark); }
.rule-block .example .en { color: var(--gray-500); font-style: italic; }

/* ── Dialogue Blocks ──────────────────────────────────────── */
.dialogue {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.dialogue-header {
  background: var(--blue);
  color: var(--white);
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dialogue-body { padding: 20px; }

.dialogue-line {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.93rem;
}

.dialogue-line:last-child { border-bottom: none; }
.dialogue-line .speaker { font-weight: 700; color: var(--blue); font-size: 0.8rem; text-transform: uppercase; }
.dialogue-line .en-trans { color: var(--gray-500); font-style: italic; font-size: 0.82rem; margin-top: 2px; }

/* ── YKI Sections ─────────────────────────────────────────── */
.yki-level {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-100);
}

.yki-level:last-child { border-bottom: none; }

.level-badge {
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  min-width: 64px;
  letter-spacing: 0.04em;
}

.level-badge.b1 { background: var(--gold-dark); }
.level-badge.b2 { background: #e07b00; }
.level-badge.c1 { background: #c0392b; }

/* ── Tip Box ──────────────────────────────────────────────── */
.tip-box {
  background: #fffbf0;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.92rem;
}

.tip-box .tip-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ── Button ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary { background: var(--gold); color: var(--blue-dark); }
.btn-primary:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255,184,28,.4); }

.btn-outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-white { background: var(--white); color: var(--blue-dark); }
.btn-white:hover { background: var(--gold); transform: translateY(-1px); }

/* ── Social Strip (before footer) ────────────────────────── */
.social-strip {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 22px 24px;
}
.social-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.social-strip-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
}
.social-strip-icons { display: flex; gap: 14px; align-items: center; }
.social-icon-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 99px;
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  transition: all .18s;
  box-shadow: var(--shadow-sm);
}
.social-icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.social-icon-btn.yt:hover { border-color: #ff0000; color: #ff0000; }
.social-icon-btn.tt:hover { border-color: #000; color: #000; }
.social-icon-btn.fb:hover { border-color: #1877f2; color: #1877f2; }
.social-icon-btn.ig:hover { border-color: #e1306c; color: #e1306c; }

/* ── Footer (compact) ────────────────────────────────────── */
.site-footer {
  background: linear-gradient(95deg, var(--blue-dark) 0%, var(--pine-dark) 100%);
  color: rgba(255,255,255,.65);
  padding: 30px 24px 22px;
  text-align: center;
}
.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.footer-brand .wordmark { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.footer-brand .wordmark span { color: var(--gold); }
.footer-brand p { font-size: 0.82rem; margin-top: 4px; max-width: 36ch; text-align: center; }
.footer-bottom {
  max-width: 600px;
  margin: 18px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ── Progress Bar (YKI) ────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gold);
}

/* ── Share Button ─────────────────────────────────────────── */
.share-btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--gray-100);
  background: var(--white);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: all .18s;
}
.share-btn:hover { background: var(--blue-light); border-color: var(--blue); transform: translateY(-1px); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--blue-dark);
    flex-direction: column;
    padding: 12px 16px 24px;
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    z-index: 999;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .nav-links.open { display: flex; }
  .nav-links a { justify-content: flex-start; padding: 11px 14px; }
  .nav-links a.active::after { display: none; }

  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { text-align: left; }
  .footer-bottom { flex-direction: column; }

  .alphabet-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }

  .dialogue-line { grid-template-columns: 60px 1fr; }

  .yki-level { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Mobile Bottom Sticky Tab Bar ────────────────────────── */
.mob-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2000;
  background: linear-gradient(95deg, var(--blue-dark) 0%, var(--pine-dark) 100%);
  border-top: 1px solid rgba(255,255,255,.12);
  height: 62px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.mob-tab-bar-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-family: var(--font);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  position: relative;
}
.mob-tab:hover, .mob-tab.active {
  color: var(--gold);
  background: rgba(255,255,255,.06);
}
.mob-tab .mt-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.mob-tab + .mob-tab::before {
  content: '';
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 1px;
  background: rgba(255,255,255,.08);
}

@media (max-width: 768px) {
  .mob-tab-bar { display: block; }
}

/* ── Prevent nav-inner overflow on mobile ────────────────── */
@media (max-width: 768px) {
  .nav-inner {
    grid-template-columns: auto 1fr;
  }
  .nav-spacer { display: none; }
  .hero-v2-grid {
    grid-template-columns: 1fr !important;
  }
  .sotd-card { margin-bottom: 28px; }
}

/* ── Horizontal scroll social strip on mobile ───────────── */
@media (max-width: 640px) {
  .social-strip-inner {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }
  .social-strip-inner::-webkit-scrollbar { display: none; }
  .social-strip-label { flex-shrink: 0; }
  .social-strip-icons { flex-wrap: nowrap; flex-shrink: 0; }
  .social-icon-btn { white-space: nowrap; flex-shrink: 0; }
}

/* ── Fix horizontal overflow from grids/wide elements ───── */
.container, .container-narrow {
  overflow-x: hidden;
  max-width: min(1200px, 100vw - 48px);
}
.container-narrow {
  max-width: min(820px, 100vw - 48px);
}
.card-grid, .cat-cards, .cat-grid, .action-cards {
  overflow-x: hidden;
}
@media (max-width: 600px) {
  .cat-grid { grid-template-columns: 1fr 1fr !important; }
  .action-cards { grid-template-columns: 1fr !important; }
  .t-grid { grid-template-columns: 1fr !important; }
  .hero-v2-grid { padding: 0 16px; }
  .learn-tabs { gap: 6px; }
  .learn-tab { padding: 8px 12px; font-size: .78rem; }
}
