/* ──────────────────────────────────────────────────────────────
   Unha · home page (ink edition)
   Scoped to body.landing. Every class is prefixed ld- so nothing
   collides with the shared application styles in unha.css.
   The hero is a live Four Pillars chart drawn for this minute;
   an ink-river film (Higgsfield · Kling 2.6, ping-pong looped)
   runs behind it, one cut for light and one for dark.
   ────────────────────────────────────────────────────────────── */
body.landing {
  --film-light: block;
  --film-dark: none;
  --film-opacity: 0.55;
  --line-soft: color-mix(in srgb, var(--line) 55%, transparent);
  --shadow: 0 30px 60px -30px rgba(23, 25, 28, 0.35);
  --geum-core: #f4f3ee;
}
@media (prefers-color-scheme: dark) {
  body.landing {
    --film-light: none;
    --film-dark: block;
    --film-opacity: 0.6;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
    --geum-core: #2a2f36;
  }
}
body.landing .ld-fine {
  font-size: 14px;
  color: var(--mute);
  margin: 0;
}
body.landing .ld-quiet {
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
body.landing .ld-quiet:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
body.landing .ld-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.landing .ld-stack p {
  max-width: 62ch;
  color: var(--ink-2);
  margin: 0;
}
body.landing .ld-stack .kicker {
  margin: 0;
}
body.landing .ld-stack h2,
body.landing .ld-stack h3 {
  margin: 0;
}
body.landing .ld-section {
  padding: clamp(56px, 8vw, 112px) 0;
  border-top: 1px solid var(--line-soft);
}
body.landing .ld-inner {
  display: grid;
  gap: 36px;
}
body.landing .ld-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

/* ── hero ─────────────────────────────────────────────── */
.ld-stage {
  position: relative;
  overflow: hidden;
}
.ld-film {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(70% 90% at 30% 50%, #000 15%, transparent 100%);
  mask-image: radial-gradient(70% 90% at 30% 50%, #000 15%, transparent 100%);
}
.ld-film video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--film-opacity);
  display: none;
}
.ld-film video.light {
  display: var(--film-light);
}
.ld-film video.dark {
  display: var(--film-dark);
}
.ld-film-toggle {
  position: absolute;
  right: 24px;
  bottom: 14px;
  z-index: 2;
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  background: color-mix(in srgb, var(--paper) 75%, transparent);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 10px;
  cursor: pointer;
}
.ld-film-toggle:hover {
  color: var(--ink);
  border-color: var(--mute);
}
.ld-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 7vw, 104px);
}
.ld-copy {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.ld-copy .kicker,
.ld-copy h1,
.ld-copy .lead {
  margin: 0;
}
.ld-copy h1 {
  max-width: 14ch;
}
.ld-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
}

