/* ==========================================================================
   ポルトガル語＆ポルトガル完全ガイド (Português Atlas)
   Design System: Lisbon Azulejo Cobalt, Warm Limestone & Terracotta Editorial
   ========================================================================== */

:root {
  /* Core Palette (HSL-curated) */
  --bg-canvas: hsl(40, 38%, 97%);
  --bg-subtle: hsl(40, 28%, 93%);
  --bg-surface: hsl(0, 0%, 100%);
  --bg-tint-blue: hsl(213, 62%, 95%);
  --bg-tint-terra: hsl(11, 68%, 95%);
  --bg-tint-gold: hsl(42, 74%, 93%);
  --bg-tint-olive: hsl(150, 36%, 93%);

  /* Brand & Accents */
  --cobalt: hsl(213, 72%, 31%);
  --cobalt-deep: hsl(214, 74%, 20%);
  --cobalt-mid: hsl(212, 65%, 42%);
  --terracotta: hsl(10, 61%, 48%);
  --terracotta-deep: hsl(10, 64%, 38%);
  --ochre: hsl(38, 76%, 44%);
  --olive: hsl(152, 40%, 30%);

  /* Ink & Borders */
  --ink-primary: hsl(215, 33%, 14%);
  --ink-secondary: hsl(215, 20%, 28%);
  --ink-muted: hsl(215, 14%, 44%);
  --border-hairline: hsla(213, 45%, 24%, 0.12);
  --border-strong: hsla(213, 45%, 24%, 0.22);

  /* Elevation & Radius */
  --shadow-sm: 0 2px 8px hsla(214, 48%, 16%, 0.05), 0 1px 2px hsla(214, 48%, 16%, 0.04);
  --shadow-md: 0 10px 28px hsla(214, 48%, 16%, 0.08), 0 2px 6px hsla(214, 48%, 16%, 0.04);
  --shadow-lg: 0 20px 44px hsla(214, 48%, 16%, 0.12), 0 4px 12px hsla(214, 48%, 16%, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Typography */
  --font-serif: "Shippori Mincho", "Cormorant Garamond", "Hiragino Mincho ProN", Georgia, serif;
  --font-sans: "Noto Sans JP", "Plus Jakarta Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-height: 68px;
  --container-max: 1180px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--cobalt);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--terracotta);
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Tactile Azulejo Ceramic Frieze Divider
   ========================================================================== */
.azulejo-frieze {
  height: 16px;
  width: 100%;
  background-color: var(--bg-tint-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' viewBox='0 0 32 16'%3E%3Crect width='32' height='16' fill='%23FAF8F4'/%3E%3Cpath d='M0 0.5H32M0 15.5H32' stroke='%23164A8A' stroke-opacity='0.22'/%3E%3Cpath d='M8 2L14 8L8 14L2 8Z' fill='none' stroke='%23164A8A' stroke-width='1.1' stroke-opacity='0.52'/%3E%3Ccircle cx='8' cy='8' r='1.8' fill='%23C98A1A' fill-opacity='0.8'/%3E%3Cpath d='M24 2L30 8L24 14L18 8Z' fill='none' stroke='%23164A8A' stroke-width='1.1' stroke-opacity='0.52'/%3E%3Ccircle cx='24' cy='8' r='1.8' fill='%23164A8A' fill-opacity='0.55'/%3E%3Ccircle cx='16' cy='8' r='1' fill='%23C84B31' fill-opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-height);
  background: hsla(40, 38%, 97%, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-primary);
  flex-shrink: 0;
}

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

.brand-mark {
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--cobalt-deep);
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--bg-tint-blue);
  color: var(--cobalt);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  color: var(--ink-primary);
  font-size: 0.8rem;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.header-counter:hover {
  transform: translateY(-1px);
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.header-counter-label {
  color: var(--ink-muted);
  font-weight: 500;
}

.header-counter-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--cobalt-deep);
}

.vc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 3px hsla(152, 40%, 30%, 0.18);
  flex-shrink: 0;
}

.vc-dot.is-fallback {
  background: var(--ochre);
  box-shadow: 0 0 0 3px hsla(38, 76%, 44%, 0.2);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--cobalt-deep);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Buttons & Reusable Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--cobalt);
  color: #fff;
  box-shadow: 0 6px 18px hsla(213, 72%, 31%, 0.22);
}

