:root {
  --bg: #fff;
  --surface: #fff;
  --ivory: #2b2c75;
  --ivory-bright: #2b2c75;
  --ivory-muted: #5f6593;
  --border: #d6dcf0;
  --font-serif: "IBM Plex Sans KR", Arial, sans-serif;
  --surface1: #fff;
  --surface2: #e9edf4;
  --surface-1: #fff;
  --surface-2: #e9edf4;
  --surface-feature: #fff;
  --text: #2b2c75;
  --ink: #2b2c75;
  --muted: #5f6593;
  --accent: #1439ff;
  --gold: #1439ff;
  --teal: #1439ff;
  --pale: #e9edf4;
  --card: #e9edf4;
  --line: #d6dcf0;
  --max-width: 1280px;
  --header-height: 72px;
}

/* Enlarged reading scale, while respecting the browser font-size preference. */
html { background: var(--bg); font-size: 125%; }
[hidden] { display: none !important; }
body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "IBM Plex Sans KR", Arial, sans-serif;
  line-height: 1.65;
}
#star-canvas, .ambient-glow, .noise-overlay { display: none !important; }
.site-shell, .shell { width: min(calc(100% - 48px), var(--max-width)); margin-inline: auto; }
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; min-height: var(--header-height);
  background: rgba(255,255,255,.95); border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--accent); box-shadow: 0 1px 0 rgba(20,57,255,.08); }
