/* ==================================================================
 * Record Archive
 *
 * 밝은 바탕을 기본으로 하고 보라–파랑 그라데이션을 강조로 쓰는 한 장짜리
 * 디자인 시스템. 외부 폰트나 CDN 없이 light-dark() 토큰으로 두 테마를 함께
 * 정의한다. 식별자와 수치에만 모노스페이스를 남긴다.
 * ================================================================== */

:root {
  color-scheme: light dark;

  /* 바탕과 면 */
  --bg: light-dark(#f6f7fb, #08080e);
  --surface: light-dark(#ffffff, #11111a);
  --surface-2: light-dark(#f1f2f8, #0d0d14);
  --surface-raised: light-dark(#ffffff, #16161f);

  /* 선 */
  --line: light-dark(rgba(17, 20, 45, 0.08), rgba(190, 195, 255, 0.1));
  --line-strong: light-dark(rgba(17, 20, 45, 0.18), rgba(190, 195, 255, 0.22));
  --dot: light-dark(rgba(17, 20, 45, 0.055), rgba(190, 195, 255, 0.07));

  /* 글자 */
  --text: light-dark(#11142d, #e7e9f5);
  --text-soft: light-dark(#474c66, #a4a9c4);
  --text-dim: light-dark(#767c92, #7c8099);

  /* 강조 */
  --violet: light-dark(#6d4aff, #a78bfa);
  --blue: light-dark(#2f8bff, #60a5fa);
  --violet-soft: light-dark(rgba(109, 74, 255, 0.1), rgba(167, 139, 250, 0.14));
  --blue-soft: light-dark(rgba(47, 139, 255, 0.1), rgba(96, 165, 250, 0.14));
  --live: light-dark(#13a05c, #4ade80);
  --live-soft: light-dark(rgba(19, 160, 92, 0.12), rgba(74, 222, 128, 0.14));
  --focus: light-dark(#6d4aff, #c4b5fd);

  /* 심각도 */
  --sev-critical: light-dark(#c01c37, #fb7185);
  --sev-high: light-dark(#b45309, #fbbf24);
  --sev-medium: light-dark(#8a6d00, #fcd34d);
  --sev-low: light-dark(#0e7490, #67e8f9);
  --sev-none: light-dark(#6b7280, #9ca3af);

  --on-accent: #ffffff;

  --shadow-sm: light-dark(
    0 1px 2px rgba(17, 20, 45, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.5)
  );
  --shadow-md: light-dark(
    0 1px 2px rgba(17, 20, 45, 0.04), 0 14px 36px -22px rgba(17, 20, 45, 0.28),
    0 1px 2px rgba(0, 0, 0, 0.6), 0 18px 44px -26px rgba(0, 0, 0, 0.9)
  );

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shell: 1180px;

  --font-sans: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", "D2Coding", monospace;

  --step: 220ms;
  --step-slow: 620ms;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="system"] { color-scheme: light dark; }

:root[data-contrast="more"] {
  --line: light-dark(rgba(17, 20, 45, 0.4), rgba(231, 233, 245, 0.42));
  --line-strong: light-dark(rgba(17, 20, 45, 0.7), rgba(231, 233, 245, 0.72));
  --text-soft: light-dark(#1b1f3a, #dfe3f2);
  --text-dim: light-dark(#2f3450, #c3c8dd);
}

* { box-sizing: border-box; }

/* 이 시트는 .status-card·.empty-state 등에 display 를 직접 준다. 그러면
 * 브라우저 기본값인 [hidden] { display: none } 보다 우선해 숨김이 풀린다.
 * 숨김은 렌더러가 쓰는 유일한 가시성 수단이므로 여기서 못박는다. */
[hidden] {
  display: none !important;
}

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--violet);
  color: var(--on-accent);
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd, dt { margin: 0; }

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

a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.shell {
  width: min(100% - 2rem, var(--shell));
  margin-inline: auto;
}

@media (min-width: 720px) {
  .shell { width: min(100% - 4rem, var(--shell)); }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--violet);
  color: var(--on-accent);
  font-weight: 600;
}

.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* ── 바탕: 점 격자와 은은한 번짐 ──────────────────────────────── */

.grid-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 26px 26px;
}

.grid-backdrop::after {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 72vh;
  background:
    radial-gradient(44rem 26rem at 18% 0%, var(--violet-soft), transparent 70%),
    radial-gradient(40rem 24rem at 82% 8%, var(--blue-soft), transparent 70%);
}

/* ── 공통 라벨 ────────────────────────────────────────────────── */

.eyebrow {
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--violet);
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--text-soft);
  white-space: nowrap;
}

.badge--severity[data-severity="critical"] { color: var(--sev-critical); border-color: var(--sev-critical); }
.badge--severity[data-severity="high"] { color: var(--sev-high); border-color: var(--sev-high); }
.badge--severity[data-severity="medium"] { color: var(--sev-medium); border-color: var(--sev-medium); }
.badge--severity[data-severity="low"] { color: var(--sev-low); border-color: var(--sev-low); }
.badge--status { color: var(--violet); border-color: var(--violet); background: var(--violet-soft); }

/* ── 헤더 ─────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: light-dark(rgba(246, 247, 251, 0.82), rgba(8, 8, 14, 0.78));
  backdrop-filter: blur(14px);
  transition: border-color var(--step) var(--ease), box-shadow var(--step) var(--ease);
}

.site-header.is-condensed {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover { text-decoration: none; }

.brand-sigil {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: -0.08em;
}

.brand-title { transition: color var(--step) var(--ease); }
.brand:hover .brand-title { color: var(--violet); }

.header-tools { display: flex; align-items: center; gap: 0.5rem; }

.primary-nav { display: none; gap: 0.1rem; }

@media (min-width: 880px) {
  .primary-nav { display: flex; }
}

.primary-nav a {
  padding: 0.32rem 0.7rem;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--step) var(--ease), background var(--step) var(--ease);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.primary-nav a.is-active {
  color: var(--violet);
  background: var(--violet-soft);
}

/* 화면 설정 */

.display-settings { position: relative; }

.display-settings summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  padding: 0.34rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  cursor: pointer;
  list-style: none;
  transition: border-color var(--step) var(--ease), color var(--step) var(--ease);
}

.display-settings summary::-webkit-details-marker { display: none; }
.display-settings summary:hover { border-color: var(--line-strong); color: var(--text); }

@media (max-width: 520px) {
  .display-settings-text { display: none; }
}

.display-settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  z-index: 50;
  display: grid;
  gap: 0.55rem;
  min-width: 15rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.display-settings-panel label { font-size: 0.78rem; color: var(--text-dim); }

.display-toggle {
  display: flex;
  align-items: center;
  gap: 0.5ch;
  color: var(--text-soft);
  cursor: pointer;
}

.display-settings-panel select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
}

input[type="checkbox"] { accent-color: var(--violet); }

/* ── 구역 ─────────────────────────────────────────────────────── */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }

.section--tinted {
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.9rem;
}

@media (min-width: 900px) {
  .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(0, 23rem);
    align-items: end;
    gap: 2rem;
  }
}

.section-heading h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }

.section-heading > p:last-child {
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ── 히어로 ───────────────────────────────────────────────────── */

.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(3rem, 8vw, 6rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  align-items: center;
}

.hero-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  display: grid;
  gap: 1rem;
  align-content: start;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-title {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-title-text {
  background: linear-gradient(96deg, var(--violet) 8%, var(--blue) 72%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .hero-title-text { color: var(--violet); }
}

.handle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.handle::before { content: "@"; opacity: 0.6; }

.hero-intro {
  max-width: 54ch;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

/* 프로필 카드 */

.profile-card {
  align-self: start;
  display: grid;
  gap: 1.1rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7rem;
  background: linear-gradient(180deg, var(--violet-soft), transparent);
  pointer-events: none;
}

.profile-card > * { position: relative; }

.profile-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: var(--on-accent);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-card-name { font-size: 1.1rem; font-weight: 700; }
.profile-card-role { color: var(--text-dim); font-size: 0.84rem; }

.profile-facts {
  display: grid;
  gap: 0.6rem;
  padding-top: 0.2rem;
  border-top: 1px solid var(--line);
}

.profile-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.6rem;
}

.profile-facts dt { color: var(--text-dim); font-size: 0.8rem; }
.profile-facts dd { color: var(--text-soft); font-size: 0.86rem; text-align: right; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag-list li {
  padding: 0.16rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.75rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--text-soft);
  font-size: 0.8rem;
  transition: border-color var(--step) var(--ease), color var(--step) var(--ease);
}

.profile-links a:hover {
  border-color: var(--violet);
  color: var(--violet);
  text-decoration: none;
}

/* ── 상태 카드 ────────────────────────────────────────────────── */

.status-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-block: 1rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.status-card--error {
  flex-wrap: wrap;
  justify-content: space-between;
  border-color: var(--sev-critical);
}

.status-card--error h2 { font-size: 1rem; color: var(--text); }
.status-card--error p { color: var(--text-dim); font-size: 0.85rem; }

.status-pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  animation: live-pulse 1.6s var(--ease) infinite;
}

/* ── 지표 스트립 ──────────────────────────────────────────────── */

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.4rem;
}

.metric {
  display: grid;
  gap: 0.1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.metric-icon {
  display: none;
}

.metric-icon svg { width: 17px; height: 17px; }

.metric dt {
  order: 2;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.metric dd {
  order: 1;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric--advisory .metric-icon { background: var(--blue-soft); color: var(--blue); }
.metric--credential .metric-icon { background: var(--live-soft); color: var(--live); }
.metric.is-counting dd { color: var(--violet); }

.embargo-note {
  margin-top: 1rem;
  padding: 0.75rem 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text-dim);
  font-size: 0.84rem;
}

.embargo-note strong { color: var(--violet); font-family: var(--font-mono); }

/* ── 심각도 분포 ──────────────────────────────────────────────── */

.severity-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.severity-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 0.24rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--text-soft);
}

.severity-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip, var(--sev-none));
}

.severity-chip[data-severity="critical"] { --chip: var(--sev-critical); }
.severity-chip[data-severity="high"] { --chip: var(--sev-high); }
.severity-chip[data-severity="medium"] { --chip: var(--sev-medium); }
.severity-chip[data-severity="low"] { --chip: var(--sev-low); }
.severity-chip[data-severity="none"] { --chip: var(--sev-none); }

.severity-chip b { color: var(--text); font-family: var(--font-mono); }

/* ── 취약점 카드 ──────────────────────────────────────────────── */

.advisory-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.advisory-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.85rem 0.25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background var(--step) var(--ease);
}

.advisory-card:hover {
  background: var(--surface-2);
}

.advisory-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  flex: 1 1 20rem;
}

.advisory-id {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.advisory-id[data-unassigned="true"] { color: var(--text-dim); font-weight: 500; }

.advisory-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.advisory-title {
  flex: 1 1 100%;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.advisory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  color: var(--text-dim);
  font-size: 0.79rem;
}

/* ── 자격 카드 ────────────────────────────────────────────────── */

.credential-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.credential-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.85rem 0.25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background var(--step) var(--ease);
}

.credential-card:hover {
  background: var(--surface-2);
}
.credential-card[data-expired="true"] { opacity: 0.68; }

.credential-name {
  flex: 1 1 18rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.credential-issuer { color: var(--violet); font-size: 0.84rem; font-weight: 600; }
.credential-period,
.credential-serial { color: var(--text-dim); font-size: 0.79rem; }
.credential-serial { font-family: var(--font-mono); }

/* ── 타임라인 ─────────────────────────────────────────────────── */

.timeline-list { display: grid; gap: 2.2rem; }

.timeline-year { display: grid; gap: 0.9rem; }

.timeline-year-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.timeline-year-head h3 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--violet);
}

.timeline-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.timeline-entries {
  display: grid;
  padding-left: 0.65rem;
  border-left: 2px solid var(--line);
}

.timeline-entry {
  position: relative;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.65rem 0 0.65rem 1.3rem;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 1.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-dim);
}

.timeline-entry[data-kind="ctf"]::before { border-color: var(--violet); }
.timeline-entry[data-kind="advisory"]::before { border-color: var(--blue); }
.timeline-entry[data-kind="credential"]::before { border-color: var(--live); }

.timeline-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
}

.timeline-kind {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timeline-entry[data-kind="ctf"] .timeline-kind { color: var(--violet); }
.timeline-entry[data-kind="advisory"] .timeline-kind { color: var(--blue); }
.timeline-entry[data-kind="credential"] .timeline-kind { color: var(--live); }

.timeline-title { font-weight: 600; }
.timeline-detail,
.timeline-date { color: var(--text-dim); font-size: 0.79rem; }

/* ── 수상 ─────────────────────────────────────────────────────── */

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.9rem;
}/* ── 팀 이력 ──────────────────────────────────────────────────── */

.team-history-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.team-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.2rem;
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.team-name { font-weight: 700; }
.team-period,
.team-counts { color: var(--text-dim); font-size: 0.8rem; }

/* ── 비교 표 ──────────────────────────────────────────────────── */

.comparison-grid { display: grid; gap: 1.2rem; }

@media (min-width: 920px) {}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}/* ── 상세 ─────────────────────────────────────────────────────── */

.record-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}.record-detail-grid dt,
.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}.field-label { margin-bottom: 0.4rem; }