.btn-primary:hover {
  background: var(--cobalt-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px hsla(213, 72%, 31%, 0.28);
}

.btn-terracotta {
  background: var(--terracotta);
  color: #fff;
  box-shadow: 0 6px 18px hsla(10, 61%, 48%, 0.22);
}

.btn-terracotta:hover {
  background: var(--terracotta-deep);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--cobalt-deep);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--cobalt);
  background: var(--bg-tint-blue);
  color: var(--cobalt-deep);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.83rem;
  border-radius: 8px;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid hsla(213, 72%, 31%, 0.22);
  background: var(--bg-tint-blue);
  color: var(--cobalt-deep);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.audio-btn:hover {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
  transform: translateY(-1px);
}

.audio-btn.is-slow {
  background: var(--bg-tint-gold);
  border-color: hsla(38, 76%, 44%, 0.32);
  color: hsl(34, 70%, 28%);
}

.audio-btn.is-slow:hover {
  background: var(--ochre);
  color: #fff;
  border-color: var(--ochre);
}

.audio-btn.is-speaking {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

/* ==========================================================================
   Hero Section (Editorial Split with Sunlit Lisbon Artwork)
   ========================================================================== */
.hero {
  position: relative;
  padding: 54px 0 48px;
  background:
    radial-gradient(circle at 8% 12%, hsla(213, 72%, 31%, 0.06), transparent 44%),
    radial-gradient(circle at 92% 84%, hsla(38, 76%, 44%, 0.08), transparent 48%),
    var(--bg-canvas);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 12px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.95rem, 3.6vw, 2.95rem);
  line-height: 1.25;
  letter-spacing: 0.015em;
  color: var(--cobalt-deep);
  margin: 0 0 18px;
}

.hero-lead {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-secondary);
  margin: 0 0 24px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
}

.hero-metric {
  display: flex;
  flex-direction: column;
}

.hero-metric-val {
  font-family: var(--font-serif);
  font-size: clamp(1.06rem, 1.45vw, 1.24rem);
  font-weight: 700;
  color: var(--cobalt-deep);
  line-height: 1.25;
  white-space: nowrap;
}

.hero-metric-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.hero-visual {
  position: relative;
}

.hero-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  padding: 10px;
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 16 / 9.2;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 6px);
}

.hero-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 4px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.hero-phrase-strip {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
}

.hero-phrase-pt {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cobalt-deep);
}

.hero-phrase-ja {
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* Voice Control Bar */
.voice-toolbar {
  background: var(--cobalt-deep);
  color: #f4f7fb;
  padding: 12px 0;
}

.voice-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.voice-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.voice-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.25);
  background: transparent;
  color: #e2ecf8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.voice-pill.is-active,
.voice-pill:hover {
  background: #fff;
  color: var(--cobalt-deep);
  border-color: #fff;
}

/* ==========================================================================
   Section Scaffolding
   ========================================================================== */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-subtle);
}

.section-head {
  max-width: 780px;
  margin-bottom: 36px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 8px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  line-height: 1.3;
  color: var(--cobalt-deep);
  margin: 0 0 12px;
}

.section-desc {
  color: var(--ink-secondary);
  margin: 0;
  font-size: 0.98rem;
}

.sub-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--cobalt-deep);
  margin: 38px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-heading::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: var(--cobalt);
  flex-shrink: 0;
}

/* Tabs & Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.tab-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.tab-btn.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
  box-shadow: 0 4px 12px hsla(213, 72%, 31%, 0.2);
}

/* ==========================================================================
   Section 1: Nanban Loanwords & PT-PT vs PT-BR Intro
   ========================================================================== */
.nanban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.nanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

.nanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nanban-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.nanban-ja {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.nanban-era {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-tint-gold);
  color: hsl(34, 68%, 30%);
  font-weight: 600;
}

.nanban-pt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-tint-blue);
}

.nanban-pt {
  font-weight: 700;
  color: var(--cobalt-deep);
  font-size: 0.96rem;
}

.nanban-kana {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.nanban-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.62;
}

/* PT-PT vs PT-BR Table */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 13px 16px;
  background: var(--cobalt-deep);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border-hairline);
  vertical-align: top;
  color: var(--ink-secondary);
}

.data-table tr:nth-child(even) td {
  background: hsla(40, 38%, 97%, 0.75);
}

.data-table td strong {
  color: var(--cobalt-deep);
}

/* ==========================================================================
   Section 2: Pronunciation & Alphabet Lab
   ========================================================================== */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 9px;
}

.alpha-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 11px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.alpha-tile:hover {
  transform: translateY(-2px);
  border-color: var(--cobalt);
  background: var(--bg-tint-blue);
}

.alpha-letter {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--cobalt-deep);
  line-height: 1.15;
}

.alpha-kana {
  display: block;
  font-size: 0.72rem;
  color: var(--terracotta);
  font-weight: 600;
  margin: 2px 0 4px;
}

