/* ---------- Layout shell ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 60%);
  opacity: 0.18;
}

main { position: relative; z-index: 1; }

.section {
  max-width: var(--container);
  padding: var(--space-9) var(--gutter) var(--space-7);
  margin: 0 auto;
}
.section-head { margin-bottom: var(--space-6); max-width: 720px; }
.section-title {
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  vertical-align: middle;
  transform: translateY(-3px);
}
.section-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
          backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07090f;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-name { font-size: 0.95rem; color: var(--text-muted); }
.topbar-nav {
  margin-left: auto;
  display: flex;
  gap: var(--space-5);
  align-items: center;
}
.topbar-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.topbar-nav a:hover { color: var(--text); }
.topbar-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover { background: var(--surface); color: var(--text); }
.theme-toggle [data-theme-icon-light] { display: none; }
.theme-toggle [data-theme-icon-dark] { display: inline; }
:root[data-theme="light"] .theme-toggle [data-theme-icon-light] { display: inline; }
:root[data-theme="light"] .theme-toggle [data-theme-icon-dark] { display: none; }

@media (max-width: 740px) {
  .topbar-nav { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) var(--gutter) clamp(40px, 8vw, 80px);
}
.hero-inner { max-width: 880px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  margin-bottom: var(--space-5);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.dot-pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  60%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: clamp(2.6rem, 1.6rem + 4.5vw, 5rem);
  letter-spacing: -0.035em;
  margin-bottom: var(--space-4);
}
.hero-title-ko { display: block; }
.hero-title-en {
  display: block;
  font-size: 0.42em;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

.hero-role {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.hero-tagline {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--text-muted);
  max-width: 64ch;
  margin-bottom: var(--space-6);
}
.hero-cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #07090f;
}
.btn-primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 90%, white); }
.btn-ghost {
  background: var(--bg-soft);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.btn-arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}
.btn:hover .btn-arrow { transform: translate(2px, -2px); }

/* ---------- Numbers section ---------- */

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4);
}
.num-card {
  position: relative;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.num-card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto auto;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.num-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.num-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}
.num-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.num-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Experience timeline ---------- */

.exp-list { display: flex; flex-direction: column; gap: var(--space-7); }
.exp-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(20px, 3vw, 36px);
}
.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--border);
}
.exp-company {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.exp-role {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}
.exp-period {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.exp-summary {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  max-width: 70ch;
}
.exp-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: var(--space-4);
}
.proj-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.proj-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.proj-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
}
.proj-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  align-self: flex-start;
}
.proj-name {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  flex: 1 1 100%;
  margin-top: 4px;
}
.proj-period {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.proj-repos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.proj-repos .repo-name { color: var(--text); }
.proj-repos .repo-commit { color: var(--accent); font-weight: 700; }
.proj-repos .repo-role { color: var(--text-faint); }
.proj-bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proj-bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}
.proj-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
}
.proj-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--space-2);
}
.tech-chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Continuity section ---------- */

.continuity-grid {
  display: grid;
  gap: var(--space-4);
}
.cont-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.cont-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cont-cell-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cont-cell-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1.45;
}
.cont-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative;
}
.cont-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  z-index: 0;
}
.cont-arrow span { position: relative; padding: 0 10px; background: var(--surface); }

@media (max-width: 720px) {
  .cont-row { grid-template-columns: 1fr; }
  .cont-arrow { transform: rotate(90deg); padding: var(--space-2) 0; }
  .cont-arrow::before { background: linear-gradient(to right, transparent, var(--accent), transparent); }
}

/* ---------- Skills section ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}
.skills-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.skills-card-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
}
.skills-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- Projects section ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
}
.side-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  transition: transform 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.side-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.side-name {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.side-period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.side-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.side-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Education ---------- */

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.edu-kind {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.edu-title { font-weight: 700; margin-bottom: 4px; }
.edu-meta { font-size: 0.88rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ---------- Contact ---------- */

.section-contact { padding-bottom: var(--space-7); }
.contact-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-elev));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}
.contact-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}
.contact-title {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-3);
}
.contact-sub {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  max-width: 56ch;
}
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.contact-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.contact-item-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
.contact-item-value {
  font-size: 1.02rem;
  word-break: break-all;
  color: var(--text);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-7);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer a { color: var(--text); }
.footer a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