.source-links { display: grid; gap: 0.3rem; font-size: 0.86rem; }/* ── 필터 ─────────────────────────────────────────────────────── */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.3rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filters--compact { margin-bottom: 1.5rem; }

.filter { display: grid; gap: 0.3rem; min-width: 0; }
.filter--search { grid-column: 1 / -1; }

@media (min-width: 760px) {
  .filter--search { grid-column: span 2; }
}

.filter label { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }

.filter input,
.filter select {
  width: 100%;
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  transition: border-color var(--step) var(--ease), box-shadow var(--step) var(--ease);
}

.filter input::placeholder { color: var(--text-dim); }

.filter input:focus-visible,
.filter select:focus-visible {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
  outline: none;
}

/* ── 버튼 ─────────────────────────────────────────────────────── */

.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 0.52rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--step) var(--ease), color var(--step) var(--ease),
    background var(--step) var(--ease), transform var(--step) var(--ease),
    box-shadow var(--step) var(--ease);
}

.button:hover {
  border-color: var(--violet);
  color: var(--violet);
  text-decoration: none;
  transform: translateY(-1px);
}

.button:active { transform: translateY(0); }

.button--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: var(--on-accent);
  box-shadow: 0 10px 24px -14px var(--violet);
}

.button--primary:hover {
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: 0 14px 30px -14px var(--violet);
}

