/* 해태(/oss/haetae/) — haetae-robotics 를 따로 소개하는 페이지.
   화려함은 히어로 캔버스(해태가 달려와 포효) 한곳에 몰고, 아래는 판정·기록·한계를 차분하게 둔다.
   색은 해태 브랜드의 그래파이트(#111418)와 청록(#66d5d0)이고, 판정 색만 셋으로 나눈다.
   - yun(통과): 청록 · jeol(감속): 호박색 · bul(차단): 사이트 신호색(로고의 네모 마침표) */

:root {
  /** 해태 히어로와 기록 패널의 바탕. 브랜드 Graphite 에서 아래로 조금 더 어두워진다. */
  --ht-night: #111418;
  --ht-night-deep: #0a0d0f;
  --ht-on-night: #e7ebee;
  --ht-on-night-2: #a9b4ba;
  --ht-cyan: #66d5d0;
  --ht-cyan-soft: rgba(102, 213, 208, 0.16);
  /** 흰 바탕 위에서 읽히는 청록 글자(대비 6.0:1). */
  --ht-cyan-text: #0e6a65;
  --ht-amber: #f0b440;
  --ht-amber-text: #8a5a00;
  --ht-bul: var(--signal);
  --ht-bul-text: var(--signal-text);
}
html[data-resolved-theme="dark"] {
  --ht-cyan-text: #66d5d0;
  --ht-amber-text: #f2c25b;
}
html[data-contrast="high"] {
  --ht-night: #000000;
  --ht-night-deep: #000000;
  --ht-on-night: #ffffff;
  --ht-on-night-2: #e6e9ee;
  --ht-cyan-text: #7fe6e1;
  --ht-amber-text: #ffd27a;
}
/* 고대비는 기본이 검정 바탕이다. 흰 바탕은 "테마 따르기"를 고른 밝은 테마뿐이라(chrome.css 와 같은 조건) 그때만 진한 글자로 바꾼다. */
html[data-contrast="high"][data-high-contrast-color-scheme="theme"][data-resolved-theme="light"] {
  --ht-cyan-text: #0a4f4b;
  --ht-amber-text: #5e3d00;
}