/* birth input — split fields so the browser never renders an OS-language date picker */
.ld-birth {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--white) 70%, transparent);
  border-radius: 3px;
  max-width: 560px;
}
.ld-birth fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ld-birth legend {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 0;
  margin-bottom: 6px;
}
.ld-birth .row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  grid-template-columns: none;
}
.ld-birth input,
.ld-birth select {
  font: 500 15px var(--mono);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 10px;
  min-width: 0;
  width: auto;
  font-variant-numeric: tabular-nums;
}
.ld-birth input::placeholder {
  color: var(--mute);
  opacity: 1;
}
.ld-birth input.w4 {
  width: 6.5ch;
  text-align: center;
}
.ld-birth input.w2 {
  width: 4.5ch;
  text-align: center;
}
.ld-birth select {
  flex: 1 1 auto;
  padding-right: 26px;
  background-position: right 10px center;
}
.ld-birth .colon {
  font-family: var(--mono);
  color: var(--mute);
}
.ld-birth .go {
  font: 500 15px var(--sans);
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}
.ld-birth .go:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.ld-birth .ld-note {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}
.ld-birth .ld-note button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* the chart — four pillars, read right to left */
.ld-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ld-chart {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px) clamp(14px, 2.5vw, 26px) clamp(16px, 2.5vw, 24px);
  border-radius: 3px;
  overflow: hidden;
}
.ld-chart::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  border-radius: 2px;
}
.ld-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ld-chart-title {
  font-family: var(--hanja);
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 15px;
  color: var(--ink-2);
}
.ld-chart-stamp {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.ld-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 12px);
  direction: rtl; /* DOM order year→hour; shown right→left as the tradition writes it */
}
.ld-pillar {
  direction: ltr;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 12px;
  border-top: 1px solid var(--line);
  position: relative;
}
.ld-pillar .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.ld-pillar .lbl b {
  font-family: var(--hanja);
  font-weight: 700;
  color: var(--ink-2);
  margin-right: 5px;
}
.ld-glyph {
  font-family: var(--hanja);
  font-weight: 800;
  line-height: 1;
  font-size: clamp(38px, 5vw, 64px);
  display: grid;
  place-items: center;
  width: 1.2em;
  height: 1.2em;
  border-radius: 2px;
  transition:
    filter 0.6s ease,
    opacity 0.6s ease,
    color 0.3s ease;
}
.ld-glyph.geum {
  color: var(--geum);
  text-shadow: 0 0 0 var(--geum-core);
}
.ld-glyph.mok {
  color: var(--mok);
}
.ld-glyph.hwa {
  color: var(--hwa);
}
.ld-glyph.to {
  color: var(--to);
}
.ld-glyph.su {
  color: var(--su);
}
.ld-glyph.inking {
  filter: blur(3px);
  opacity: 0.4;
}
.ld-romn {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ld-romn .el {
  color: var(--ink-2);
}
.ld-romn .an {
  display: block;
}
.ld-pillar.day .stem-wrap {
  position: relative;
  display: inline-grid;
}
.ld-seal {
  position: absolute;
  top: -6px;
  right: -12px;
  font-family: var(--hanja);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.05;
  color: var(--seal);
  border: 1.5px solid var(--seal);
  border-radius: 2px;
  padding: 3px;
  writing-mode: vertical-rl;
  background: var(--seal-wash);
  transform: rotate(-4deg);
}
.ld-chart-foot {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--mute);
}
.ld-elements {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.ld-el {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}
.ld-el b {
  font-family: var(--hanja);
  font-weight: 700;
  color: var(--ink-2);
  font-size: 13px;
}
.ld-el .bar {
  width: 100%;
  height: 6px;
  background: var(--line-soft);
  border-radius: 1px;
  overflow: hidden;
  display: block;
  margin: 0;
  grid-template-columns: none;
}
.ld-el .bar i {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.5s ease;
}
.ld-el.mok .bar i {
  background: var(--mok);
}
.ld-el.hwa .bar i {
  background: var(--hwa);
}
.ld-el.to .bar i {
  background: var(--to);
}
.ld-el.geum .bar i {
  background: var(--geum);
}
.ld-el.su .bar i {
  background: var(--su);
}

/* ── reading: stems · branches · sixty ────────────────── */
.ld-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.ld-trio > div {
  background: var(--paper);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ld-trio .num {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
.ld-trio .num small {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  margin-left: 6px;
  letter-spacing: 0.1em;
}
.ld-trio .glyphs {
  font-family: var(--hanja);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.28em;
  color: var(--ink-2);
  line-height: 1.7;
}
.ld-trio .reading {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  line-height: 1.5;
  margin-top: -4px;
}
.ld-trio p {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0;
}
.ld-ring-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.ld-ring {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: block;
}
.ld-ring text {
  font-family: var(--hanja);
  fill: var(--mute);
  font-size: 11px;
}
.ld-ring .tick {
  stroke: var(--line);
}
.ld-ring .tick.major {
  stroke: var(--mute);
}
.ld-ring .now {
  fill: var(--accent);
}
.ld-ring .you {
  fill: var(--seal);
}
.ld-ring .arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.9;
}
.ld-ring .centre {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: 34px;
  fill: var(--ink);
}
.ld-ring .centre-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  fill: var(--mute);
}
.ld-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}
.ld-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.ld-legend .n i {
  background: var(--accent);
}
.ld-legend .y i {
  background: var(--seal);
}

/* ── doors — a list, not cards ────────────────────────── */
.ld-doors {
  display: grid;
  border-top: 1px solid var(--line);
}
.ld-door {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background 0.2s ease;
}
.ld-door:hover {
  background: linear-gradient(90deg, var(--accent-pale), transparent 60%);
}
.ld-door .k {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ld-door .k small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--mute);
  white-space: nowrap;
}
.ld-door .q {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 26px);
  font-variation-settings: "opsz" 72, "SOFT" 50;
}
.ld-door .d {
  color: var(--ink-2);
  font-size: 15px;
  margin: 6px 0 0;
  max-width: 52ch;
}
.ld-door .arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
}
.ld-door:hover .arrow {
  color: var(--ink);
}

