/* ============================================================
   Youhyun Kim — personal site
   Design system: dark navy base, electric blue/cyan accents,
   blueprint-grid texture. Built for a backend/systems engineer.
   ============================================================ */

:root {
  --bg: #060b17;
  --bg-soft: #0a1226;
  --surface: #0e1a33;
  --surface-2: #122346;
  --border: rgba(148, 178, 224, 0.14);
  --border-strong: rgba(148, 178, 224, 0.30);
  --text: #eef3fb;
  --text-muted: #9fb0cc;
  --text-faint: #64769a;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --cyan: #2dd4e8;
  --amber: #f5b942;
  --red: #f2596b;
  --green: #34e39a;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --gradient-text: linear-gradient(135deg, #7fb3ff 0%, #4fe3e0 100%);
  --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.20);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(148, 178, 224, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 178, 224, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 420px at 12% -6%, rgba(59, 130, 246, 0.24), transparent 60%),
    radial-gradient(560px 460px at 108% 12%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(700px 520px at 50% 120%, rgba(59, 130, 246, 0.10), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0; }
p { line-height: 1.7; color: var(--text-muted); margin: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--cyan);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--gradient);
  color: #04101f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(59,130,246,0.55); }
.btn-ghost {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #04101f;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px -6px rgba(59,130,246,0.6);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--cyan); background: rgba(45, 212, 232, 0.08); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.icon-link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.icon-link:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.icon-link svg { width: 18px; height: 18px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 70px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  margin: 18px 0 20px;
  letter-spacing: -0.01em;
}
.hero-lede {
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.hero-socials {
  display: flex;
  gap: 12px;
}

.stat-row {
  display: flex;
  gap: 34px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.stat-row .stat-num {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
}
.stat-row .stat-label {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ---------- Network / hero graphic ---------- */
.network-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.network-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(14,26,51,0.7), rgba(10,18,38,0.7));
  box-shadow: var(--shadow-glow);
  padding: 18px;
  overflow: hidden;
}
.network-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px 260px at 70% 20%, rgba(45,212,232,0.10), transparent 65%);
  pointer-events: none;
}
.network-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 2px 6px 12px;
  letter-spacing: 0.04em;
}
.network-caption .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--green);
  animation: blink 2.4s ease-in-out infinite;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--text-muted);
  letter-spacing: 0.02em;
}
.node-sub {
  font-family: var(--font-mono);
  font-size: 8px;
  fill: var(--text-faint);
}
.link-line {
  fill: none;
  stroke: rgba(148,178,224,0.28);
  stroke-width: 1.6;
}
.link-line.active {
  stroke: url(#lineGradient);
  stroke-width: 2;
}
.link-line.standby {
  stroke: rgba(148,178,224,0.22);
  stroke-dasharray: 4 5;
  animation: dash 3.5s linear infinite;
}
.node-circle {
  fill: var(--surface-2);
  stroke: var(--border-strong);
  stroke-width: 1.4;
}
.node-circle.primary {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(45,212,232,0.55));
}
.node-glow-a { animation: failoverA 8s ease-in-out infinite; }
.node-glow-b { animation: failoverB 8s ease-in-out infinite; }
.link-a { animation: failoverLinkA 8s ease-in-out infinite; }
.link-b { animation: failoverLinkB 8s ease-in-out infinite; }

.packet {
  fill: var(--cyan);
  filter: drop-shadow(0 0 6px rgba(45,212,232,0.9));
}

@keyframes dash { to { stroke-dashoffset: -40; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@keyframes failoverA {
  0%, 40% { stroke: var(--cyan); filter: drop-shadow(0 0 8px rgba(45,212,232,0.55)); }
  48%, 60% { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(242,89,107,0.6)); }
  68%, 100% { stroke: var(--cyan); filter: drop-shadow(0 0 8px rgba(45,212,232,0.55)); }
}
@keyframes failoverB {
  0%, 40% { stroke: var(--border-strong); filter: none; }
  48%, 60% { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(52,227,154,0.6)); }
  68%, 100% { stroke: var(--border-strong); filter: none; }
}
@keyframes failoverLinkA {
  0%, 40% { stroke: rgba(59,130,246,0.75); stroke-width: 2; }
  48%, 60% { stroke: rgba(242,89,107,0.35); stroke-width: 1.2; }
  68%, 100% { stroke: rgba(59,130,246,0.75); stroke-width: 2; }
}
@keyframes failoverLinkB {
  0%, 40% { stroke: rgba(148,178,224,0.22); stroke-width: 1.4; }
  48%, 60% { stroke: rgba(52,227,154,0.85); stroke-width: 2.2; }
  68%, 100% { stroke: rgba(148,178,224,0.22); stroke-width: 1.4; }
}

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: 14px; }
.section-head p { margin-top: 14px; font-size: 1.03rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---------- Cards / grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.12);
  color: var(--blue-bright);
  margin-bottom: 16px;
}
.card-icon svg { width: 21px; height: 21px; }
.card h3 { font-size: 1.08rem; margin-bottom: 9px; }
.card p { font-size: 0.94rem; }

/* ---------- Badges / skills ---------- */
.badge-group { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-cat { margin-bottom: 26px; }
.badge-cat h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  font-weight: 500;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.86rem;
  color: var(--text);
  font-family: var(--font-mono);
}
.badge .dot2 {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
}

/* ---------- Timeline (about) ---------- */
.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 34px;
  border-left: 1px solid var(--border);
}
.timeline-item { position: relative; padding-bottom: 38px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -39px;
  top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(45,212,232,0.12);
}
.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.timeline-item h3 { font-size: 1.1rem; margin-bottom: 8px; }
.timeline-item p { max-width: 62ch; }
.timeline-item a { color: var(--cyan); border-bottom: 1px solid rgba(45,212,232,0.35); }
.timeline-item a:hover { color: var(--blue-bright); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.contact-card:hover { transform: translateY(-4px); border-color: var(--cyan); }
.contact-card .card-icon { margin-bottom: 0; }
.contact-card h3 { font-size: 1.02rem; }
.contact-card span.value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  word-break: break-word;
}
.contact-card .go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--cyan);
  font-weight: 600;
}
.contact-card .go svg { width: 14px; height: 14px; }
.copy-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  box-shadow: 0 10px 30px -6px rgba(0,0,0,0.5);
}
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- CTA banner ---------- */
.cta-banner {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59,130,246,0.14), rgba(34,211,238,0.06));
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.cta-banner h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 8px; }
.cta-banner p { max-width: 50ch; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-inner p { font-size: 0.85rem; color: var(--text-faint); }
.footer-socials { display: flex; gap: 10px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Page header (about/contact) ---------- */
.page-hero { padding: 62px 0 20px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 16px 0 14px; }
.page-hero p { max-width: 58ch; font-size: 1.05rem; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .network-wrap { order: -1; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-right .icon-link.desktop-only { display: none; }
}

@media (max-width: 560px) {
  .container { padding: 0 20px; }
  section { padding: 60px 0; }
  .cta-banner { padding: 32px 24px; }
  .stat-row { gap: 24px; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 74px 0 0 0;
  z-index: 99;
  background: rgba(6,11,23,0.98);
  backdrop-filter: blur(10px);
  padding: 30px 28px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 16px 4px;
  font-size: 1.2rem;
  font-family: var(--font-head);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.mobile-menu a.active { color: var(--cyan); }
.mobile-menu .icon-row { display: flex; gap: 12px; margin-top: 26px; }
