/* Unbyul web — "night sky × eastern gold leaf" */
:root {
  --night-950: #060a18;
  --night-900: #0b1230;
  --night-800: #121b40;
  --night-700: #1c2756;
  --moon: #eee8da;
  --mist: #a9b1cc;
  --mist-2: #7d86a6;
  --gold-300: #f2dc9a;
  --gold-500: #d8b45e;
  --gold-700: #a8842f;
  --paper: #f6f1e6;
  --paper-2: #ece4d0;
  --paper-3: #ddd2b8;
  --ink: #141a33;
  --ink-2: #4a5070;
  --ink-3: #666b88;
  --el-wood: #3fa68a;
  --el-fire: #e0603f;
  --el-earth: #c89b4a;
  --el-metal: #d9dce3;
  --el-water: #5b7fbf;

  --font-display: "Cormorant Garamond", "Noto Serif KR", "Noto Serif JP", "Apple Myungjo", "Hiragino Mincho ProN", Georgia, serif;
  --font-body: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Apple SD Gothic Neo", "Hiragino Sans", system-ui, sans-serif;

  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;
}
html[lang="ko"] {
  --font-display: "Noto Serif KR", "Cormorant Garamond", "Apple Myungjo", serif;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}
html[lang="ja"] {
  --font-display: "Noto Serif JP", "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
}
/* keep-all suits Korean (breaks between words) but makes Japanese unbreakable; Japanese breaks per character under kinsoku rules. */
html[lang="ja"] body { word-break: normal; line-break: strict; overflow-wrap: break-word; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] .hero-sub { word-break: auto-phrase; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--moon);
  background: var(--night-900);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.light { background: radial-gradient(120% 70% at 70% 0%, var(--night-700) 0%, var(--night-900) 45%, var(--night-950) 100%) fixed; }
body.paper { background: var(--paper); color: var(--ink); }
main { flex: 1; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; border-radius: 2px; }
.paper :focus-visible { outline-color: var(--gold-700); }
img, svg { display: block; max-width: 100%; }
small { font-size: 0.8em; }

.skip { position: absolute; left: var(--gutter); top: -3rem; padding: 0.5rem 0.9rem; background: var(--gold-500); color: var(--night-950); border-radius: var(--radius); z-index: 10; text-decoration: none; }
.skip:focus { top: 0.75rem; }

/* Header */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem var(--gutter);
  max-width: 72rem; margin: 0 auto; width: 100%;
}
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--gold-500); }
.paper .wordmark { color: var(--gold-700); }
.seal { width: 1.6rem; height: 1.6rem; }
.wordmark-text { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.02em; color: var(--moon); }
.paper .wordmark-text { color: var(--ink); }
.lang { display: flex; gap: 0.25rem; font-size: 0.9rem; }
.lang a { padding: 0.3rem 0.55rem; text-decoration: none; color: var(--mist); border-radius: var(--radius); }
.lang a:hover { color: var(--moon); }
.lang a[aria-current="true"] { color: var(--gold-300); box-shadow: inset 0 -1.5px 0 var(--gold-500); }
.paper .lang a { color: var(--ink-2); }
.paper .lang a:hover { color: var(--ink); }
.paper .lang a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -1.5px 0 var(--gold-700); }

/* Hero */
.hero {
  max-width: 72rem; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
  display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } .hero-copy { order: 1; } .sky { order: 2; } }
.sky { position: relative; aspect-ratio: 4 / 3; width: 100%; max-height: 70vh; overflow: hidden; }
.sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 55%, transparent 100%); }
.sky-labels { position: absolute; inset: 0; pointer-events: none; color: var(--mist-2); font-weight: 500; opacity: 0; transition: opacity 900ms ease; }
.sky-labels.is-visible { opacity: 1; }
.sky-labels span { position: absolute; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .sky-labels { transition: none; } }
.pillars {
  position: absolute; inset: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); align-content: center; justify-items: center; gap: 0.5rem;
  padding: 1rem;
}
.js .pillars { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pillar { display: grid; justify-items: center; gap: 0.2rem; }
.pillar-label { font-size: 0.8rem; color: var(--mist-2); }
.stem, .branch { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 9vw, 5.5rem); line-height: 1.05; color: var(--c, var(--moon)); }

.hero-copy h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.2; letter-spacing: -0.005em;
  margin: 0 0 1rem; max-width: 20ch; text-wrap: balance;
}
html[lang="en"] .hero-copy h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); line-height: 1.12; max-width: 22ch; }
.hero-sub { margin: 0 0 1.75rem; max-width: 34rem; color: var(--mist); font-size: 1.1rem; }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.store {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem 1rem 0.65rem 0.85rem; border: 1px solid color-mix(in srgb, var(--gold-500) 55%, transparent);
  border-radius: 999px; color: var(--moon); font-weight: 500; font-size: 0.95rem;
}
.store svg { width: 1.15rem; height: 1.15rem; color: var(--gold-300); }
.store small { color: var(--mist-2); font-size: 0.78rem; padding-left: 0.4rem; border-left: 1px solid color-mix(in srgb, var(--mist-2) 50%, transparent); }

