/**
 * css/base.css — Base & Shell Layout
 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

html[dir="rtl"] body { font-family: var(--font-fa); }
html[dir="ltr"] body { font-family: var(--font-en); }

body {
  min-height: 100%;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(circle at 12% 10%, var(--bg-gradient-1), transparent 45%),
    radial-gradient(circle at 88% 85%, var(--bg-gradient-2), transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: var(--leading-normal);
  overflow-x: hidden;
}

.en-content, [lang="en"] {
  direction: ltr;
  font-family: var(--font-en);
  unicode-bidi: isolate;
}

.ipa-text {
  direction: ltr;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-cyan);
  unicode-bidi: isolate;
}

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

.app-shell {
  max-width: var(--app-max-width);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-top: var(--top-bar-height);
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px));
}

@media (min-width: 640px) {
  .app-shell {
    max-width: 540px;
    border-inline: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
  }
}

.main-viewport {
  flex: 1;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

h1, .h1 { font-size: var(--text-2xl); font-weight: 800; line-height: var(--leading-tight); }
h2, .h2 { font-size: var(--text-xl); font-weight: 700; line-height: var(--leading-tight); }
h3, .h3 { font-size: var(--text-lg); font-weight: 600; line-height: var(--leading-tight); }
p { color: var(--text-secondary); font-size: var(--text-base); }
.text-muted { color: var(--text-muted); font-size: var(--text-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
