/* AWS 네트워킹 서비스 소개 사이트 — 디자인 토큰과 공통 컴포넌트 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #0f1720;
  --ink-2: #44505e;
  --ink-3: #6b7684;
  --line: #dde2e8;
  --accent: #0b7f74;
  --accent-ink: #ffffff;
  --accent-soft: #e2f4f1;
  --hero-bg: #0d1b26;
  --hero-ink: #e8eef3;
  --hero-ink-2: #a9b7c3;
  --hero-line: #22384a;
  --shadow: 0 1px 2px rgb(15 23 32 / 6%), 0 4px 16px rgb(15 23 32 / 5%);

  --cat-foundation: #2f6fdb;
  --cat-application: #7a4fd6;
  --cat-edge: #d0662b;
  --cat-hybrid: #0b7f74;
  --cat-security: #c23a52;
  --cat-observability: #8a7a12;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1117;
    --surface: #121a22;
    --surface-2: #18222c;
    --ink: #e6ebf0;
    --ink-2: #aeb9c4;
    --ink-3: #8592a0;
    --line: #253240;
    --accent: #3cc7b6;
    --accent-ink: #062320;
    --accent-soft: #10302d;
    --hero-bg: #070c11;
    --hero-line: #1c2a37;
    --shadow: none;
    --cat-foundation: #6c9cf0;
    --cat-application: #a789ec;
    --cat-edge: #ec9563;
    --cat-hybrid: #3cc7b6;
    --cat-security: #ec7488;
    --cat-observability: #d1bf4a;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1117;
  --surface: #121a22;
  --surface-2: #18222c;
  --ink: #e6ebf0;
  --ink-2: #aeb9c4;
  --ink-3: #8592a0;
  --line: #253240;
  --accent: #3cc7b6;
  --accent-ink: #062320;
  --accent-soft: #10302d;
  --hero-bg: #070c11;
  --hero-line: #1c2a37;
  --shadow: none;
  --cat-foundation: #6c9cf0;
  --cat-application: #a789ec;
  --cat-edge: #ec9563;
  --cat-hybrid: #3cc7b6;
  --cat-security: #ec7488;
  --cat-observability: #d1bf4a;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.82rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 상단 바 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--hero-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hero-line);
  color: var(--hero-ink);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-logo { display: block; width: 40px; height: auto; margin-top: 3px; }
.brand-sep { width: 1px; height: 20px; background: var(--hero-line); background: rgb(255 255 255 / 22%); }
@media (max-width: 420px) { .brand span:last-child { font-size: 0.92rem; } }
.topnav { display: flex; gap: 4px; margin-left: auto; font-size: 0.92rem; }
.topnav a, .topnav .soon { padding: 6px 10px; border-radius: 8px; color: var(--hero-ink-2); text-decoration: none; }
.topnav a:hover { color: var(--hero-ink); background: var(--hero-line); }
.topnav .soon { opacity: 0.5; cursor: default; }
@media (max-width: 520px) { .topnav .soon { display: none; } }
@media (max-width: 600px) { .topnav a { display: none; } .topbar-inner { gap: 8px; } }
.brand { white-space: nowrap; min-width: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 9px;
  border: 1px solid var(--hero-line); border-radius: 10px; background: transparent; color: var(--hero-ink-2);
  font: inherit; font-size: 0.86rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--hero-ink); background: var(--hero-line); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }
.present-btn { color: #3cc7b6; border-color: color-mix(in srgb, #3cc7b6 45%, transparent); }
.present-btn:hover { color: #062320; background: #3cc7b6; border-color: #3cc7b6; }
@media (max-width: 520px) { .present-btn span { display: none; } }
.topnav + .icon-btn, .topnav + .present-btn { margin-left: 4px; }

/* 히어로 */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0 64px; }
@media (min-width: 720px) { .hero { padding: 88px 0 96px; } }
.eyebrow { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; color: #3cc7b6; margin-bottom: 16px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.5rem); font-weight: 800; }
.hero .lede { max-width: 46em; margin-top: 20px; font-size: 1.05rem; color: var(--hero-ink-2); }
.hero .lede a { color: #3cc7b6; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 36px 0 0; }
.hero-meta div { border-left: 2px solid #3cc7b6; padding-left: 12px; }
.hero-meta dt { font-size: 0.78rem; color: var(--hero-ink-2); }
.hero-meta dd { margin: 2px 0 0; font-family: var(--mono); font-size: 1.15rem; font-weight: 600; }

/* 서비스 지도 */
.map { margin-top: -32px; }
.map-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.map-cell {
  --c: var(--accent);
  display: flex; flex-direction: column; gap: 4px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--c);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform 0.15s ease;
}
.map-cell:hover { transform: translateY(-2px); }
.map-label { font-family: var(--mono); font-size: 0.72rem; color: var(--c); }
.map-title { font-weight: 700; }
.map-icons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.map-icons img { width: 24px; height: 24px; border-radius: 5px; }
.map-items { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 6px; font-size: 0.78rem; color: var(--ink-3); }
@media (max-width: 600px) { .map-grid { grid-template-columns: 1fr 1fr; } .map-items { display: none; } }

[data-cat="foundation"] { --c: var(--cat-foundation); }
[data-cat="application"] { --c: var(--cat-application); }
[data-cat="edge"] { --c: var(--cat-edge); }
[data-cat="hybrid"] { --c: var(--cat-hybrid); }
[data-cat="security"] { --c: var(--cat-security); }
[data-cat="observability"] { --c: var(--cat-observability); }

/* 검색 */
.services { padding: 48px 0 80px; }
.filter { position: sticky; top: 56px; z-index: 5; padding: 12px 0; background: var(--bg); }
.filter input {
  width: 100%; padding: 12px 16px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-hint { min-height: 1.2em; margin-top: 6px; font-size: 0.82rem; color: var(--ink-3); }

/* 카테고리 그룹과 카드 */
.group { margin-top: 40px; }
.group-head { margin-bottom: 18px; padding-left: 14px; border-left: 3px solid var(--c); }
.group-label { font-family: var(--mono); font-size: 0.75rem; color: var(--c); }
.group-head h2 { font-size: 1.5rem; margin-top: 2px; }
.group-head p:last-child { color: var(--ink-2); margin-top: 4px; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:has(a):hover { border-color: var(--c); transform: translateY(-2px); }
.card h3 { font-size: 1.08rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-top .svc-icon { width: 40px; height: 40px; }
.card.is-draft .svc-icon { opacity: 0.55; filter: grayscale(0.4); }
.card-role {
  align-self: flex-start; padding: 2px 8px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
}
.card-summary { color: var(--ink-2); font-size: 0.93rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.chips li { padding: 1px 8px; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; }
.card-go { margin-top: auto; padding-top: 6px; font-size: 0.85rem; font-weight: 600; color: var(--c); }
.card.is-draft { background: transparent; border-style: dashed; box-shadow: none; }
.card.is-draft h3, .card.is-draft .card-summary { color: var(--ink-3); }

.empty { margin-top: 32px; text-align: center; color: var(--ink-3); }

/* 서비스 상세: 히어로 */
.hero-service { padding: 40px 0 56px; }
@media (min-width: 720px) { .hero-service { padding: 56px 0 72px; } }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; font-size: 0.85rem; color: var(--hero-ink-2); }
.crumbs a { color: var(--hero-ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--hero-ink); }
.hero-service h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); max-width: 22em; }
.stats { display: grid; gap: 1px; margin: 40px 0 0; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--hero-line); border: 1px solid var(--hero-line); border-radius: var(--radius); overflow: hidden; }
.stats div { padding: 18px 20px; background: var(--hero-bg); }
.stats dd { margin: 0; font-family: var(--mono); font-size: 1.45rem; font-weight: 600; color: #fff; }
.stats dt { margin-top: 4px; font-size: 0.84rem; color: var(--hero-ink-2); }
.stats div { display: flex; flex-direction: column-reverse; }

.hero-id { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.hero-id .eyebrow { margin: 0; }
.svc-icon { flex: none; border-radius: 8px; }
.hero-id .svc-icon { width: 56px; height: 56px; border-radius: 10px; box-shadow: 0 0 0 1px rgb(255 255 255 / 8%); }

/* 섹션 목차 */
.toc { position: sticky; top: 56px; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.toc-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.toc-inner::-webkit-scrollbar { display: none; }
.toc a { flex: none; padding: 12px 10px; font-size: 0.88rem; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.toc a:hover, .toc a.is-active { color: var(--ink); border-bottom-color: var(--c, var(--accent)); }
html { scroll-padding-top: 112px; }

/* 서비스 상세: 본문 블록 */
.doc { padding-bottom: 72px; }
.block { padding: 56px 0 8px; }
.block + .block { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 48px; }
.kicker { font-family: var(--mono); font-size: 0.76rem; color: var(--c); margin-bottom: 6px; }
.block h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.block-lede { max-width: 48em; margin-top: 12px; color: var(--ink-2); }
.block h3 { font-size: 1.05rem; }
code { padding: 1px 6px; font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border-radius: 5px; }
.hero code { background: var(--hero-line); color: var(--hero-ink); }

.tiles { display: grid; gap: 14px; margin-top: 28px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile-tag { font-family: var(--mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c); margin-bottom: 8px; }
.tile p:last-child { margin-top: 8px; color: var(--ink-2); font-size: 0.95rem; }
.tile { display: flex; flex-direction: column; }
.tile > p:not(.tile-tag) { margin-top: 8px; color: var(--ink-2); font-size: 0.95rem; }
.tile .src { margin-top: auto; padding-top: 12px; }
.tile h3 a { color: var(--ink); }
.tile-challenge { border-top: 3px solid var(--ink-3); }
.tile-customer { border-top: 3px solid var(--c); }
.tile-customer .tile-tag { margin: 6px 0 0; }

.steps { display: grid; gap: 0; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 26px 40px; }
.steps li::before { content: ""; position: absolute; left: 11px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.steps li::after { content: ""; position: absolute; left: 15px; top: 24px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps.numbered li { counter-increment: step; }
.steps.numbered li::before { content: counter(step); left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--accent-ink); }
.steps.numbered li::after { top: 34px; }
.steps p { margin-top: 4px; color: var(--ink-2); max-width: 46em; }

.features { display: grid; gap: 14px; margin-top: 28px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.feature { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--radius); }
.feature p { color: var(--ink-2); font-size: 0.94rem; }
.since { margin-left: 4px; padding: 1px 7px; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 999px; vertical-align: 2px; }
.src { margin-top: auto; font-size: 0.8rem; color: var(--ink-3); }
.src:hover { color: var(--accent); }

.table-scroll { margin-top: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.82rem; color: var(--ink-3); background: var(--surface-2); }
tbody th { font-weight: 600; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
td { color: var(--ink-2); }

.arch { margin-top: 28px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.arch p { margin-top: 10px; color: var(--ink-2); max-width: 52em; }
.arch .src { display: inline-block; margin-top: 12px; }
.diagram { margin: 18px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.diagram img { display: block; max-width: 100%; height: auto; margin: 0 auto; padding: 12px; }
.diagram figcaption { padding: 10px 14px; border-top: 1px solid #e3e7ec; font-size: 0.85rem; color: #44505e; background: #fff; }
.diagram figcaption a { color: #0b7f74; }

.dims { display: grid; gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dims div { display: grid; gap: 4px 24px; padding: 14px 18px; background: var(--surface); }
@media (min-width: 720px) { .dims div { grid-template-columns: 220px 1fr; } }
.dims dt { font-weight: 600; }
.dims dd { margin: 0; color: var(--ink-2); }
.btn { display: inline-block; padding: 10px 16px; font-weight: 600; font-size: 0.92rem; color: var(--accent-ink); background: var(--accent); border-radius: 10px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }

.timeline { margin: 24px 0 0; padding: 0; list-style: none; }
.timeline li { display: grid; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .timeline li { grid-template-columns: 120px 1fr; } }
.timeline time { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); }
.timeline p { margin-top: 4px; color: var(--ink-2); font-size: 0.93rem; }

.sources { margin: 20px 0 0; padding-left: 1.2em; color: var(--ink-2); font-size: 0.93rem; }
.sources li { margin: 4px 0; }

.siblings { margin-top: 64px; padding: 24px; background: var(--surface-2); border-radius: var(--radius); }
.sibling-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sibling-list img { border-radius: 4px; }
.sibling-list a, .sibling-list span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 0.9rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.sibling-list a { color: var(--ink); }
.sibling-list a:hover { border-color: var(--c); }
.sibling-list span { color: var(--ink-3); border-style: dashed; background: transparent; }

/* 푸터 */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: 0.86rem; }
.footer-inner { display: grid; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map-cell, .card { transition: none; }
}