.alpha-ex {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.rule-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rule-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--cobalt-deep);
}

.rule-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-tint-terra);
  color: var(--terracotta-deep);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-blue {
  background: var(--bg-tint-blue);
  color: var(--cobalt-deep);
}

.badge-olive {
  background: var(--bg-tint-olive);
  color: var(--olive);
}

.ipa-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.rule-body {
  margin: 0;
  font-size: 0.89rem;
  color: var(--ink-secondary);
}

.rule-samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sample-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.sample-chip:hover {
  border-color: var(--cobalt);
  background: var(--bg-tint-blue);
}

.sample-pt {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cobalt-deep);
}

.sample-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   Section 3: Phrasebook
   ========================================================================== */
.phrase-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  font-size: 0.83rem;
  color: var(--ink-secondary);
}

.progress-pill strong {
  color: var(--olive);
  font-family: var(--font-mono);
}

.phrase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.phrase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.phrase-card.is-mastered {
  background: hsl(150, 32%, 98%);
  border-color: hsla(152, 40%, 30%, 0.32);
}

.phrase-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.phrase-pt {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cobalt-deep);
  line-height: 1.35;
}

.phrase-phonetics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.phrase-kana {
  color: var(--terracotta-deep);
  font-weight: 600;
}

.phrase-ja {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.phrase-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

.phrase-br {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-tint-gold);
  color: hsl(35, 65%, 28%);
  align-self: flex-start;
}

.phrase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
  margin-top: auto;
}

.phrase-audio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.master-btn {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.master-btn:hover {
  border-color: var(--olive);
  color: var(--olive);
}

.master-btn.is-done {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}

/* ==========================================================================
   Section 4: Grammar & Interactive Verb Conjugator
   ========================================================================== */
.grammar-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.grammar-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.grammar-panel-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--cobalt-deep);
}

.grammar-pt-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--terracotta);
}

.grammar-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.grammar-point {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 14px 16px;
}

.grammar-point h4 {
  margin: 0 0 5px;
  font-size: 0.93rem;
  color: var(--cobalt-deep);
}

.grammar-point p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.grammar-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.grammar-ex-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--bg-tint-blue);
  border: 1px solid hsla(213, 72%, 31%, 0.16);
}

/* Verb Conjugator Lab */
.conjugator-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.conjugator-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.verb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.verb-pill {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.verb-pill:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.verb-pill.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

.tense-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.verb-header-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--bg-tint-blue);
  margin-bottom: 18px;
}

.verb-infinitive {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--cobalt-deep);
}

.verb-meaning {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-left: 10px;
}

.conj-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.conj-cell {
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.conj-cell:hover {
  border-color: var(--cobalt);
  background: var(--bg-tint-blue);
  transform: translateY(-2px);
}

.conj-pronoun {
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.conj-form {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--cobalt-deep);
}

.conj-ja-hint {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.verb-example-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--bg-tint-gold);
  border: 1px solid hsla(38, 76%, 44%, 0.25);
}

/* ==========================================================================
   Section 5: Interactive Flashcard Deck
   ========================================================================== */
.flashcard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: center;
}

.fc-stage {
  perspective: 1100px;
}

.fc-card {
  position: relative;
  width: 100%;
  min-height: 285px;
  transform-style: preserve-3d;
  transition: transform 0.52s var(--ease-out);
  cursor: pointer;
}

.fc-card.is-flipped {
  transform: rotateY(180deg);
}

.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fc-back {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, #ffffff 0%, var(--bg-tint-blue) 100%);
}

.fc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.fc-main-word {
  text-align: center;
  padding: 18px 0;
}

.fc-pt {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--cobalt-deep);
  margin: 0 0 8px;
}

.fc-kana {
  font-size: 0.95rem;
  color: var(--terracotta);
  font-weight: 600;
}

.fc-ja {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0 0 10px;
}

.fc-note {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  margin: 0;
}

.fc-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.fc-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fc-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fc-progress-bar {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.fc-progress-fill {
  height: 100%;
  background: var(--olive);
  border-radius: 999px;
  transition: width 0.28s var(--ease-out);
}

/* ==========================================================================
   Sponsor Banners — HisatorNotebook (hisator-notebook.com)
   ========================================================================== */
.sponsor-section {
  padding: 40px 0;
  background: linear-gradient(180deg, var(--bg-canvas) 0%, var(--bg-tint-blue) 50%, var(--bg-canvas) 100%);
}

.sponsor-card {
  background: var(--bg-surface);
  border: 1px solid hsla(213, 72%, 31%, 0.22);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.sponsor-brand-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.sponsor-logo {
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.sponsor-pr-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.sponsor-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--cobalt);
  font-weight: 600;
}

.sponsor-title {
  margin: 0 0 9px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.38;
  color: var(--cobalt-deep);
}

.sponsor-desc {
  margin: 0 0 12px;
  font-size: 0.89rem;
  color: var(--ink-secondary);
}

.sponsor-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  font-size: 0.81rem;
  color: var(--ink-primary);
}

