/* System fonts keep the site self-contained and avoid third-party requests. */
:root {
  --paper: #f7f8f6;
  --surface: #ffffff;
  --ink: #18222c;
  --sub: #56616c;
  --weak: #8a939c;
  --line: #dde2e5;
  --line-strong: #c3cbd1;
  --cobalt: #2747c9;
  --cobalt-soft: #e8ecfb;
  --live: #11804a;
  --building: #9a5a00;
  --trial: #6a4fb8;
  --danger: #b3261e;
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a22; --surface: #18222c; --ink: #e8edf1; --sub: #a5b0ba; --weak: #7a8692;
    --line: #2a3640; --line-strong: #3b4955; --cobalt: #8ea2ff; --cobalt-soft: #222d52;
    --live: #4cc38a; --building: #e0a64a; --trial: #b4a0f5; --danger: #ff8a80; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--cobalt-soft); }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: 32px; }
.muted { color: var(--sub); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 16px; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; }
.brand-mark::after { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; right: -2px; top: -2px; background: var(--live); box-shadow: 0 0 0 2px var(--paper); }
.site-header nav { display: flex; gap: 26px; font-size: 15px; }
.site-header nav a { text-decoration: none; color: var(--sub); }
.site-header nav a:hover { color: var(--ink); }

/* Intro + ask */
.intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; padding-top: 56px; padding-bottom: 88px; align-items: start; }
.intro-role { color: var(--sub); font-size: 15px; margin-bottom: 14px; }
.intro h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.18; letter-spacing: -0.035em; font-weight: 750; margin-bottom: 22px; }
.intro-bio { color: var(--sub); max-width: 34em; margin-bottom: 30px; }
.intro-facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.intro-facts div { padding: 14px 28px 0 0; margin-right: 28px; }
.intro-facts div + div { padding-left: 0; }
.intro-facts dt { font-size: 13px; color: var(--weak); }
.intro-facts dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.link-plain { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; color: var(--cobalt); }

.ask { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; min-height: 460px; }
.ask-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ask-head h2 { font-size: 19px; letter-spacing: -0.02em; }
.ask-model { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--weak); }
.ask[data-state='ready'] .live-dot { background: var(--live); }
.ask[data-state='off'] .live-dot { background: var(--danger); }
.ask-log { list-style: none; margin: 0; padding: 18px 0; flex: 1; overflow-y: auto; max-height: 440px; display: flex; flex-direction: column; gap: 18px; }
.ask-empty p { color: var(--sub); font-size: 15px; margin-bottom: 18px; }
.ask-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ask-suggestions button { text-align: left; font-size: 14px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); }
.ask-suggestions button:hover { border-color: var(--cobalt); color: var(--cobalt); }
.ask-turn { display: grid; gap: 10px; }
.ask-q { justify-self: end; max-width: 85%; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 14px 14px 4px 14px; font-size: 15px; white-space: pre-wrap; }
.ask-a { max-width: 95%; font-size: 15px; white-space: pre-wrap; }
.ask-a.pending { color: var(--weak); }
.ask-a.pending::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.ask-a.error { color: var(--danger); }
.ask-form { border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 10px 10px 14px; background: var(--paper); }
.ask-form:focus-within { border-color: var(--cobalt); }
.ask-form textarea { width: 100%; border: 0; background: none; resize: none; outline: none; font-size: 15px; line-height: 1.55; }
.ask-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ask-count { margin-right: auto; font-size: 12px; color: var(--weak); font-variant-numeric: tabular-nums; }
.ask-note { margin-top: 12px; font-size: 13px; color: var(--weak); }
.button-primary { background: var(--cobalt); color: #fff; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .button-primary { color: #0d1430; } }
.button-primary:disabled { opacity: .5; cursor: progress; }
.button-quiet { font-size: 14px; color: var(--sub); padding: 9px 10px; border-radius: 8px; }
.button-quiet:hover { color: var(--ink); background: var(--line); }

/* Sections */
.section { padding-block: 72px; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 8px; }
.section-lede { color: var(--sub); max-width: 40em; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--line); flex-wrap: wrap; }
.segmented button { font-size: 14px; padding: 7px 14px; border-radius: 8px; color: var(--sub); }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(24, 34, 44, .12); }
.segmented span { color: var(--weak); font-variant-numeric: tabular-nums; margin-left: 2px; }

/* Project list: rows, not a card grid, so status and stack can be scanned down one column. */
.project-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.project-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px 40px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.project-name h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.3; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); margin-top: 8px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status[data-status='운영 중'] { color: var(--live); }
.status[data-status='개발 중'] { color: var(--building); }
.status[data-status='실험'] { color: var(--trial); }
.project-body p { max-width: 38em; }
.project-body .category { font-size: 13px; color: var(--weak); margin-bottom: 4px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.tags li { font-size: 13px; color: var(--sub); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; background: var(--surface); }
.project-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; white-space: nowrap; }
.project-actions button, .project-actions a { font-size: 14px; font-weight: 600; color: var(--cobalt); text-decoration: none; }
.project-actions button:hover, .project-actions a:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-actions .no-url { font-size: 13px; color: var(--weak); font-weight: 400; }

/* Infrastructure flow */
.infra { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: start; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; position: relative; }
.flow > li { position: relative; }
.flow > li + li::before { content: ''; position: absolute; left: 22px; top: -22px; height: 22px; border-left: 1.5px dashed var(--line-strong); }
.flow-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.flow-step { width: 100%; display: grid; text-align: left; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.flow-step b { font-size: 15px; font-weight: 650; }
.flow-step span { font-size: 13px; color: var(--sub); }
.flow-step:hover { border-color: var(--line-strong); }
.flow-step.selected { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.flow-llm { background: var(--cobalt-soft); border-color: transparent; }
.infra-detail { position: sticky; top: 24px; padding: 4px 0 0 24px; border-left: 2px solid var(--cobalt); }
.infra-detail h3 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 10px; }
.infra-detail p { color: var(--sub); }

/* Footer + dialog */
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding-block: 32px 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--weak); }
.site-footer a { color: var(--sub); }
dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 16, 22, .45); }
.dialog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-top p { font-size: 14px; color: var(--sub); }
.dialog-close { font-size: 14px; color: var(--sub); padding: 6px 10px; border-radius: 8px; }
.dialog-close:hover { background: var(--line); color: var(--ink); }
dialog h2 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 14px; }
#dialog-detail { white-space: pre-wrap; }
.dialog-links { display: flex; gap: 18px; margin-top: 20px; }
.dialog-links a { font-weight: 600; color: var(--cobalt); }
.dialog-ask { margin-top: 18px; padding-inline: 0; color: var(--cobalt); }
.dialog-ask:hover { background: none; text-decoration: underline; text-underline-offset: 4px; color: var(--cobalt); }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
  .ask { min-height: 0; }
  .infra { grid-template-columns: 1fr; }
  .infra-detail { position: static; }
  .flow-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-row { grid-template-columns: 1fr; }
  .project-actions { flex-direction: row; align-items: center; gap: 20px; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .site-header { flex-wrap: wrap; gap: 10px; }
  .site-header nav { gap: 18px; font-size: 14px; }
  .ask { padding: 18px; border-radius: 12px; }
  .section { padding-block: 52px; }
  .section-head h2 { font-size: 26px; }
  dialog { padding: 20px; }
}