.site-header__inner { min-height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.site-header__inner > .brand { grid-column: 2; grid-row: 1; justify-self: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text) !important; text-decoration: none; letter-spacing: -.03em; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.brand__ko { font-size: 1rem; font-weight: 600; white-space: nowrap; }
.brand__en { font-size: .6rem; letter-spacing: .14em; font-weight: 500; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.site-nav--left { justify-self: start; grid-column: 1; grid-row: 1; }
.site-nav--right { justify-self: end; grid-column: 3; grid-row: 1; }
.site-nav a, .nav-drawer a { color: var(--text); font-size: .86rem; text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible, .nav-drawer a:hover, .nav-drawer a:focus-visible { color: var(--accent); }
.search-trigger { border: 0; padding: 6px; background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.search-trigger img { width: 19px; height: 19px; }
.site-search-inline { position: relative; display: flex; align-items: center; gap: 7px; }
.site-search-inline input { width: 180px; border: 0; border-bottom: 1px solid var(--accent); border-radius: 0; padding: 5px 0; color: var(--text); background: transparent; font: inherit; outline: none; }
.site-search-inline > button { border: 0; background: transparent; color: var(--accent); font-size: 1.2rem; cursor: pointer; }
.site-search-inline__results { position: fixed; top: var(--header-height); right: max(24px, calc((100vw - var(--max-width)) / 2)); z-index: 60; width: min(450px, calc(100vw - 48px)); max-height: 420px; overflow: auto; padding: 10px 16px; background: #fff; border: 1px solid var(--accent); border-top: 0; }
.site-search-inline__results:empty { display: none; }
.site-search-inline__results a, .site-search-mobile__results a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; color: var(--text); border-bottom: 1px solid var(--line); text-decoration: none; }
.site-search-inline__results a span, .site-search-mobile__results a span { color: var(--muted); font-size: .76rem; }
.site-search-mobile { display: grid; gap: 7px; padding-top: 14px; }
.site-search-mobile label { color: var(--muted); font-size: .78rem; }
.site-search-mobile input { width: 100%; border: 0; border-bottom: 1px solid var(--accent); padding: 8px 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.site-search-mobile__results { display: grid; max-height: 240px; overflow: auto; }
.nav-toggle { display: none; border: 0; background: transparent; padding: 8px; color: var(--text); }
.nav-toggle img { width: 22px; height: 22px; }
.nav-toggle__close { display: none; }
.nav-drawer { display: none; position: fixed; inset: var(--header-height) 0 auto; padding: 0; z-index: 49; backdrop-filter: none; max-height: calc(100dvh - var(--header-height)); overflow: auto; }
.nav-drawer a { padding: 0; border: 0; border-radius: 0; }
.nav-drawer a::after { display: none; }
.nav-drawer.is-open { display: block; background: #fff; border-bottom: 2px solid var(--accent); }
.nav-drawer__inner { width: min(calc(100% - 48px), var(--max-width)); margin: auto; display: grid; gap: 14px; padding: 24px 0 30px; }
.nav-drawer__inner a { font-size: 1.15rem; }
body.nav-open { overflow: hidden; }
.site-search { width: min(560px, calc(100% - 32px)); border: 1px solid var(--accent); border-radius: 0; padding: 0; color: var(--text); background: #fff; }
.site-search::backdrop { background: rgba(43,44,117,.22); }
.site-search__form { padding: 28px; }
.site-search__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-search h2 { margin: 0; font-size: 1.25rem; }
.site-search__close { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.site-search label { display: block; margin-top: 24px; font-size: .8rem; color: var(--muted); }
.site-search input { width: 100%; border: 0; border-bottom: 1px solid var(--accent); border-radius: 0; padding: 10px 0; color: var(--text); font: inherit; outline: none; }
.site-search__results { display: grid; gap: 4px; margin-top: 14px; max-height: 320px; overflow: auto; }
.site-search__results a { display: flex; justify-content: space-between; gap: 16px; padding: 10px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-search__results a:hover { background: var(--pale); }
.site-search__results a span { color: var(--muted); font-size: .76rem; }
.site-footer { margin-top: 100px; border-top: 1px solid var(--line); background: var(--text); color: #fff; }
.site-footer__inner { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; color: #fff; font-size: .82rem; }
.brand--footer { gap: 8px; }
.brand--footer .brand__en { display: block; }
.brand--footer { color: #fff !important; }
main.shell, main.site-shell { padding-top: clamp(48px, 7vw, 112px); }
.tool-page { width: 100% !important; max-width: none !important; padding: 0 !important; }
h1, h2, h3, p, li { color: inherit; }
h1, h2, h3 { letter-spacing: -.04em; }
.section-lead, .research-bib-note, .disclaimer { color: var(--muted) !important; }
.card, .research-pillar, .research-section, .sign-detail, .tool-page > section, .quiz-shell, .quiz-card { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; box-shadow: none; border-radius: 0; }
.btn, .btn-ghost, .btn-gold { border-color: var(--accent) !important; color: var(--accent) !important; background: #fff !important; }
.btn:hover, .btn-ghost:hover, .btn-gold:hover { background: var(--pale) !important; }
.source-hero { position: relative; min-height: 550px; border-bottom: 2px solid var(--accent); overflow: hidden; background: var(--text); color: #fff; }
.source-hero__image, .source-hero__image img { position: absolute; inset: 0; width: 100%; height: 100%; }
.source-hero__image img { object-fit: cover; filter: saturate(.9) brightness(.92); }
.source-hero__image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(43,44,117,.08), rgba(43,44,117,.24)); }
.source-hero__copy { position: relative; z-index: 1; min-height: 550px; width: min(calc(100% - 48px), var(--max-width)); margin: auto; display: flex; flex-direction: column; justify-content: end; padding: 100px 0 50px; }
.source-hero__copy p { margin: 0 0 16px; color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .12em; }
.source-hero__copy strong { max-width: 760px; color: #fff; font-size: clamp(1rem, 2vw, 1.45rem); line-height: 1.45; letter-spacing: -.02em; font-weight: 400; }
.source-hero__title { display: block; max-width: 1100px; margin: 0 0 18px; color: #fff !important; font-family: "IBM Plex Sans KR", Arial, sans-serif; font-size: clamp(2.8rem, 6.8vw, 5.2rem); line-height: 1.02; letter-spacing: -.055em; }
.source-hero .source-hero__title { font-size: clamp(2.8rem, 6.8vw, 5.2rem) !important; line-height: 1.02 !important; }
.source-body-grid { display: grid; grid-template-columns: 32% 68%; align-items: start; }
.source-sidebar { align-self: stretch; background: var(--pale); padding: 52px clamp(20px, 6vw, 90px); }
.source-toc { position: sticky; top: 100px; display: grid; gap: 16px; }
.source-toc a { color: var(--accent); font-size: .86rem; font-weight: 600; text-decoration: none; }
.source-content { min-width: 0; padding: 52px clamp(24px, 6vw, 96px); background: #fff; }
.source-content h1, .source-content h2, .source-content h3 { font-family: "IBM Plex Sans KR", Arial, sans-serif; }
.source-content h1 { font-size: clamp(2.2rem, 5vw, 4.3rem); line-height: 1.05; }
.source-content h2 { margin-top: 2.5rem; font-size: clamp(1.5rem, 3vw, 2.3rem); }
@media (min-width: 761px) and (max-width: 1100px) {
  .site-header .brand__en { display: none; }
}
@media (max-width: 760px) {
  .site-shell, .shell { width: min(calc(100% - 32px), var(--max-width)); }
  .site-header__inner { grid-template-columns: 1fr auto 1fr; }
  .site-nav { display: none; }
  .brand__en { display: none; }
  .nav-toggle { display: inline-flex; justify-self: end; grid-column: 3; grid-row: 1; }
  .nav-toggle__open { display: block; }
  .nav-toggle__close { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }
  .site-footer__inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 30px 0; }
  .site-search-inline { display: none; }
  main.shell, main.site-shell { padding-top: 44px; }
  .source-hero, .source-hero__copy { min-height: 430px; }
  .source-hero__copy { width: calc(100% - 32px); padding-bottom: 34px; }
  .source-hero__copy strong { font-size: 1rem; }
  .source-hero__title { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .source-hero .source-hero__title { font-size: clamp(2.2rem, 12vw, 3.5rem) !important; }
  .source-body-grid { display: block; }
  .source-sidebar { padding: 24px 16px; }
  .source-toc { position: static; display: flex; flex-wrap: wrap; gap: 12px 20px; }
  .source-content { padding: 34px 16px; }
}

/* Legacy night-theme foregrounds mapped to the light-theme ink. */
.hero-about,
.card p,
.about-box p,
.research-pillar__summary,
.research-pillar ul,
.research-policy,
.research-bib-item__note,
.research-sky-list li,
.research-notes-item__teaser,
.sky-cal-month__lead,
.color-atlas-notes,
.sign-astro-facts li,
.ennea-limits p,
.ennea-guide-card__q,
.sign-detail p,
.sign-questions li { color: var(--ink); }
.research-agenda-item, .research-bib-avoid, .research-pillar { border-radius: 0; }

/* Research note cards use the same readable light surface as the research hub. */
.research-notes-item {
  background: var(--pale);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0;
}
.research-notes-item__link { color: var(--ink); }
.research-notes-item__link:hover { background: var(--surface); }
.research-notes-item__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.research-notes-item__pillar { color: var(--accent); font-size: .75rem; font-weight: 500; }
.research-notes-item__title { color: var(--ink); font-size: 1.1rem; }
.research-notes-item__teaser { color: var(--ink); font-size: .9rem; line-height: 1.7; }
.research-notes-item__date { color: var(--muted); font-size: .8rem; }

.color-atlas-card {
  background: var(--pale);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 0;
  grid-template-columns: 3.2rem minmax(0, 1fr);
}
.color-atlas-card__head { flex-wrap: wrap; }
.source-content .color-atlas-card__head h2 { margin: 0; font-size: 1.35rem; line-height: 1.4; }
.color-atlas-card__head a { color: var(--ink); }
.color-atlas-card__head a:hover { color: var(--accent); }
.color-atlas-card__head a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.color-atlas-card__element, .color-atlas-card__bridge { color: var(--muted); font-size: .8rem; }
.color-atlas-card__hex { color: var(--accent); font-size: .8rem; overflow-wrap: anywhere; }
.color-atlas-card__role { color: var(--ink); font-size: .9rem; line-height: 1.6; }