.sponsor-features li::before {
  content: "✓ ";
  color: var(--olive);
  font-weight: 700;
}

.sponsor-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 215px;
}

.sponsor-platform-note {
  font-size: 0.74rem;
  color: var(--ink-muted);
  text-align: center;
}

.sponsor-section-compact {
  padding: 28px 0 42px;
  background: var(--bg-canvas);
}

.sponsor-compact {
  background: var(--bg-surface);
  border: 1px solid hsla(213, 72%, 31%, 0.2);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sponsor-compact-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 420px;
}

.sponsor-compact-logo {
  border-radius: 12px;
  flex-shrink: 0;
}

.sponsor-compact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.sponsor-compact-text h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  color: var(--cobalt-deep);
}

.sponsor-compact-text p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Section 6: Interactive Portugal Map & Major Cities Showcase
   ========================================================================== */
.cities-quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.city-pill {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.city-pill:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.city-pill.is-active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
  box-shadow: 0 4px 12px hsla(10, 61%, 48%, 0.24);
}

.cities-grid {
  display: grid;
  grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.map-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.map-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.map-card-head span {
  white-space: nowrap;
  flex-shrink: 0;
}

.map-svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: linear-gradient(180deg, #ddeaf7 0%, #c8dff2 100%);
  border: 1px solid hsla(213, 60%, 35%, 0.16);
}

.map-pin {
  cursor: pointer;
  transition: transform 0.18s ease;
}

.map-pin circle.pin-outer {
  fill: var(--cobalt);
  stroke: #fff;
  stroke-width: 2.2;
  transition: fill 0.18s ease, r 0.18s ease;
}

.map-pin:hover circle.pin-outer {
  fill: var(--terracotta);
}

.map-pin.is-active circle.pin-outer {
  fill: var(--terracotta);
}

.map-pin text {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--cobalt-deep);
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3px;
  pointer-events: none;
}

.map-pin.is-active text {
  fill: var(--terracotta-deep);
  font-size: 11.5px;
}

.map-legend {
  margin-top: 10px;
  font-size: 0.77rem;
  color: var(--ink-muted);
  text-align: center;
}

.city-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.city-banner {
  position: relative;
  height: 230px;
  overflow: hidden;
}

.city-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.city-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsla(214, 70%, 14%, 0.1) 25%, hsla(214, 70%, 14%, 0.82) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 24px;
  color: #fff;
}

.city-banner-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.city-region-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: hsla(0, 0%, 100%, 0.2);
  backdrop-filter: blur(6px);
  font-size: 0.76rem;
  font-weight: 600;
}

.city-banner-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  line-height: 1.25;
}

.city-banner-sub {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #e6eef8;
}

.city-body {
  padding: 24px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.city-facts-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.city-fact {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
}

.city-fact-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.city-fact-val {
  font-size: 0.83rem;
  color: var(--ink-primary);
  font-weight: 600;
}

.city-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.highlight-item {
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
}

.highlight-item h4 {
  margin: 0 0 2px;
  font-size: 0.93rem;
  color: var(--cobalt-deep);
}

.highlight-pt {
  display: block;
  font-size: 0.75rem;
  color: var(--terracotta);
  font-weight: 600;
  margin-bottom: 5px;
}

.highlight-item p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.city-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.city-box {
  padding: 15px 16px;
  border-radius: 12px;
  background: var(--bg-tint-blue);
  border: 1px solid hsla(213, 72%, 31%, 0.14);
}

.city-box.is-warm {
  background: var(--bg-tint-gold);
  border-color: hsla(38, 76%, 44%, 0.24);
}

.city-box h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--cobalt-deep);
}

.city-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.city-box li + li {
  margin-top: 4px;
}

.city-tip {
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--bg-tint-olive);
  color: hsl(152, 42%, 22%);
  font-size: 0.86rem;
}

/* ==========================================================================
   Section 7: Portugal Culture Encyclopedia & History Timeline
   ========================================================================== */
.culture-hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.culture-hero-img {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 2.75;
}

.culture-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.culture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.culture-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.culture-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.culture-card-title {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--cobalt-deep);
}

