:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f3f8fb;
  --surface-night: #08111f;
  --text: #1c2430;
  --muted: #667085;
  --line: #d9e0ea;
  --line-strong: #cddfe8;
  --accent: #2457c5;
  --accent-strong: #1748a6;
  --accent-soft: #e8f0ff;
  --sky: #38bdf8;
  --sky-soft: #e0f2fe;
  --mint: #0d9488;
  --mint-soft: #ccfbf1;
  --amber: #8a6500;
  --amber-soft: #fff7dd;
  --violet: #d9343f;
  --violet-soft: #fff0f1;
  --danger: #d9343f;
  --shadow-sm: 0 12px 28px rgba(28, 36, 48, 0.08);
  --shadow-lg: 0 14px 34px rgba(8, 17, 31, 0.12);
  --radius-sm: 8px;
  --radius: 8px;
  --radius-lg: 16px;
  --canvas: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
button, input { font: inherit; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }

.section-note {
  margin: -10px 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--muted);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-night);
  color: #fff;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(217, 224, 234, 0.92);
  background: rgba(246, 248, 251, 0.94);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(calc(100% - 40px), var(--canvas));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 14px; letter-spacing: 0.04em; }
.brand-copy small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.14em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { background: var(--surface); color: var(--accent-strong); }
.header-action,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.header-action,
.button-primary { background: var(--surface-night); color: #fff; }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.button-quiet { border-color: var(--line); background: transparent; color: var(--accent-strong); }
.header-action:hover,
.button:hover { transform: translateY(-1px); }
.button-primary:hover { background: #1d2939; }
.button-secondary:hover,
.button-quiet:hover { border-color: var(--accent); background: var(--accent-soft); }
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  width: 18px;
  height: 2px;
  display: block;
  margin: 4px auto;
  background: currentColor;
  transition: transform 150ms ease, opacity 150ms ease;
}
.menu-toggle[aria-expanded="true"] span { opacity: 0; }
.menu-toggle[aria-expanded="true"]::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"]::after { transform: translateY(-6px) rotate(-45deg); }

main { overflow: hidden; }
.section,
.page-hero {
  width: min(calc(100% - 40px), var(--canvas));
  margin: 0 auto;
}
.hero {
  position: relative;
  padding: 76px 0 56px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 52%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 87, 197, 0.16), rgba(36, 87, 197, 0) 68%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
  gap: 64px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font: 850 11px/1.2 "Cascadia Code", monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.hero h1,
.page-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.hero-lead,
.page-lead {
  max-width: 660px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.hero-note strong { color: var(--text); }

.ecosystem-visual {
  position: relative;
  min-height: 430px;
  padding: 30px;
  border: 1px solid rgba(205, 223, 232, 0.7);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #101828, #08111f 78%);
  box-shadow: var(--shadow-lg);
  color: #fff;
  overflow: hidden;
}
.ecosystem-visual::before {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(163, 230, 53, 0.16);
  filter: blur(8px);
}
.visual-label { color: #8fb2c0; font: 800 10px/1.2 "Cascadia Code", monospace; letter-spacing: 0.12em; }
.visual-title { margin: 8px 0 24px; font-size: 22px; letter-spacing: -0.03em; }
.visual-map { position: relative; display: grid; gap: 14px; }
.map-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.map-node {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(173, 217, 229, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}
.map-node strong { font-size: 13px; }
.map-node small { color: #9bb2bd; font-size: 10px; }
.map-node.is-primary { border-color: rgba(45, 212, 191, 0.58); background: rgba(13, 148, 136, 0.22); }
.map-node.is-portal { border-color: rgba(56, 189, 248, 0.62); background: rgba(56, 189, 248, 0.16); }
.map-connector { height: 22px; display: grid; place-items: center; color: #77a5b8; font: 800 16px/1 monospace; }
.visual-boundary { position: relative; margin-top: 19px; padding-top: 17px; border-top: 1px solid rgba(173, 217, 229, 0.15); color: #8fa7b2; font-size: 11px; }

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-soft { width: 100%; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-soft > .section { padding-top: 68px; padding-bottom: 68px; border: 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}
.section-head h2 { max-width: 720px; margin: 0; font-size: clamp(29px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.045em; }
.section-head p { max-width: 480px; margin: 0; color: var(--muted); font-size: 14px; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent-strong); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-card,
.resource-card,
.intent-card {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.quick-card:hover,
.resource-card:hover,
.intent-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.card-mark,
.worker-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 850 12px/1 "Cascadia Code", monospace;
}
.card-mark.is-mint { background: var(--mint-soft); color: var(--mint); }
.card-mark.is-sky { background: var(--sky-soft); color: var(--sky); }
.card-mark.is-violet { background: var(--violet-soft); color: var(--violet); }
.quick-card h3,
.resource-card h3,
.intent-card h3 { margin: 22px 0 7px; font-size: 18px; letter-spacing: -0.025em; }
.quick-card p,
.resource-card p,
.intent-card p { margin: 0; color: var(--muted); font-size: 13px; }
.card-arrow { position: absolute; top: 22px; right: 22px; color: var(--accent); font-size: 20px; }

.worker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.worker-card {
  min-width: 0;
  display: grid;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.worker-card[hidden] { display: none; }
.worker-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.worker-card h2,
.worker-card h3 { margin: 17px 0 5px; font-size: 19px; letter-spacing: -0.025em; }
.worker-card p { margin: 0; color: var(--muted); font-size: 13px; }
.worker-card-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.badge {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.public { border-color: #b9dfd4; background: var(--mint-soft); color: var(--mint); }
.badge.login { border-color: #e6d09d; background: var(--amber-soft); color: var(--amber); }
.badge.controlled { border-color: #cbd0ea; background: var(--violet-soft); color: var(--violet); }
.worker-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.worker-card-actions .button { flex: 1 1 120px; }
.worker-note { margin-top: 11px; color: var(--muted); font-size: 10px; }

.directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.search-field {
  flex: 1;
  max-width: 560px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 87, 197, 0.13); }
.search-field span { color: var(--accent); font-size: 17px; }
.search-field input { width: 100%; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.filter:hover,
.filter.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.directory-result { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state strong { display: block; }
.empty-state p { margin: 5px 0 0; color: var(--muted); }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 16px; }
.feature-panel,
.boundary-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature-panel.is-night { background: var(--surface-night); color: #fff; border-color: var(--surface-night); }
.feature-panel h3,
.boundary-panel h3 { margin: 0; font-size: 23px; letter-spacing: -0.035em; }
.feature-panel > p,
.boundary-panel > p { margin: 10px 0 0; color: var(--muted); }
.feature-panel.is-night > p { color: #a8bbc5; }
.link-list { display: grid; gap: 8px; margin-top: 24px; }
.link-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
}
.link-row:hover { border-color: var(--accent); }
.link-row div { display: grid; }
.link-row strong { font-size: 13px; }
.link-row small { color: var(--muted); font-size: 11px; }
.link-row > span { color: var(--accent); }
.feature-panel.is-night .link-row { border-color: rgba(213, 221, 229, 0.17); background: rgba(255, 255, 255, 0.055); }
.feature-panel.is-night .link-row small { color: #9db0ba; }
.feature-panel.is-night .link-row > span { color: #8ed2e5; }

.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.flow-step { position: relative; min-height: 170px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.flow-step::after { content: "→"; position: absolute; top: 50%; right: -18px; z-index: 2; color: var(--line-strong); font-size: 24px; }
.flow-step:last-child::after { display: none; }
.flow-step > span { color: var(--accent); font: 850 11px/1 "Cascadia Code", monospace; }
.flow-step h3 { margin: 22px 0 7px; font-size: 17px; }
.flow-step p { margin: 0; color: var(--muted); font-size: 12px; }

.responsibility-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.responsibility-table th,
.responsibility-table td { padding: 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.responsibility-table th { background: var(--surface-night); color: #d8e6ec; font-size: 11px; letter-spacing: 0.04em; }
.responsibility-table td { font-size: 13px; }
.responsibility-table td:last-child { color: var(--muted); }
.responsibility-table tr:last-child td { border-bottom: 0; }

.intent-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.intent-card { min-height: 170px; }
.intent-card small { color: var(--accent); font: 800 10px/1.2 "Cascadia Code", monospace; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e6d09d;
  border-radius: var(--radius);
  background: var(--amber-soft);
}
.notice-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--amber); font-weight: 900; }
.notice strong { display: block; font-size: 13px; }
.notice p { margin: 3px 0 0; color: #6e5a3d; font-size: 12px; }

.page-hero { padding: 74px 0 46px; }
.page-hero h1 { font-size: clamp(40px, 6vw, 64px); }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.page-meta span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 800; }

.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.status-card { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-card small { color: var(--accent); font: 800 10px/1.2 "Cascadia Code", monospace; }
.status-card strong { display: block; margin-top: 22px; font-size: 18px; }
.status-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.manifest-code { display: block; margin-top: 12px; overflow-wrap: anywhere; color: var(--accent-strong); font-size: 11px; }

.site-footer { margin-top: 50px; background: var(--surface-night); color: #d6e3e9; }
.footer-inner { width: min(calc(100% - 40px), var(--canvas)); margin: 0 auto; padding: 42px 0 30px; }
.footer-main { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: start; }
.footer-brand { display: grid; gap: 9px; }
.footer-brand strong { font-size: 16px; }
.footer-brand p { max-width: 520px; margin: 0; color: #8fa6b1; font-size: 12px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 7px 16px; }
.footer-nav a { min-height: 44px; display: inline-flex; align-items: center; color: #b9cbd3; font-size: 12px; text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(213, 221, 229, 0.13); color: #758f9a; font-size: 10px; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface-night); color: #fff; }
.error-shell { width: min(680px, 100%); padding: 42px; border: 1px solid rgba(213, 221, 229, 0.18); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.055); }
.error-shell h1 { margin: 12px 0; font-size: clamp(36px, 8vw, 64px); letter-spacing: -0.05em; }
.error-shell p { color: #9db2bc; }
.error-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }

button:focus-visible,
a:focus-visible,
input:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 780px; }
  .ecosystem-visual { min-height: 0; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .worker-grid { grid-template-columns: repeat(2, 1fr); }
  .intent-grid { grid-template-columns: repeat(3, 1fr); }
  .flow-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(2)::after { display: none; }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .header-inner { min-height: 64px; }
  .menu-toggle { display: block; }
  .header-action { display: none; }
  .site-nav {
    position: fixed;
    inset: 65px 12px auto;
    display: none;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open { display: grid; }
  .site-nav a { padding: 0 14px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .directory-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .responsibility-table thead { display: none; }
  .responsibility-table,
  .responsibility-table tbody,
  .responsibility-table tr,
  .responsibility-table td { display: block; }
  .responsibility-table tr { padding: 14px; border-bottom: 1px solid var(--line); }
  .responsibility-table td { padding: 5px 0; border: 0; }
  .responsibility-table td::before { content: attr(data-label); display: block; color: var(--accent); font-size: 10px; font-weight: 850; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .header-inner,
  .section,
  .page-hero,
  .footer-inner { width: min(calc(100% - 28px), var(--canvas)); }
  .brand-copy small { display: none; }
  .hero { padding: 52px 0 38px; }
  .hero h1 { font-size: 40px; }
  .page-hero h1 { font-size: 32px; }
  .hero-grid { gap: 40px; }
  .ecosystem-visual { padding: 22px; }
  .map-row { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .section-soft > .section { padding-top: 52px; padding-bottom: 52px; }
  .quick-grid,
  .worker-grid,
  .intent-grid,
  .flow-grid,
  .status-grid { grid-template-columns: 1fr; }
  .flow-step::after { display: none; }
  .quick-card,
  .resource-card,
  .intent-card,
  .worker-card { padding: 18px; }
  .worker-card-actions .button { flex-basis: 100%; }
  .filters { margin-right: -14px; padding-right: 14px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .error-shell { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
