/* Focusity — Legal pages stylesheet
   Mirrors the in-app dark/amber worldview (Theme.swift). Self-contained, no external CDN. */

:root {
  --bg-top: #1A1C29;
  --bg-bottom: #0A0D12;
  --accent: #F29961;   /* 温かいアンバー */
  --gold: #FACC61;     /* ゴールド */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-tertiary: rgba(255, 255, 255, 0.38);
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.08);
  --card-stroke: rgba(255, 255, 255, 0.10);
  --radius: 22px;
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui,
          "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
          "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle warm glow accents behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 80% -5%, rgba(250, 204, 97, 0.10), transparent 60%),
    radial-gradient(50vw 40vh at 10% 0%, rgba(242, 153, 97, 0.08), transparent 55%);
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 4px 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.brand .name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand .sub {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.lang-toggle button:hover { color: var(--text-primary); }

.lang-toggle button.is-active {
  color: #1a1205;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  box-shadow: 0 4px 14px rgba(250, 204, 97, 0.30);
}

/* ---------- Hero / titles ---------- */
.page-title {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  line-height: 1.25;
  margin: 6px 0 6px;
}

.page-title .accent-bar {
  display: block;
  width: 56px;
  height: 5px;
  border-radius: 999px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.meta {
  color: var(--text-tertiary);
  font-size: 13.5px;
  font-weight: 600;
  margin: 10px 0 4px;
}

.lead {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 18px 0 8px;
}

/* ---------- Cards / sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  margin: 18px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card.highlight {
  border-color: rgba(250, 204, 97, 0.40);
  background:
    linear-gradient(180deg, rgba(250, 204, 97, 0.06), rgba(242, 153, 97, 0.03)),
    var(--card-strong);
}

h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

h2 .num {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  min-width: 1.4em;
}

h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 6px;
  color: var(--text-primary);
}

p { margin: 8px 0; color: var(--text-secondary); }

.card p strong, .card li strong { color: var(--text-primary); font-weight: 700; }

ul, ol { margin: 8px 0; padding-left: 20px; color: var(--text-secondary); }
li { margin: 6px 0; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(250, 204, 97, 0.40);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

/* ---------- Index nav cards ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}

.doc-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.doc-link:hover {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 97, 0.45);
  background: var(--card-strong);
  text-decoration: none;
}

.doc-link .doc-emoji { font-size: 30px; }
.doc-link h2 { margin-top: 12px; font-size: 19px; }
.doc-link p { font-size: 14px; }
.doc-link .go { color: var(--gold); font-weight: 700; font-size: 14px; margin-top: 8px; display: inline-block; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--card-stroke);
  color: var(--text-tertiary);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--text-secondary); }

.backlink {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Language visibility ---------- */
.en { display: none; }
body.lang-en .ja { display: none; }
body.lang-en .en { display: revert; }

/* keep inline language spans inline */
span.ja, span.en { display: inline; }
body.lang-en span.ja { display: none; }
body.lang-ja span.en { display: none; }

@media (max-width: 560px) {
  .wrap { padding: 20px 16px 64px; }
  .card { padding: 20px 18px 16px; }
  .doc-grid { grid-template-columns: 1fr; }
  .site-header { gap: 12px; }
}