/* ── five phases ──────────────────────────────────────── */
.ld-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.ld-tile {
  position: relative;
  margin: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--white);
}
.ld-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.ld-tile:hover img {
  transform: scale(1.03);
}
.ld-tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 14px 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(23, 25, 28, 0.55));
  color: #f4f3ee;
}
.ld-tile figcaption .h {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
}
.ld-tile figcaption .n {
  font-size: 13px;
  font-weight: 500;
}
.ld-tile figcaption .n small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ld-phases {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.ld-cycle {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: block;
}
.ld-cycle .gen {
  stroke: var(--mute);
  stroke-width: 1.5;
  fill: none;
}
.ld-cycle .ctl {
  stroke: var(--seal);
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 4 5;
  opacity: 0.85;
}
.ld-cycle .node circle {
  stroke: var(--paper);
  stroke-width: 3;
}
.ld-cycle .node .h {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: 26px;
  fill: var(--paper);
}
.ld-cycle .node.geum .h {
  fill: var(--ink);
}
.ld-cycle .node .n {
  font-family: var(--sans);
  font-size: 12px;
  fill: var(--ink-2);
  font-weight: 500;
}
.ld-cycle .node .w {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--mute);
  letter-spacing: 0.08em;
}
.ld-cycle .lbl {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--mute);
  letter-spacing: 0.12em;
}
.ld-phase-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.ld-phase {
  display: grid;
  grid-template-columns: 14px 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ld-phase .sw {
  width: 14px;
  height: 14px;
  border-radius: 1px;
}
.ld-phase .h {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
}
.ld-phase .t {
  display: flex;
  flex-direction: column;
}
.ld-phase .t b {
  font-weight: 600;
}
.ld-phase .t b em {
  font-style: italic;
  font-weight: 400;
  color: var(--mute);
}
.ld-phase .t span {
  color: var(--mute);
  font-size: 14px;
}
.ld-phase .m {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  line-height: 1.5;
  text-align: right;
}
.ld-phase .m i {
  font-style: normal;
  color: var(--ink-2);
}
.ld-phase.mok .sw {
  background: var(--mok);
}
.ld-phase.hwa .sw {
  background: var(--hwa);
}
.ld-phase.to .sw {
  background: var(--to);
}
.ld-phase.geum .sw {
  background: var(--geum);
}
.ld-phase.su .sw {
  background: var(--su);
}
.ld-phase.mok .h {
  color: var(--mok);
}
.ld-phase.hwa .h {
  color: var(--hwa);
}
.ld-phase.to .h {
  color: var(--to);
}
.ld-phase.geum .h {
  color: var(--geum);
}
.ld-phase.su .h {
  color: var(--su);
}

/* ── steps (a real sequence) ──────────────────────────── */
.ld-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  counter-reset: step;
}
.ld-step {
  background: var(--paper);
  padding: 26px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ld-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.ld-step h3 {
  font-size: 21px;
  margin: 0;
}
.ld-step p {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0;
}
.ld-step a {
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  align-self: flex-start;
}
.ld-step a:hover {
  border-bottom-color: var(--accent);
}

/* ── faq ──────────────────────────────────────────────── */
.ld-faq {
  border-top: 1px solid var(--line);
  max-width: 820px;
}
.ld-faq details {
  border-bottom: 1px solid var(--line);
}
.ld-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  font-family: var(--serif);
  font-size: 21px;
  font-variation-settings: "opsz" 48, "SOFT" 20;
}
.ld-faq summary::-webkit-details-marker {
  display: none;
}
.ld-faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--mute);
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.ld-faq details[open] summary::after {
  transform: rotate(45deg);
}
.ld-faq details p {
  padding: 0 0 22px;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
}
.ld-faq a {
  color: var(--accent);
}

/* ── closing ──────────────────────────────────────────── */
.ld-closing {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: end;
}
.ld-closing h2 {
  font-size: clamp(34px, 5vw, 60px);
  margin: 0;
}
.ld-closing-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}
.ld-big-hanja {
  font-family: var(--hanja);
  font-weight: 800;
  font-size: clamp(72px, 12vw, 150px);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.18;
  user-select: none;
}
.ld-big-hanja-gloss {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  margin-top: -10px;
}

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .ld-hero,
  body.landing .ld-split,
  .ld-ring-wrap,
  .ld-phases,
  .ld-closing {
    grid-template-columns: 1fr;
  }
  .ld-copy {
    order: -1;
  }
  .ld-film {
    -webkit-mask-image: radial-gradient(95% 60% at 50% 72%, #000 10%, transparent 100%);
    mask-image: radial-gradient(95% 60% at 50% 72%, #000 10%, transparent 100%);
  }
}
@media (max-width: 720px) {
  .ld-trio,
  .ld-steps {
    grid-template-columns: 1fr;
  }
  .ld-tiles {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-inline: -20px;
    padding-inline: 20px;
    scrollbar-width: thin;
  }
  .ld-tiles .ld-tile {
    flex: 0 0 62vw;
    scroll-snap-align: start;
  }
}
@media (max-width: 560px) {
  .ld-birth {
    grid-template-columns: 1fr;
  }
  .ld-door {
    grid-template-columns: 64px 1fr;
  }
  .ld-door .arrow {
    grid-column: 2;
  }
  .ld-phase {
    grid-template-columns: 14px 40px minmax(0, 1fr);
  }
  .ld-phase .m {
    grid-column: 3;
    text-align: left;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ld-glyph,
  .ld-el .bar i,
  .ld-tile img {
    transition: none;
  }
  .ld-glyph.inking {
    filter: none;
    opacity: 1;
  }
}
