/* Thunder Range — shared stylesheet
   One local CSS file for every page. No external resources. */

:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-text: #14213d;
  --color-text-muted: #4a5568;
  --color-accent: #1d4ed8;
  --color-accent-contrast: #ffffff;
  --color-border: #d7dee8;
  --color-focus: #1d4ed8;
  --color-badge-bg: #e2e8f0;
  --color-badge-text: #334155;
  --radius: 12px;
  --content-width: 860px;
  --nav-offset: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1220;
    --color-surface: #16203a;
    --color-text: #eef2f8;
    --color-text-muted: #b3bdd0;
    --color-accent: #facc15;
    --color-accent-contrast: #0b1220;
    --color-border: #2b3a5c;
    --color-focus: #facc15;
    --color-badge-bg: #2b3a5c;
    --color-badge-text: #d7dee8;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */

.site-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.brand-symbol {
  font-size: 2.25rem;
  margin: 0 0 0.25rem;
}

.brand-symbol img {
  height: 10.5rem;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
}

.tagline {
  margin: 0 auto;
  max-width: 40rem;
  color: var(--color-text-muted);
}

.breadcrumb {
  text-align: start;
  margin-bottom: 1rem;
}

.breadcrumb a {
  display: inline-block;
  padding: 0.5rem 0;
  min-height: 44px;
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ---------- Links & focus ---------- */

a {
  color: var(--color-accent);
}

a:focus-visible,
.card-link:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Cards ---------- */

main {
  padding-bottom: 2rem;
}

main h2 {
  font-size: 1.4rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

/* Cards that follow the page intro directly, with no section heading
   between them (the iOS landing page). */
main > .card-grid {
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.card p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.card-cta {
  margin-top: 1rem;
  color: var(--color-accent);
  font-weight: 600;
}

.card-disabled {
  opacity: 0.75;
  border-style: dashed;
}

.card-disabled h3 {
  color: var(--color-text-muted);
}

.badge-coming-soon {
  display: inline-block;
  background: var(--color-badge-bg);
  color: var(--color-badge-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- Language navigation ---------- */

.language-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.language-list {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.language-list li {
  flex: 0 0 auto;
}

.language-list a {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-accent);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.language-list a:hover {
  background: var(--color-badge-bg);
}

.language-list a[aria-current="true"] {
  background: var(--color-badge-bg);
  font-weight: 600;
}

.home-locale[hidden] {
  display: none;
}

/* ---------- CJK typography ----------
   Applies to the <html> element on the scripted pages and to each
   per-language block on the Privacy and Support pages. */

[lang="ja"],
[lang="zh-Hans"] {
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
}

[lang="ko"] {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ---------- Language sections ---------- */

.lang-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  scroll-margin-top: var(--nav-offset);
}

.lang-section h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.lang-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

[dir="rtl"] {
  text-align: right;
}

/* RTL shared shell on the stacked Privacy/Support pages: keep the header
   centered like every other page; the breadcrumb still follows direction. */
.site-header[dir="rtl"] {
  text-align: center;
}

.support-block {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.support-block:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.support-prompt {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 1.5rem;
  color: var(--color-text-muted);
}

.back-to-languages {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.back-to-languages a {
  display: inline-block;
  padding: 0.5rem 0;
  min-height: 44px;
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0 2rem;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  body {
    font-size: 1rem;
  }
  .card,
  .lang-section {
    padding: 1.1rem;
  }
}
