:root {
  --bg: #f3f2ef;
  --ink: #12100e;
  --muted: #66615c;
  --line: rgba(18, 16, 14, 0.1);
  --accent: #e4572e;
  --accent-deep: #c94420;
  --soft: #fff0ea;
  --soft-band: #ebe8e2;
  --ok: #e7f2ec;
  --ok-ink: #25543c;
  --danger: #f8e8e5;
  --danger-ink: #922b1f;
  --white: #fffcf8;
  --font: "Outfit", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans TC", system-ui, sans-serif;
  --shell: 68rem;
  --read: 40rem;
}

html[lang="ja"] { --font: "Noto Sans JP", "Outfit", system-ui, sans-serif; }
html[lang="ko"] { --font: "Noto Sans KR", "Outfit", system-ui, sans-serif; }
html[lang="zh-Hans"] { --font: "Noto Sans SC", "Outfit", system-ui, sans-serif; }
html[lang="zh-Hant"] { --font: "Noto Sans TC", "Outfit", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.02rem;
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin: 0 auto;
}

/* —— Top bar (full width) —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 242, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner,
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand:hover { color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin-left: auto;
  margin-right: 0.35rem;
}
.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.lang-control { flex-shrink: 0; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 7.4rem;
  padding: 0.45rem 1.7rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2366615c' d='M1 1l4 4 4-4'/%3E%3C/svg%3E")
    right 0.65rem center / 10px no-repeat,
    var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.lang-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* —— Full-width bands —— */
.band {
  width: 100%;
  padding: 4.5rem 0;
}
.band-hero {
  padding: 4rem 0 4.75rem;
  background:
    radial-gradient(720px 420px at 85% 20%, rgba(228, 87, 46, 0.16), transparent 60%),
    linear-gradient(180deg, #f7f5f1 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.band-plain {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.band-soft {
  background: var(--soft-band);
  border-bottom: 1px solid var(--line);
}
.band-principle {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.band-footer {
  padding: 1.4rem 0 2rem;
  background: var(--bg);
}

/* —— Hero grid: balanced 50/50 —— */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem 4rem;
  align-items: center;
  min-height: min(62vh, 520px);
}

.hero-copy {
  width: 100%;
  max-width: 32rem;
  justify-self: end;
}

.hero-brand {
  margin: 0 0 0.75rem;
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.hero-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.home-lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 30rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}
.home-btn:hover { background: var(--accent-deep); color: #fff; }
.home-btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.home-btn-ghost:hover {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.home-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: start;
  width: 100%;
  max-width: 360px;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 87, 46, 0.22), transparent 70%);
}
.hero-visual img {
  position: relative;
  width: min(100%, 300px);
  height: auto;
  border-radius: 28%;
  animation: float 5.5s ease-in-out infinite;
}

/* —— Section stacks (title above, body below, centered column) —— */
.section-stack {
  max-width: 48rem;
  margin: 0 auto;
}
.section-center {
  text-align: center;
  max-width: 44rem;
}
.section-center .section-body {
  margin-left: auto;
  margin-right: auto;
}
.section-head-wide {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  text-align: center;
}

.section-head {
  margin-bottom: 1.35rem;
}
.section-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
}
.section-body {
  margin: 0;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 38rem;
  line-height: 1.75;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.step-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.2rem 1.35rem;
  min-height: 10rem;
}
.step-card .step-n {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.step-card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.6;
}

.principle-meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.principle-meta p { margin: 0 0 0.35rem; }

.site-footer {
  color: var(--muted);
  font-size: 0.82rem;
}

/* —— Legal / inner pages (kept) —— */
.page {
  width: min(100% - 2.5rem, var(--shell));
  margin: 0 auto;
  padding: 1.25rem 0 3.5rem;
}
.page .site-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  min-height: auto;
}

.article,
.panel {
  width: min(100%, var(--read));
  margin: 0 auto;
  background: var(--white);
  border-radius: 18px;
  padding: 1.85rem 1.7rem 2rem;
  box-shadow: 0 0 0 1px var(--line);
}

h1, h2 {
  letter-spacing: -0.03em;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}
h1 {
  font-size: clamp(1.55rem, 4vw, 1.95rem);
  margin: 0 0 0.45rem;
}
.article h2,
.panel h2 {
  font-size: 1.05rem;
  margin: 1.7rem 0 0.55rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.lede,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.1rem;
}

.article p,
.panel p {
  margin: 0 0 0.9rem;
  max-width: 40em;
}
.article p:last-child,
.panel p:last-child { margin-bottom: 0; }

.article ul,
.article ol,
.panel ul,
.panel ol {
  margin: 0.15rem 0;
  padding: 0;
  list-style: none;
}
.article ul li,
.article ol li,
.panel ul li,
.panel ol li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.article ul li:last-child,
.article ol li:last-child,
.panel ul li:last-child,
.panel ol li:last-child { border-bottom: 0; }

.article ul li::before,
.panel ul li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 1.05rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.article ol,
.panel ol { counter-reset: rule; }
.article ol li,
.panel ol li {
  padding-left: 2rem;
  counter-increment: rule;
}
.article ol li::before,
.panel ol li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 1.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.core-block {
  margin: 1rem 0 1.2rem;
  padding: 1.05rem 1.1rem;
  background: var(--ok);
  border-radius: 12px;
}
.core-block .core-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ok-ink);
  margin-bottom: 0.4rem;
}
.core-block p {
  margin: 0.45rem 0;
  max-width: none;
}
.core-block p:first-of-type { margin-top: 0; }
.core-block p:last-child { margin-bottom: 0; }

.note {
  margin: 1.1rem 0;
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  background: #efeae3;
  font-size: 0.93rem;
}
.note.danger {
  background: var(--danger);
  color: var(--danger-ink);
  font-weight: 600;
}
.note p { margin: 0.4rem 0; max-width: none; }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

footer.site-footer {
  margin-top: 2rem;
  padding-top: 0;
  border-top: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 2rem;
    text-align: center;
  }
  .hero-copy {
    max-width: 36rem;
    margin: 0 auto;
    justify-self: center;
  }
  .home-lead {
    margin-left: auto;
    margin-right: auto;
  }
  .home-actions { justify-content: center; }
  .hero-visual {
    order: -1;
    max-width: 240px;
    justify-self: center;
  }
  .step-grid { grid-template-columns: 1fr; }
  .section-body { max-width: none; }
}

@media (max-width: 720px) {
  .topbar-inner,
  .site-header {
    flex-wrap: wrap;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin: 0.1rem 0 0;
  }
  .band { padding: 3.2rem 0; }
  .band-hero { padding: 2.5rem 0 3rem; }
}

@media (max-width: 520px) {
  .shell,
  .page { width: min(100% - 1.35rem, var(--shell)); }
  .article,
  .panel { padding: 1.3rem 1.1rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
