:root {
  --guide-bg: #0f1115;
  --guide-bg-2: #14171d;
  --guide-card: rgba(255, 255, 255, 0.035);
  --guide-card-strong: rgba(255, 255, 255, 0.05);
  --guide-line: rgba(255, 255, 255, 0.08);
  --guide-line-soft: rgba(255, 255, 255, 0.05);
  --guide-fg: #f4f2ed;
  --guide-fg-muted: rgba(244, 242, 237, 0.76);
  --guide-fg-soft: rgba(244, 242, 237, 0.56);
  --guide-amber: #f5a623;
  --guide-amber-soft: rgba(245, 166, 35, 0.12);
  --guide-amber-edge: rgba(245, 166, 35, 0.24);
  --guide-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter Tight", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(245, 166, 35, 0.07), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.04), transparent 24%),
    linear-gradient(180deg, var(--guide-bg) 0%, var(--guide-bg-2) 100%);
  color: var(--guide-fg);
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

:lang(ja),
:lang(ko),
:lang(zh) {
  --font-body: "Noto Sans CJK", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Apple SD Gothic Neo", "PingFang SC", system-ui, sans-serif;
  --font-display: "Noto Serif CJK", "Noto Serif JP", "Noto Serif KR", "Noto Serif SC", "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", serif;
}

:lang(ja) .back,
:lang(ko) .back,
:lang(zh) .back,
:lang(ja) .eyebrow,
:lang(ko) .eyebrow,
:lang(zh) .eyebrow,
:lang(ja) .highlight-label,
:lang(ko) .highlight-label,
:lang(zh) .highlight-label,
:lang(ja) .box-label,
:lang(ko) .box-label,
:lang(zh) .box-label {
  letter-spacing: 0;
}

a {
  color: var(--guide-amber);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.topnav {
  width: 100%;
  margin: 0;
  padding: 22px clamp(20px, 4vw, 48px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
}

.topnav-brand {
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.3px;
  color: #fff;
  white-space: nowrap;
}

.topnav-brand .brand-word--accent {
  color: var(--guide-amber);
}

.topnav-brand .brand-word {
  font-style: normal;
}

.topnav-brand:hover {
  color: #fff;
  text-decoration: none;
}

.topnav-links {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.topnav-link,
.topnav-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1;
}

.topnav-link:hover,
.topnav-links a:hover {
  color: var(--guide-amber);
  text-decoration: none;
}

.topnav-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  width: 62px;
  min-width: 62px;
  padding: 5px 28px 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--guide-fg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: 8px;
  background-image: 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='none' stroke='%23f5a623' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.lang-select:hover {
  border-color: var(--guide-amber-edge);
  background-color: rgba(255, 255, 255, 0.09);
}

.lang-select:focus {
  outline: none;
  border-color: var(--guide-amber);
}

.lang-select option {
  background: var(--guide-bg-2);
  color: var(--guide-fg);
}

.topnav + .page .back {
  display: none;
}

.page {
  width: min(100% - 40px, 800px);
  margin: 56px auto 0;
  padding: 0 0 104px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--guide-fg-soft);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.back:hover {
  color: var(--guide-amber);
  opacity: 1;
  text-decoration: none;
}

.page > .eyebrow,
.page > h1,
.page > .lead,
.page > .intro,
.page > h2,
.page > p,
.page > ul,
.page > .highlight,
.page > .quote-box,
.page > .cta-box,
.page > .related-box,
.page > .note-box {
  margin-left: auto;
  margin-right: auto;
  width: min(100%, 680px);
}

.eyebrow {
  display: inline-block;
  margin-top: 34px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--guide-amber);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 300;
  color: var(--guide-fg);
  margin-bottom: 20px;
  text-wrap: balance;
}

.lead {
  margin-bottom: 16px;
  color: var(--guide-fg-muted);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.55;
}

.intro {
  margin-bottom: 0;
  color: var(--guide-fg-soft);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
}

.highlight,
.quote-box,
.cta-box,
.related-box,
.note-box {
  background: var(--guide-card);
  border: 1px solid rgba(245, 166, 35, 0.10);
  border-radius: 22px;
  padding: 26px 28px;
  box-shadow: var(--guide-shadow);
}

.highlight {
  margin-top: 26px;
  margin-bottom: 34px;
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(255, 255, 255, 0.025)),
    var(--guide-card);
  border-color: var(--guide-amber-edge);
}

.highlight-label,
.box-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--guide-amber);
  font-weight: 500;
  margin-bottom: 10px;
}

.highlight p {
  font-size: 15px;
  margin-bottom: 0;
}

h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  color: var(--guide-fg);
  margin-top: 48px;
  margin-bottom: 14px;
}

p {
  margin-bottom: 15px;
  color: var(--guide-fg-muted);
  font-weight: 400;
  font-size: 16px;
  text-wrap: pretty;
}

ul {
  margin: 4px auto 18px;
  padding-left: 22px;
  color: var(--guide-fg-muted);
}

li {
  margin-bottom: 9px;
  padding-left: 4px;
  font-weight: 400;
  font-size: 16px;
}

.quote-box,
.cta-box,
.related-box,
.note-box {
  margin-top: 28px;
}

.quote-box p,
.cta-box p,
.related-box p,
.note-box p {
  margin-bottom: 0;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 18px;
  border: 1px solid var(--guide-amber-edge);
  border-radius: 999px;
  background: var(--guide-amber-soft);
  color: var(--guide-fg);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.cta-link:hover {
  text-decoration: none;
  background: rgba(245, 166, 35, 0.18);
}

.related-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.related-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--guide-fg);
}

.related-links a:hover {
  color: var(--guide-amber);
}

.related-links a::before {
  content: "→";
  color: var(--guide-amber);
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--guide-line-soft);
  padding: 36px 20px 48px;
  text-align: center;
  font-size: 12px;
  color: var(--guide-fg-soft);
}

footer .footer-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 300;
  color: var(--guide-fg);
  text-decoration: none;
  margin: 0;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
}

footer .footer-note {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--guide-fg-soft);
  line-height: 1.5;
}

footer a {
  color: var(--guide-fg-soft);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--guide-amber);
}

@media (max-width: 780px) {
  .topnav {
    padding: 18px 18px 0;
  }

  .topnav-brand {
    font-size: 15px;
  }

  .topnav-links {
    gap: 12px;
    font-size: 12px;
  }

  .topnav-link,
  .topnav-links a {
    font-size: 12px;
  }

  .page {
    width: min(100% - 36px, 760px);
    margin-top: 42px;
    padding-bottom: 82px;
  }

  .eyebrow {
    margin-top: 26px;
    margin-bottom: 10px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 44px);
    line-height: 1.04;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
  }

  .lead {
    font-size: 18px;
    line-height: 1.52;
  }

  p,
  li,
  .intro {
    font-size: 15px;
    line-height: 1.72;
  }

  .highlight,
  .quote-box,
  .cta-box,
  .related-box,
  .note-box {
    padding: 18px 18px 20px;
    border-radius: 18px;
  }

  h2 {
    font-size: 24px;
    margin-top: 34px;
  }

  footer a {
    display: inline-block;
    margin: 6px 8px;
  }
}