.button--quiet { background: transparent; border-color: var(--line); }
.button--secondary { border-color: var(--violet); color: var(--violet); }
.button--ghost { background: transparent; }

.button .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: currentColor;
  opacity: 0.22;
  pointer-events: none;
  animation: ripple-out 520ms var(--ease) forwards;
}

@keyframes ripple-out {
  to { transform: scale(2.6); opacity: 0; }
}

/* ── 기록 목록 ────────────────────────────────────────────────── */

.record-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.8rem;
  color: var(--text-dim);
  font-size: 0.81rem;
}

.record-legend { display: flex; align-items: center; gap: 0.4ch; }

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 0.7rem;
  border-radius: 50%;
  background: var(--text-dim);
}

.legend-dot:first-child { margin-left: 0; }
.legend-dot--individual { background: var(--violet); }
.legend-dot--team { background: var(--blue); }

.record-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  transition: opacity var(--step) var(--ease);
}

.record-list.is-updating { opacity: 0.4; }

.record-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.85rem 0.25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: background var(--step) var(--ease);
}

.record-card:hover,
.record-card:focus-within {
  background: var(--surface-2);
}

.record-card[data-featured="true"] .record-event::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 0.5ch;
  translate: 0 -0.25em;
  border-radius: 50%;
  background: var(--violet);
}