/* ---------------------------------------------------------------- 히어로(늘 어두움) */
.ht-hero {
  position: relative; overflow: hidden; color: var(--ht-on-night);
  background:
    radial-gradient(60% 45% at 72% 100%, rgba(102, 213, 208, 0.1), rgba(102, 213, 208, 0) 70%),
    linear-gradient(180deg, var(--ht-night) 0%, var(--ht-night-deep) 100%);
  min-height: max(640px, calc(100svh - var(--header-height) - 34px));
  display: grid; align-items: start;
}
.ht-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ht-hero-inner { position: relative; z-index: 1; padding-block: clamp(40px, 7vw, 96px); pointer-events: none; }
.ht-hero-copy { display: grid; gap: 22px; justify-items: start; max-width: min(44rem, 54vw); }
.ht-hero-copy a, .ht-hero-copy button { pointer-events: auto; }
.ht-crumb { display: flex; gap: 8px; font-size: 0.875rem; color: var(--ht-on-night-2); }
.ht-crumb a { color: var(--ht-on-night-2); }
.ht-crumb a:hover { color: var(--ht-on-night); }
.ht-title {
  margin: 0; font-size: clamp(2.5rem, 5.3vw, 4.75rem); font-weight: 900; line-height: 1.02; letter-spacing: -0.055em;
  text-wrap: balance; text-shadow: 0 2px 30px rgba(10, 13, 15, 0.6);
}
.ht-lead { margin: 0; font-size: clamp(1rem, 1.4vw, 1.125rem); line-height: 1.7; color: #cdd6da; max-width: 32em; text-shadow: 0 1px 14px rgba(10, 13, 15, 0.85); }
.ht-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ht-facts li {
  font-size: 0.8125rem; font-weight: 650; padding: 3px 11px; border-radius: 999px;
  border: 1px solid rgba(231, 235, 238, 0.24); color: #cdd6da; background: rgba(10, 13, 15, 0.45);
}
.ht-hero :focus-visible { outline-color: var(--ht-cyan); }
.ht-button-line { border-color: rgba(231, 235, 238, 0.34); color: var(--ht-on-night); background: rgba(10, 13, 15, 0.35); }
.ht-button-line:hover { border-color: var(--ht-on-night); }

/* ---------------------------------------------------------------- 세 가지 판정 */
.verdict-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0 32px; }
.verdict { padding: 24px 0 8px; border-top: 2px solid var(--ink); display: grid; gap: 12px; align-content: start; }
/* 문 그림: 왼쪽 선(제안)이 기둥(해태)을 지나 오른쪽(로봇)으로 이어지는 모양이 판정마다 다르다 */
.gate { display: flex; align-items: center; height: 46px; }
.gate-in, .gate-out { flex: 1; height: 3px; border-radius: 2px; background: var(--ink); }
.gate-post { width: 12px; height: 46px; border-radius: 4px; margin-inline: 10px; background: var(--ink); position: relative; }
.gate-post::after { content: ""; position: absolute; left: 3px; right: 3px; top: 12px; height: 4px; border-radius: 2px; background: var(--ht-cyan); }
.verdict-yun .gate-out { background: var(--ht-cyan-text); }
.verdict-jeol .gate-out { height: 3px; background: repeating-linear-gradient(90deg, var(--ht-amber-text) 0 10px, transparent 10px 18px); }
.verdict-bul .gate-in { background: linear-gradient(90deg, var(--ink) 60%, var(--ht-bul)); }
.verdict-bul .gate-out { background: repeating-linear-gradient(90deg, var(--line-strong) 0 3px, transparent 3px 9px); height: 2px; }
.verdict-bul .gate-post { background: var(--ht-bul); }
.verdict-word { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.verdict-word .mono { font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.verdict-word span:last-child { font-weight: 750; font-size: 1.0625rem; }
.verdict-yun .verdict-word .mono { color: var(--ht-cyan-text); }
.verdict-jeol .verdict-word .mono { color: var(--ht-amber-text); }
.verdict-bul .verdict-word .mono { color: var(--ht-bul-text); }
.verdict-note { margin: 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- 저녁 식탁 예제(기록 패널은 늘 어두움) */
.ht-dinner { padding-top: 0; }
.replay { background: var(--ht-night); color: var(--ht-on-night); border-radius: 22px; padding: clamp(18px, 3vw, 32px); overflow: hidden; }
.replay-list { list-style: none; margin: 0; padding: 0; display: grid; }
.replay-row {
  display: grid; grid-template-columns: 2ch 7ch minmax(0, 1.3fr) 5ch minmax(0, 1fr); gap: 4px 16px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid rgba(231, 235, 238, 0.09); font-size: 0.9375rem;
}
.replay-id { color: var(--ht-on-night-2); font-family: var(--font-mono); }
.replay-source { color: var(--ht-on-night-2); font-family: var(--font-mono); font-size: 0.8125rem; }
.replay-action { font-family: var(--font-mono); font-size: 0.875rem; color: var(--ht-on-night); overflow-wrap: anywhere; }
.replay-verdict {
  justify-self: start; font-family: var(--font-mono); font-weight: 600; font-size: 0.8125rem;
  padding: 2px 9px; border-radius: 999px; color: #0a0d0f; background: var(--ht-cyan);
}
.is-jeol .replay-verdict { background: var(--ht-amber); }
/* 신호색 위 글자는 짝 토큰을 쓴다(흰 글자는 작은 글씨 대비 4.5:1 미달) */
.is-bul .replay-verdict { background: var(--signal); color: var(--on-signal); }
.replay-rules { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ht-on-night-2); overflow-wrap: anywhere; }
.is-bul .replay-action { text-decoration: line-through; text-decoration-color: rgba(255, 79, 31, 0.7); text-decoration-thickness: 1.5px; }
.replay-fault {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 9px 0 9px calc(2ch + 16px);
  border-bottom: 1px dashed rgba(240, 180, 64, 0.35); color: #f2c25b; font-size: 0.8125rem;
}
.replay-sum { margin: 16px 0 0; font-size: 0.8125rem; color: var(--ht-cyan); overflow-wrap: anywhere; }
.ht-caveat { margin: 18px 0 0; color: var(--ink-2); max-width: 46em; font-size: 0.9375rem; }
.ht-run { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; max-width: 52rem; }
.ht-run summary { cursor: pointer; font-weight: 750; width: max-content; }
.ht-run summary::marker { color: var(--ink-3); }
.ht-run-body { display: grid; gap: 12px; padding-top: 12px; }
.ht-run-body p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
.code {
  margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; overflow-x: auto;
}

/* ---------------------------------------------------------------- 실록 */
.ht-sillok-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px 64px; align-items: center; }
.ht-sillok-grid .section-head { margin-bottom: 0; }
.ht-limit { margin: 0; padding-left: 14px; border-left: 3px solid var(--ht-cyan); color: var(--ink-2); max-width: 36em; }
.chain { margin: 0; display: grid; gap: 22px; }
.chain-cells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 14px 8px; }
.chain-cells li { aspect-ratio: 1; border-radius: 7px; position: relative; border: 2px solid transparent; }
/* 해시 체인: 칸마다 다음 칸으로 짧은 고리를 잇는다(줄 끝 칸은 잇지 않는다) */
.chain-cells li:not(:nth-child(13n))::after {
  content: ""; position: absolute; left: 100%; top: 50%; width: 8px; height: 2px; background: var(--line-strong);
}
.k-proposal { background: transparent; border-color: var(--ink-3) !important; }
.k-decision { background: var(--ink); }
.k-decision.is-bul { background: var(--ht-bul); }
.k-world { background: var(--surface-2); }
.k-fault { background: var(--ht-amber); }
.k-seal { background: var(--ht-cyan); box-shadow: 0 0 0 3px var(--ht-cyan-soft); }
.chain figcaption { display: grid; gap: 10px; color: var(--ink-2); font-size: 0.875rem; }
.chain figcaption p { margin: 0; }
.chain-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.chain-legend li { display: inline-flex; align-items: center; gap: 7px; }
.chain-legend i { width: 12px; height: 12px; border-radius: 3px; border: 2px solid transparent; }