.culture-pt-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--terracotta);
  font-weight: 600;
}

.culture-card-body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.culture-trivia {
  margin-top: auto;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg-canvas);
  border-left: 3px solid var(--ochre);
  font-size: 0.83rem;
  color: var(--ink-secondary);
}

/* History Timeline */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.timeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: var(--cobalt);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 9px;
}

.timeline-card h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--cobalt-deep);
}

.timeline-card p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Section 8: Comprehensive Quiz Engine
   ========================================================================== */
.quiz-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
  max-width: 860px;
}

.quiz-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.quiz-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  margin-bottom: 22px;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--cobalt);
  transition: width 0.25s var(--ease-out);
}

.quiz-question {
  font-family: var(--font-serif);
  font-size: 1.24rem;
  line-height: 1.5;
  color: var(--ink-primary);
  margin: 0 0 18px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.16s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--cobalt);
  background: var(--bg-tint-blue);
}

.quiz-option-idx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-option.is-correct {
  background: var(--bg-tint-olive);
  border-color: var(--olive);
  color: hsl(152, 46%, 20%);
  font-weight: 700;
}

.quiz-option.is-wrong {
  background: var(--bg-tint-terra);
  border-color: var(--terracotta);
  color: var(--terracotta-deep);
}

.quiz-feedback {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--bg-tint-blue);
  border-left: 4px solid var(--cobalt);
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.quiz-result-box {
  text-align: center;
  padding: 16px 8px;
}

.quiz-score-big {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--cobalt-deep);
  margin: 8px 0;
}

.quiz-rank-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--bg-tint-gold);
  color: hsl(34, 70%, 28%);
  font-weight: 700;
  margin-bottom: 12px;
}

/* ==========================================================================
   Footer & Live Visitor Counter Card
   ========================================================================== */
.site-footer {
  background: var(--cobalt-deep);
  color: #dce7f5;
  padding: 54px 0 28px;
}

.site-footer a {
  color: #c7dbf4;
}

.site-footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: 32px;
  margin-bottom: 34px;
}

.footer-about .brand-title {
  color: #fff;
}

.footer-about .brand-sub {
  color: #a9c3e2;
}

.footer-about p {
  margin: 14px 0 0;
  font-size: 0.87rem;
  color: #bfd3ec;
  line-height: 1.75;
}

.footer-links-title {
  margin: 0 0 12px;
  font-size: 0.94rem;
  color: #fff;
  font-family: var(--font-serif);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}

/* Live Visitor Counter Card */
.visitor-card {
  background: hsla(214, 74%, 13%, 0.7);
  border: 1px solid hsla(0, 0%, 100%, 0.16);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.visitor-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.visitor-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: #fff;
  font-size: 0.98rem;
}

.vc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #d6e6f9;
}

.visitor-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.visitor-stat-box {
  background: hsla(0, 0%, 100%, 0.07);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
}

.visitor-stat-label {
  font-size: 0.7rem;
  color: #a9c3e2;
  margin-bottom: 6px;
  line-height: 1.3;
}

.vc-date-sub {
  display: block;
  font-size: 0.62rem;
  color: #88abd4;
  margin-top: 2px;
  white-space: nowrap;
}

.visitor-stat-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.visitor-note {
  margin: 0;
  font-size: 0.75rem;
  color: #9eb9db;
  line-height: 1.55;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid hsla(0, 0%, 100%, 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: #9fb8d8;
}

/* Toast Notification */
.pt-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: 11px;
  background: var(--cobalt-deep);
  color: #fff;
  font-size: 0.86rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
}

.pt-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid,
  .cities-grid,
  .flashcard-layout,
  .culture-hero-strip,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .map-card {
    position: static;
    max-width: 440px;
    margin: 0 auto;
  }

  .sponsor-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .sponsor-brand-col {
    flex-direction: row;
    justify-content: flex-start;
  }

  .sponsor-cta {
    align-items: flex-start;
  }

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

  .conj-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    padding: 14px 20px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .rules-grid,
  .phrase-grid,
  .grammar-points,
  .grammar-examples,
  .culture-grid,
  .city-highlights,
  .city-bottom-grid,
  .city-facts-strip {
    grid-template-columns: 1fr;
  }

  .conjugator-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 52px 0;
  }

  .hero {
    padding: 36px 0 38px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rule-samples,
  .conj-grid,
  .timeline-grid,
  .visitor-stats {
    grid-template-columns: 1fr;
  }

  .header-counter-label {
    display: none;
  }

  .grammar-panel,
  .conjugator-shell,
  .quiz-shell {
    padding: 20px 16px;
  }
}