.record-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  flex: 1 1 20rem;
}

.record-event {
  font-size: 0.95rem;
  font-weight: 600;
}
.record-event a { color: inherit; }
.record-rank {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  color: var(--text-dim);
  font-size: 0.79rem;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 0.8rem;
  padding: 2.2rem 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ── 푸터 ─────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.8rem;
  color: var(--text-dim);
  font-size: 0.81rem;
}

.prompt-mark { color: var(--violet); font-family: var(--font-mono); font-weight: 700; }

.noscript-message {
  margin: 1rem;
  padding: 1rem;
  border: 1px solid var(--sev-high);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
}

/* ── 스크롤 진행 레일 ─────────────────────────────────────────── */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.scroll-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--blue));
  scale: var(--progress, 0) 1;
  transform-origin: 0 50%;
  transition: scale 90ms linear;
}

/* ── 진입 연출 ────────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity var(--step-slow) var(--ease) var(--reveal-delay, 0ms),
    translate var(--step-slow) var(--ease) var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed { opacity: 1; translate: none; }

[data-reveal-stagger] > * {
  opacity: 0;
  translate: 0 12px;
  transition:
    opacity var(--step) var(--ease) var(--stagger-delay, 0ms),
    translate var(--step) var(--ease) var(--stagger-delay, 0ms);
}

[data-reveal-stagger].is-revealed > * { opacity: 1; translate: none; }

/* ── 반응형 ───────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .credential-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .advisory-list { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: 2.8rem; }
}

@media (max-width: 390px) {
  body { font-size: 14.5px; }

  .shell { width: calc(100% - 1.5rem); }
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .filters,
  .profile-card,
  .advisory-card,
  .record-card,
  .credential-card { padding: 1rem; }
}

/* ── 움직임 차단 ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .status-dot,
  .status-pulse { animation: none; }

  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

:root[data-motion="reduce"] { scroll-behavior: auto; }

:root[data-motion="reduce"] *,
:root[data-motion="reduce"] *::before,
:root[data-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

:root[data-motion="reduce"] [data-reveal],
:root[data-motion="reduce"] [data-reveal-stagger] > * {
  opacity: 1;
  translate: none;
}

/* ── 인쇄 ─────────────────────────────────────────────────────── */