/* Content bands */
.band { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter); position: relative; }
.band::before {
  content: ""; display: block; width: min(100% - 2 * var(--gutter), 72rem); height: 1px; margin: 0 auto;
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold-500) 55%, transparent) 20%, color-mix(in srgb, var(--gold-500) 55%, transparent) 80%, transparent);
}
.band-inner { max-width: 72rem; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 0.75rem 3rem; }
@media (min-width: 900px) { .band-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } .band-inner h2 { grid-column: 1; } .band-inner p, .band-inner figure { grid-column: 2; } }
.band h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.25; margin: 0; color: var(--gold-300); max-width: 18ch; }
.band p { margin: 0; max-width: var(--measure); color: var(--moon); }

.elements { margin: 1.25rem 0 0; max-width: var(--measure); }
.elements-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.elements-bar span { display: block; background: var(--c); }
.elements figcaption { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin-top: 0.6rem; font-size: 0.9rem; color: var(--mist); }
.elements figcaption span::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--c); margin-right: 0.4em; vertical-align: 0.05em; }
[data-el="wood"]  { --c: var(--el-wood); }
[data-el="fire"]  { --c: var(--el-fire); }
[data-el="earth"] { --c: var(--el-earth); }
[data-el="metal"] { --c: var(--el-metal); }
[data-el="water"] { --c: var(--el-water); }

/* Footer */
.site-foot { margin-top: auto; padding: 2.5rem var(--gutter) 2.5rem; font-size: 0.9rem; color: var(--mist); position: relative; }
.site-foot::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(100% - 2 * var(--gutter), 72rem); height: 1px; background: color-mix(in srgb, var(--gold-500) 35%, transparent); }
.paper .site-foot { color: var(--ink-2); }
.paper .site-foot::before { background: color-mix(in srgb, var(--gold-700) 40%, transparent); }
.foot-inner { max-width: 72rem; margin: 0 auto; display: grid; gap: 1.25rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot-links a { text-decoration: none; color: var(--moon); }
.paper .foot-links a { color: var(--ink); }
.foot-links a:hover { text-decoration: underline; }
.foot-company p { margin: 0; line-height: 1.6; }
.foot-name { color: var(--moon); font-weight: 500; }
.paper .foot-name { color: var(--ink); }
.foot-disclaimer, .foot-made { margin: 0; color: var(--mist-2); }
.paper .foot-disclaimer, .paper .foot-made { color: var(--ink-3); }
.foot-made a { color: var(--gold-500); text-decoration: none; }
.paper .foot-made a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-700); }
.foot-made a:hover { text-decoration: underline; }

/* Documents (paper pages) */
.doc { max-width: 44rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.doc h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.005em; }
.doc-meta { margin: 0 0 1.25rem; color: var(--ink-3); font-size: 0.9rem; }
.doc-lead { font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); margin: 0 0 2rem; }
.doc-toc { margin: 0 0 2.5rem; padding: 1rem 1.25rem; border: 1px solid var(--paper-3); border-radius: var(--radius); background: color-mix(in srgb, var(--paper-2) 60%, transparent); font-size: 0.95rem; }
.doc-toc ol { margin: 0; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
@media (max-width: 600px) { .doc-toc ol { columns: 1; } }
.doc-toc li { margin: 0.15rem 0; break-inside: avoid; }
.doc-toc a { text-decoration: none; color: var(--ink-2); }
.doc-toc a:hover { color: var(--ink); text-decoration: underline; }
.doc section { margin: 0 0 2.5rem; scroll-margin-top: 1.5rem; }
.doc h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.3; margin: 0 0 0.9rem; padding-left: 0.9rem; border-left: 3px solid var(--gold-500); }
.doc h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--ink); }
.doc p, .doc li { color: var(--ink); }
.doc p { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.doc li { margin: 0.3rem 0; }
.doc li::marker { color: var(--gold-700); }
.doc a { color: var(--ink); text-decoration-color: var(--gold-700); }
.doc table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.5rem; font-size: 0.92rem; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--paper-3); }
.doc th { font-weight: 700; color: var(--ink-2); border-bottom: 1.5px solid var(--gold-500); background: color-mix(in srgb, var(--paper-2) 50%, transparent); }
.doc th:first-child, .doc td:first-child { padding-left: 0; }
.doc th:last-child, .doc td:last-child { padding-right: 0; }
@media (max-width: 600px) {
  .doc table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.doc details { border-top: 1px solid var(--paper-3); padding: 0.6rem 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--paper-3); }
.doc summary { cursor: pointer; font-weight: 500; padding: 0.3rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; color: var(--gold-700); font-family: var(--font-display); font-size: 1.3rem; line-height: 1; flex: none; }
.doc details[open] summary::after { content: "–"; }
.doc details p { margin: 0.5rem 0 0.6rem; color: var(--ink-2); }
.doc strong { font-weight: 700; }
.notfound { text-align: left; }

/* Paper header rule */
.paper .site-head { border-bottom: 1px solid color-mix(in srgb, var(--gold-700) 30%, transparent); }

@media print {
  body.paper { background: #fff; color: #000; }
  .site-head, .site-foot .foot-links, .lang, .skip { display: none; }
  .doc { max-width: none; padding: 0; }
  .doc a { text-decoration: none; }
  .doc details { page-break-inside: avoid; }
  .doc details > :not(summary) { display: block; }
}
