@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Orbitron:wght@400;700&display=swap');

/* ── Tower of Babel — Multilingual OCC Proof Page ── */

.tob-hero {
  padding: 96px 24px 64px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,175,55,.12) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}

.tob-hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.tob-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text);
}

.tob-hero h1 span {
  color: var(--gold);
}

.tob-hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.tob-rule {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0;
}

.tob-rule-line {
  font-size: .9rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.tob-rule-line strong {
  color: var(--gold);
}

/* ── Symbol Selector ── */

.tob-selector-section {
  padding: 48px 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.tob-selector-label {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 16px;
}

.tob-symbol-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.tob-sym-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px 10px;
  min-width: 72px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  position: relative;
}

.tob-sym-btn:hover,
.tob-sym-btn:focus-visible {
  border-color: var(--gold);
  background: var(--surface2);
  outline: none;
  transform: translateY(-2px);
}

.tob-sym-btn.active {
  border-color: var(--gold);
  background: rgba(212,175,55,.12);
  box-shadow: 0 0 0 1px var(--gold);
}

.tob-sym-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--gold);
}

.tob-sym-char {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.tob-sym-btn.active .tob-sym-char {
  color: var(--gold);
}

.tob-sym-name {
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Active Symbol Display ── */

.tob-active-display {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tob-active-char {
  font-size: 5rem;
  font-weight: 900;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  min-width: 80px;
  text-align: center;
  transition: color .2s;
}

.tob-active-info {
  flex: 1;
}

.tob-active-meaning {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.tob-active-locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.3);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.tob-active-desc {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}

.tob-active-count {
  font-size: .75rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 8px;
}

.tob-active-count strong {
  color: var(--gold);
}

/* ── Mode Toggle ── */

.tob-mode-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tob-mode-label {
  font-size: .7rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tob-mode-btns {
  display: flex;
  gap: 8px;
}

.tob-mode-btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all .15s;
}

.tob-mode-btn:hover,
.tob-mode-btn:focus-visible {
  border-color: var(--gold);
  color: var(--text);
  outline: none;
}

.tob-mode-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 700;
}

/* ── Language Grid ── */

.tob-grid-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.tob-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.tob-grid-title {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.tob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.tob-lang-tile {
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .15s, transform .12s;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.tob-lang-tile:hover {
  border-color: rgba(212,175,55,.4);
  transform: translateY(-1px);
}

.tob-lang-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.tob-lang-tile:hover::before {
  opacity: 1;
}

.tob-tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tob-tile-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.tob-tile-lang {
  font-size: .65rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  flex: 1;
}

.tob-tile-script {
  font-size: .6rem;
  color: rgba(212,175,55,.6);
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 4px;
}

.tob-tile-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  min-height: 1.8rem;
  transition: color .1s;
  line-height: 1.3;
}

.tob-tile-label.rtl {
  direction: rtl;
  text-align: right;
}

.tob-tile-label.spinning {
  color: var(--gold);
  opacity: .7;
}

.tob-tile-label.settling {
  color: var(--text);
  opacity: 1;
}

.tob-tile-pronunciation {
  font-size: .65rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  opacity: 0.6;
}

/* Settle flash animation */
@keyframes settle-flash {
  0%   { background: rgba(212,175,55,.15); }
  100% { background: transparent; }
}

.tob-lang-tile.just-settled {
  animation: settle-flash .4s ease-out forwards;
}

/* Spin keyframe for the symbol char display */
@keyframes spin-char {
  0%   { transform: scale(.95); opacity: .5; }
  50%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.tob-active-char.updating {
  animation: spin-char .3s ease-out forwards;
}

/* ── Script-specific font hints ── */
.tob-tile-label[data-script="Arabic"],
.tob-tile-label[data-script="Hebrew"] {
  font-size: 1.1rem;
  direction: rtl;
}

.tob-tile-label[data-script="Devanagari"],
.tob-tile-label[data-script="Bengali"],
.tob-tile-label[data-script="Thai"] {
  font-size: 1rem;
  line-height: 1.5;
}

.tob-tile-label[data-script="Han"],
.tob-tile-label[data-script="Kanji"],
.tob-tile-label[data-script="Hangul"] {
  font-size: 1.4rem;
}

/* ── Info Banner ── */

.tob-info-banner {
  max-width: 1100px;
  margin: 0 auto 48px;
  padding: 24px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.tob-info-icon {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
  color: var(--gold);
}

.tob-info-text h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.tob-info-text p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ── CTA Section ── */

.tob-cta {
  padding: 64px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(212,175,55,.07) 0%, transparent 70%);
}

.tob-cta h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.tob-cta p {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.tob-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ── Accessibility ── */

.tob-sym-btn:focus-visible,
.tob-mode-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tob-lang-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .tob-lang-tile,
  .tob-sym-btn,
  .tob-lang-tile::before,
  .tob-active-char {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .tob-hero { padding: 64px 16px 40px; }
  .tob-active-display { flex-direction: column; gap: 16px; padding: 24px 16px; }
  .tob-active-char { font-size: 3.5rem; min-width: auto; }
  .tob-selector-section,
  .tob-grid-section,
  .tob-mode-bar { padding-left: 16px; padding-right: 16px; }
  .tob-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .tob-symbol-row { gap: 8px; }
  .tob-sym-btn { min-width: 60px; padding: 10px 8px 8px; }
  .tob-sym-char { font-size: 1.5rem; }
  .tob-info-banner { padding: 16px 20px; gap: 16px; }
  .tob-cta-btns { flex-direction: column; align-items: center; }
}