@media print {
  .grid-backdrop,
  .scroll-progress,
  .site-header,
  .filters,
  .hero-actions,
  .button,
  .noscript-message { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }

  .section--tinted {
    background: #fff;
    border-color: #ccc;
  }

  .section { padding-block: 1.2rem; }

  .advisory-card,
  .record-card,
  .credential-card,
    .profile-card,
  .record-detail-card {
    background: #fff;
    border-color: #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .hero-title-text { color: #000; background: none; }

  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1 !important;
    translate: none !important;
  }

  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

/* ── 분리된 페이지의 머리말 ───────────────────────────────────── */

.page-intro {
  display: grid;
  gap: 0.7rem;
  padding-block: clamp(2.4rem, 6vw, 4rem) 0;
}

.page-title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.metric-grid--compact {
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.metric-grid--compact .metric { padding: 0.9rem 1rem; }
.metric-grid--compact .metric dd { font-size: clamp(1.4rem, 3.4vw, 1.8rem); }

.primary-nav a[aria-current="page"] {
  color: var(--violet);
  background: var(--violet-soft);
}

/* ==================================================================
 * 모션 레이어
 *
 * 브라우저가 직접 돌리는 것부터 쓴다. 페이지 전환은 View Transitions,
 * 진입 연출은 스크롤 구동 타임라인, 그라데이션은 등록된 사용자 속성으로
 * 보간한다. JavaScript 는 포인터를 따라가는 값만 넣는다.
 * ================================================================== */

/* ── 보간 가능한 사용자 속성 ──────────────────────────────────── */

@property --grad-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 96deg;
}

@property --sheen {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@property --glow {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

:root {
  /* 스프링에 가까운 감속. cubic-bezier 로는 끝에서 한 번 넘겼다 돌아오는
     느낌이 안 나온다. */
  --spring: linear(
    0, 0.0063 1.56%, 0.0258 3.2%, 0.1035 6.48%, 0.4133 15.6%, 0.5341 19.19%,
    0.6362 22.86%, 0.7217 26.62%, 0.7933 30.54%, 0.8529 34.69%, 0.9014 39.14%,
    0.9403 44.06%, 0.9703 49.6%, 0.9921 56.08%, 1.0043 62.56%, 1.0088 69.04%,
    1.0074 79.14%, 1.0016 100%
  );
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 페이지 전환 ──────────────────────────────────────────────── */

@view-transition {
  navigation: auto;
}

/* 헤더와 바탕은 전환 내내 제자리에 남는다. */
.site-header { view-transition-name: site-header; }
.grid-backdrop { view-transition-name: site-backdrop; }
.site-footer { view-transition-name: site-footer; }

::view-transition-old(root) {
  animation: vt-out 260ms var(--ease-out-quint) both;
}

::view-transition-new(root) {
  animation: vt-in 420ms var(--ease-out-quint) both;
}

::view-transition-old(site-header),
::view-transition-new(site-header),
::view-transition-old(site-backdrop),
::view-transition-new(site-backdrop),
::view-transition-old(site-footer),
::view-transition-new(site-footer) {
  animation: none;
  mix-blend-mode: normal;
}

@keyframes vt-out {
  to { opacity: 0; translate: 0 -10px; filter: blur(3px); }
}

@keyframes vt-in {
  from { opacity: 0; translate: 0 18px; filter: blur(4px); }
}

/* ── 스크롤 구동 진입 ─────────────────────────────────────────── */

@keyframes reveal-rise {
  from { opacity: 0; translate: 0 26px; scale: 0.985; }
  to { opacity: 1; translate: none; scale: 1; }
}

@supports (animation-timeline: view()) {
  /* 타임라인이 값을 지배하므로 JS 가 클래스를 붙이지 않아도 된다. */
  [data-reveal] {
    opacity: 1;
    translate: none;
    transition: none;
    animation: reveal-rise linear both;
    animation-timeline: view();
    animation-range: entry 2% cover 26%;
  }

  /* 목록은 항목마다 자기 타임라인을 가져서 자연스럽게 어긋난다. */
  [data-reveal-stagger] > * {
    opacity: 1;
    translate: none;
    transition: none;
    animation: reveal-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 18%;
  }
}

/* ── 제목 그라데이션 ──────────────────────────────────────────── */

.hero-title-text {
  background-image: linear-gradient(
    var(--grad-angle),
    var(--violet) 8%,
    var(--blue) 50%,
    var(--violet) 92%
  );
  background-size: 200% 100%;
  /* background 단축 속성을 쓰면 위에서 선언한 background-clip 이 초기값으로
     돌아가 글자 대신 상자가 칠해진다. 이미지만 바꾼다. */
  -webkit-background-clip: text;
  background-clip: text;
  animation: title-drift 16s linear infinite;
}

@keyframes title-drift {
  0% { --grad-angle: 96deg; background-position: 0% 50%; }
  50% { --grad-angle: 128deg; background-position: 100% 50%; }
  100% { --grad-angle: 96deg; background-position: 0% 50%; }
}

/* ── 포인터 반응 ──────────────────────────────────────────────── */

.metric,
.advisory-card,
.credential-card,
.record-card,
.profile-card {
  position: relative;
  isolation: isolate;
}

.metric::after,
.advisory-card::after,
.credential-card::after,
.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: var(--glow, 0);
  pointer-events: none;
  background: radial-gradient(
    16rem circle at var(--pointer-x, 50%) var(--pointer-y, 50%),
    var(--violet-soft),
    transparent 62%
  );
  transition: opacity 320ms var(--ease-out-quint);
}

.metric:hover,
.advisory-card:hover,
.credential-card:hover,
.profile-card:hover { --glow: 1; }

/* 히어로 버튼은 포인터 쪽으로 살짝 끌린다. */
.button--primary {
  translate: var(--magnet-x, 0) var(--magnet-y, 0);
  transition:
    translate 420ms var(--spring),
    box-shadow 260ms var(--ease-out-quint),
    scale 260ms var(--spring);
}

.button--primary:hover { scale: 1.03; }
.button--primary:active { scale: 0.98; }

/* ── 카드가 올라오는 감각 ─────────────────────────────────────── */

.metric,
.advisory-card,
.credential-card,
.record-card {
  transition:
    translate 420ms var(--spring),
    border-color 260ms var(--ease-out-quint),
    box-shadow 320ms var(--ease-out-quint);
}

.metric:hover,
.advisory-card:hover,
.credential-card:hover,
.achievement-card:hover { translate: 0 -3px; }

/* ── 요약 그룹 ────────────────────────────────────────────────── */

.metric-group + .metric-group { margin-top: 2.2rem; }

.metric-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.metric-group-title {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.metric-group-note {
  color: var(--text-dim);
  font-size: 0.81rem;
}

.metric-group-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.metric-group-link span {
  transition: translate 320ms var(--spring);
}

.metric-group-link:hover { text-decoration: none; }
.metric-group-link:hover span { translate: 3px 0; }

/* ── 구역 사이 호흡 ───────────────────────────────────────────── */

.section-heading {
  position: relative;
  padding-bottom: 0.9rem;
}

.section-heading::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--line-strong),
    var(--line) 30%,
    transparent 72%
  );
}

/* ── 움직임 차단은 여기서도 끝까지 ────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  .hero-title-text,
  .button--primary { animation: none; transition: none; }

  [data-reveal],
  [data-reveal-stagger] > * {
    animation: none;
    opacity: 1;
    translate: none;
  }
}

:root[data-motion="reduce"] .hero-title-text { animation: none; }

:root[data-motion="reduce"] [data-reveal],
:root[data-motion="reduce"] [data-reveal-stagger] > * {
  animation: none;
  opacity: 1;
  translate: none;
}

@media print {
  .metric-group-link { display: none !important; }
  .hero-title-text { animation: none !important; }
}
