@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;600;700;800&display=swap');

/* ===== Design Tokens ===== */
:root {
  /* Color — Primary */
  --color-primary: #6d9dfc;
  --color-primary-light: #9dbdff;
  --color-primary-dark: #4a7de0;
  /* Color — Secondary */
  --color-secondary: #8f7bff;
  --color-secondary-light: #b0a0ff;
  --color-secondary-dark: #6e5cd4;
  /* Color — Accent */
  --color-accent: #3dd6ff;
  /* Color — Surfaces */
  --color-bg: #0b1021;
  --color-surface: #11172c;
  --color-card: #161d33;
  /* Color — Text */
  --color-text: #e8ecf5;
  --color-muted: #9aa6c4;
  /* Color — Semantic */
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-error: #f87171;

  /* Typography */
  --font-family: 'Noto Sans KR', sans-serif;
  --fs-h1: 28px;  --fw-h1: 800; --lh-h1: 1.3;
  --fs-h2: 22px;  --fw-h2: 700; --lh-h2: 1.35;
  --fs-h3: 18px;  --fw-h3: 700; --lh-h3: 1.4;
  --fs-body: 15px; --fw-body: 400; --lh-body: 1.6;
  --fs-small: 13px;
  --ls-heading: -0.02em;

  /* Spacing (8px grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.35);
  --shadow-btn: 0 6px 18px rgba(0,0,0,0.18);

  /* Layout */
  --content-max-width: 1040px;
  --content-gutter: 18px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  background: radial-gradient(circle at 20% 20%, #142042 0%, var(--color-bg) 45%, #080a16 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 {
  letter-spacing: var(--ls-heading);
  margin: 0;
}
h1 { font-size: var(--fs-h1); font-weight: var(--fw-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-h2); line-height: var(--lh-h2); margin-bottom: var(--space-md); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-h3); line-height: var(--lh-h3); }

.text-muted { color: var(--color-muted); }
.text-small { font-size: var(--fs-small); }

/* ===== Layout ===== */
.wrap {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--content-gutter) var(--space-2xl);
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 1001;
}
.skip-link:focus-visible {
  left: 12px;
  box-shadow: 0 0 0 3px rgba(61,214,255,0.6);
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-md) 0;
  background: rgba(12, 17, 36, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.nav-pill:hover,
.nav-pill:focus-visible {
  background: rgba(109,157,252,0.14);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.nav-pill:active {
  transform: translateY(0);
  box-shadow: none;
}
.nav-pill.primary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  color: var(--color-bg);
  border: 1px solid rgba(255,255,255,0.2);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-md);
  min-height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  box-shadow: var(--shadow-btn);
}
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.btn:disabled,
.btn.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-bg);
}
.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: var(--color-bg);
}
.btn-muted {
  background: #2a314a;
  color: var(--color-text);
}
.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  box-shadow: none;
  padding: var(--space-sm) var(--space-md);
  min-height: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-ghost:hover {
  color: var(--color-text);
  box-shadow: none;
}
.btn-compact {
  padding: 10px var(--space-md);
  min-height: 38px;
  font-size: var(--fs-small);
}

/* ===== Sections ===== */
.section {
  background: linear-gradient(135deg, rgba(109,157,252,0.08), rgba(143,123,255,0.08));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-sm);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.section:first-of-type { margin-top: 0; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent));
  color: var(--color-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: var(--space-sm); }
.hero p { margin: 0 0 var(--space-md); font-weight: 600; }

/* ===== Cards ===== */
.card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ===== Quick-Link Cards (IA navigation) ===== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.quick-link:hover,
.quick-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(145deg, rgba(109,157,252,0.15), rgba(143,123,255,0.1));
}
.quick-link:active {
  transform: translateY(0);
}
.quick-link .ql-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(109,157,252,0.2), rgba(143,123,255,0.2));
  flex-shrink: 0;
}
.quick-link .ql-icon svg {
  width: 24px;
  height: 24px;
}
.quick-link .ql-title {
  font-weight: 700;
  font-size: var(--fs-body);
}
.quick-link .ql-desc {
  font-size: var(--fs-small);
  color: var(--color-muted);
  line-height: 1.4;
}

/* ===== Badges / Tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.08);
}
.badge-new { background: #ffe0f2; color: #5d235f; }
.badge-important { background: #f5d5ff; color: #4a1f65; }

.tag {
  display: inline-block;
  background: #1f2a4d;
  color: #c5d7ff;
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-pill);
  margin: 2px;
  font-size: var(--fs-small);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ===== Notice ===== */
.notice {
  background: linear-gradient(135deg, #ffd8ef, #f3c8ff);
  border: 1px solid rgba(120, 66, 145, 0.35);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow);
  color: #3a153d;
}
.notice h3 { margin: 0 0 var(--space-sm); color: #4d1a56; }
.notice p { margin: 0 0 var(--space-md); color: #5a2a63; }
.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.notice-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}
.notice-item {
  background: rgba(255,255,255,0.26);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(94, 42, 116, 0.2);
  color: #4a2352;
}
.notice-item strong { color: #4d1a56; }
.notice-item .meta {
  color: #713984;
  font-size: var(--fs-small);
  display: inline-flex;
  gap: var(--space-sm);
  align-items: center;
}

/* ===== Tech Stack ===== */
.tech-stack-section {
  background: linear-gradient(135deg, rgba(70, 235, 198, 0.2), rgba(58, 168, 255, 0.2));
  border: 1px solid rgba(61, 214, 255, 0.35);
}
.tech-stack-section h2 { color: #baf8ea; }
.tech-stack-section .card {
  background: linear-gradient(145deg, rgba(20, 40, 62, 0.75), rgba(14, 29, 46, 0.85));
  border: 1px solid rgba(61, 214, 255, 0.22);
}

/* ===== Reveal Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: rgba(12,17,36,0.92);
  color: var(--color-text);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(10px);
  z-index: 1002;
  font-size: var(--fs-small);
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===== Modal (shared) ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
}
.modal {
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 1;
  transition: background 0.15s ease;
}
.modal-close:hover { background: rgba(255,255,255,0.12); }
.modal-close svg { width: 18px; height: 18px; }

/* ===== Inline Icon Utility ===== */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  :root { --content-gutter: 14px; }
  .wrap { padding: var(--space-xl) var(--content-gutter) var(--space-2xl); }
  .section { padding: var(--space-md); }
  .btn { width: 100%; text-align: center; }
  .hero { padding: var(--space-lg); }
  .quick-links { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { gap: var(--space-sm); }
  .nav-center { gap: 6px; }
}

@media (max-width: 400px) {
  .quick-links { grid-template-columns: 1fr; }
}