/* ---------------------------------------------------------------- 하지 않는 일 */
.ht-limits { padding-top: 0; }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 32px; }
.limits-col { display: grid; gap: 14px; align-content: start; padding-top: 22px; border-top: 2px solid var(--ink); }
.limits-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.limits-list li { position: relative; padding-left: 28px; color: var(--ink-2); }
.limits-list li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 14px; height: 2.5px; border-radius: 2px; background: var(--ink-3); }
.limits-list.is-yes li::before { width: 12px; height: 12px; top: 0.42em; border-radius: 3px; background: var(--ht-cyan); }

/* ---------------------------------------------------------------- 같은 조직 */
.ht-org { padding-top: 0; }
.org-card { border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 32px); max-width: 52rem; }
.org-card-body { display: grid; gap: 10px; }
.org-card-body p { margin: 0; color: var(--ink-2); }
.org-card-name { margin: 0; font-family: var(--font-mono); font-weight: 600; font-size: 1.75rem; letter-spacing: -0.02em; }
.org-card-name a { text-decoration: none; }
.org-card-name a:hover { text-decoration: underline; text-decoration-color: var(--ht-cyan); text-underline-offset: 0.2em; }
.org-card-foot { display: flex; gap: 8px; }
.org-card-foot span { font-size: 0.8125rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.org-link { margin: 18px 0 0; }

/* ---------------------------------------------------------------- 좁은 화면
   빛 입자가 글 아래에서 해태로 모이도록 히어로 아래쪽에 자리를 비운다(haetae.js 의 좁은 화면 기준 900px 과 같다). */
@media (max-width: 899px) {
  .ht-hero { min-height: 0; }
  .ht-hero-inner { padding-bottom: clamp(285px, 74vw, 300px); }
  .ht-hero-copy { max-width: 36rem; }
  .ht-sillok-grid { grid-template-columns: minmax(0, 1fr); }
  .replay-row { grid-template-columns: 2ch 6ch minmax(0, 1fr) auto; }
  .replay-rules { grid-column: 3 / -1; }
  .replay-fault { padding-left: 0; }
}
@media (max-width: 520px) {
  .replay-row { grid-template-columns: 2ch minmax(0, 1fr) auto; }
  .replay-source { grid-column: 2; grid-row: 1; }
  .replay-action { grid-column: 2 / -1; grid-row: 2; }
  .replay-verdict { grid-column: 3; grid-row: 1; justify-self: end; }
  .replay-rules { grid-column: 2 / -1; grid-row: 3; }
  .chain-cells { gap: 10px 6px; }
  .chain-cells li:not(:nth-child(13n))::after { width: 6px; }
}
