/* ==========================================================================
   British-Pronounce.com — Shared Design System
   Aesthetic: British Academic Editorial × Tokyo Modern Engineering
   ========================================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f2f4f8;
  --surface-dark: #0b1b34;
  --surface-code: #0f172a;
  --ink: #0b1b34;
  --ink-muted: #475569;
  --ink-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --navy: #0b1b34;
  --royal: #1d4ed8;
  --royal-hover: #1e40af;
  --royal-soft: #eff6ff;
  --crimson: #9f1239;
  --crimson-soft: #fff1f2;
  --emerald: #047857;
  --emerald-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --font-serif: 'Instrument Serif', 'Noto Serif JP', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(11, 27, 52, 0.05);
  --shadow-md: 0 10px 30px -10px rgba(11, 27, 52, 0.10);
  --shadow-lg: 0 20px 50px -15px rgba(11, 27, 52, 0.16);
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--royal);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--royal-hover); }

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

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

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--royal) 65%, var(--crimson) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--royal);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn.active {
  background: var(--navy);
  color: #fff;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 24px 24px;
}
.mobile-drawer.open { display: block; }
.mobile-drawer a {
  display: block;
  padding: 11px 0;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--royal);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--crimson);
  color: #fff;
}
.btn-accent:hover {
  background: #881337;
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--surface-alt);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.84rem;
}

/* Badges & Pills */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--royal-soft);
  color: var(--royal);
  border: 1px solid #bfdbfe;
  margin-bottom: 18px;
}

.eyebrow.crimson {
  background: var(--crimson-soft);
  color: var(--crimson);
  border-color: #fecdd3;
}

.eyebrow.emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: #a7f3d0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}
.tag.royal { background: var(--royal-soft); color: var(--royal); border-color: #bfdbfe; }
.tag.emerald { background: var(--emerald-soft); color: var(--emerald); border-color: #a7f3d0; }
.tag.crimson { background: var(--crimson-soft); color: var(--crimson); border-color: #fecdd3; }
.tag.amber { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }

/* Typography */
h1, h2, h3, h4 {
  margin: 0 0 12px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.display-title {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.serif-accent {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--crimson);
}

.lead {
  font-size: 1.12rem;
  color: var(--ink-muted);
  max-width: 680px;
  margin: 0 0 28px;
}

.section {
  padding: 84px 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-dark {
  background: var(--surface-dark);
  color: #f8fafc;
}
.section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark p { color: #cbd5e1; }

.section-header {
  max-width: 760px;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 800;
}
.section-header p {
  font-size: 1.03rem;
  color: var(--ink-muted);
  margin: 0;
}

/* Hero */
.hero {
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(29, 78, 216, 0.09), transparent 60%),
    radial-gradient(640px 360px at 10% 10%, rgba(159, 18, 57, 0.06), transparent 60%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 44px;
  align-items: center;
}

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

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.metric-item strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.metric-item span {
  font-size: 0.82rem;
  color: var(--ink-subtle);
}

/* Grids & Cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 26px;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 1.25rem;
  background: var(--royal-soft);
  color: var(--royal);
}
.icon-box.crimson { background: var(--crimson-soft); color: var(--crimson); }
.icon-box.emerald { background: var(--emerald-soft); color: var(--emerald); }
.icon-box.amber { background: var(--amber-soft); color: var(--amber); }

/* Interactive Playground & Code Panels */
.playground {
  background: var(--surface-code);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.playground-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: #091020;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}

.pg-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pg-tab {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pg-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.pg-tab.active {
  background: var(--royal);
  color: #fff;
}

.playground-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
}

.code-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.code-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.code-box:last-child { margin-bottom: 0; }

.c-key { color: #93c5fd; }
.c-str { color: #86efac; }
.c-num { color: #fcd34d; }
.c-muted { color: #94a3b8; }
.c-err { color: #fda4af; }

/* IPA Phoneme Pills */
.ipa-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.ipa-word {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 12px;
}
.ipa-word.light {
  background: var(--surface-alt);
  border-color: var(--border);
}
.ipa-word-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ipa-phonemes {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.ph-good {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 6px;
  border-radius: 5px;
}
.ph-bad {
  background: rgba(244, 63, 94, 0.22);
  color: #fb7185;
  padding: 2px 6px;
  border-radius: 5px;
  text-decoration: underline wavy #fb7185;
}
.ipa-word.light .ph-good { background: #d1fae5; color: #065f46; }
.ipa-word.light .ph-bad { background: #ffe4e6; color: #9f1239; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
tr:last-child td { border-bottom: 0; }
.highlight-col { background: #eff6ff; font-weight: 700; color: var(--navy); }

/* Pricing & Calculator */
.price-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.price-card.featured {
  border: 2px solid var(--royal);
  box-shadow: var(--shadow-md);
  position: relative;
}
.price-figure {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 4px;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
}
.check-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--emerald);
  font-weight: 800;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}
.slider-group { margin-bottom: 20px; }
.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--royal);
  cursor: pointer;
}

/* Forms (Partner Program) */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 24px;
}
.form-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.form-full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-subtle);
  margin-top: 4px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}
.field textarea { min-height: 96px; resize: vertical; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg);
  font-size: 0.88rem;
}
.checkbox-card:hover { border-color: var(--royal); }
.checkbox-card input { margin-top: 3px; accent-color: var(--royal); }

.score-meter {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
  margin: 10px 0 12px;
}
.score-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--royal), var(--emerald));
  transition: width 0.25s ease;
}

.alert {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.alert.success {
  background: var(--emerald-soft);
  border-color: #6ee7b7;
  color: #065f46;
}
.alert.error {
  background: var(--crimson-soft);
  border-color: #fda4af;
  color: #9f1239;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #cbd5e1;
  padding: 64px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.site-footer h4 {
  color: #fff;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #cbd5e1; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Utility */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sticky-side { position: sticky; top: 96px; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .calc-grid, .footer-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .mobile-menu-btn { display: inline-flex; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .form-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 44px; }
  .nav-actions .btn { display: none; }
}
