:root {
  color-scheme: dark;
  --bg: #0e1116;
  --bg-elevated: #141a24;
  --surface: #171f2b;
  --surface-soft: #101620;
  --text: #e8eaed;
  --muted: #a7b1bd;
  --subtle: #7d8996;
  --line: rgba(232, 234, 237, 0.12);
  --line-strong: rgba(45, 212, 191, 0.38);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.11);
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sans: Pretendard, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #eef5f5;
  --text: #1f2937;
  --muted: #526170;
  --subtle: #71808f;
  --line: rgba(31, 41, 55, 0.12);
  --line-strong: rgba(13, 148, 136, 0.3);
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --shadow: 0 18px 46px rgba(31, 41, 55, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45, 212, 191, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size: 56px 56px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.65;
  margin: 0;
  min-width: 320px;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
summary {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  background: var(--accent);
  color: #07110f;
  font-weight: 900;
  left: 16px;
  padding: 9px 12px;
  position: fixed;
  top: 12px;
  transform: translateY(-140%);
  transition: transform 160ms ease;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  margin: 0 auto;
  max-width: 1100px;
  width: min(calc(100% - 48px), 1100px);
}

.site-header {
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 72px;
  justify-content: space-between;
  left: 0;
  padding: 0 32px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: 3px;
}

.site-nav a {
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 9px 11px;
  transition: background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.theme-toggle,
.menu-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  height: 40px;
}

.theme-toggle {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 56px;
}

.theme-toggle span {
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: block;
  height: 18px;
  position: relative;
  transition: background 180ms ease;
  width: 34px;
}

.theme-toggle span::before {
  background: var(--accent);
  border-radius: 2px;
  content: "";
  height: 12px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 180ms ease;
  width: 12px;
}

:root[data-theme="light"] .theme-toggle span {
  background: rgba(13, 148, 136, 0.08);
}

:root[data-theme="light"] .theme-toggle span::before {
  transform: translateX(16px);
}

.menu-button {
  display: none;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.menu-button span {
  background: var(--text);
  display: block;
  height: 2px;
  margin: 0 auto;
  transition: opacity 180ms ease, transform 180ms ease;
  width: 20px;
}

.menu-open .menu-button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .menu-button span:nth-child(2) {
  opacity: 0;
}

.menu-open .menu-button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  min-height: auto;
  overflow: hidden;
  padding: 118px 0 30px;
  position: relative;
}

.hero::after {
  background: linear-gradient(180deg, transparent, var(--bg) 95%);
  content: "";
  inset: auto 0 0;
  height: 92px;
  pointer-events: none;
  position: absolute;
}

.hero-visual {
  inset: 72px 0 0;
  opacity: 0.75;
  pointer-events: none;
  position: absolute;
}

.trace,
.node {
  position: absolute;
}

.trace {
  background: var(--line-strong);
  opacity: 0.32;
}

.trace-a {
  height: 1px;
  right: 10%;
  top: 26%;
  width: 34%;
}

.trace-b {
  height: 32%;
  right: 23%;
  top: 26%;
  width: 1px;
}

.trace-c {
  height: 1px;
  right: 23%;
  top: 58%;
  width: 22%;
}

.node {
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-soft);
  height: 12px;
  width: 12px;
}

.node-a {
  right: 44%;
  top: 25%;
}

.node-b {
  right: 22.5%;
  top: 57%;
}

.node-c {
  right: 9.5%;
  top: 25%;
}

.hero-layout {
  align-items: end;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-label,
.project-topline,
.impact-box dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  word-break: keep-all;
}

p {
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 24px;
  max-width: 820px;
}

.hero-description {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  margin-bottom: 0;
  max-width: 760px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  color: #07110f;
}

.button.secondary {
  background: var(--accent-soft);
  border-color: var(--line-strong);
  color: var(--accent);
}

.button.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.hero-panel,
.skill-card,
.project-card,
.education-card,
.background-card,
.contact-card {
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 34%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

.hero-panel dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.hero-panel div {
  padding: 17px 0;
}

.hero-panel div + div {
  border-top: 1px solid var(--line);
}

.hero-panel dt {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hero-panel dd {
  font-weight: 900;
  margin: 0;
}

.section {
  padding: 74px 0;
}

.skills-section {
  border-top: 1px solid var(--line);
  padding-top: 36px;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 34px;
  max-width: 780px;
}

.section-heading.inline {
  margin-bottom: 22px;
}

.section-heading h2,
.contact-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 930;
  line-height: 1.14;
  margin-bottom: 14px;
}

.section-heading p,
.contact-card p,
.project-summary,
.background-card p,
.education-card p,
.project-facts dd,
.career-details li {
  color: var(--muted);
}

.section-heading p,
.contact-card p,
.background-card p,
.education-card p {
  margin-bottom: 0;
}

.skills-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-card {
  min-height: 295px;
  padding: 23px;
}

.skill-card h3,
.education-card h3 {
  font-size: 1.28rem;
  line-height: 1.26;
  margin: 14px 0 18px;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-grid span {
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 8px;
}

.tag-grid.compact span {
  color: var(--accent);
}

.project-card {
  padding: 25px;
}

.project-card.featured {
  border-color: var(--line-strong);
  margin-bottom: 18px;
}

.project-topline {
  align-items: center;
  color: var(--subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 17px;
}

.project-topline span:first-child,
.featured-badge {
  color: var(--accent);
}

.project-main {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.project-card h3 {
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.projects-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.projects-grid .project-card h3 {
  font-size: 1.45rem;
}

.impact-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 18px;
}

.impact-box dd {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 3.2rem;
  font-weight: 950;
  line-height: 1;
  margin: 6px 0 8px;
}

.impact-box p {
  color: var(--muted);
  margin: 0;
}

.project-facts {
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 22px;
  padding: 0 18px;
}

.project-facts div {
  display: grid;
  gap: 18px;
  grid-template-columns: 126px minmax(0, 1fr);
  padding: 16px 0;
}

.project-facts div + div {
  border-top: 1px solid var(--line);
}

.project-facts dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 900;
}

.project-facts dd {
  margin: 0;
}

.project-links {
  margin-top: 20px;
}

.text-link {
  color: var(--accent);
  display: inline-flex;
  font-weight: 900;
  margin-top: 18px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.education-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.education-card {
  padding: 24px;
}

.education-card .tag-grid {
  margin-top: 22px;
}

.background-card {
  padding: 30px;
}

.background-card strong {
  color: var(--text);
}

.background-card .tag-grid {
  margin-top: 22px;
}

.career-details {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.career-details summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.career-details[open] summary {
  color: var(--accent);
  margin-bottom: 12px;
}

.career-details ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 19px;
}

.contact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 24px;
}

.contact-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--accent);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.contact-icon svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}

.method-label {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.method-value {
  color: var(--text);
  align-self: start;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.method-value:hover {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px 0;
}

.footer-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--accent);
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-layout,
  .project-main,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .impact-box {
    max-width: 320px;
  }

  .project-facts div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 36px), 1100px);
  }

  .site-header {
    padding: 0 18px;
  }

  .brand-copy small {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    left: 0;
    padding: 16px 18px 22px;
    position: fixed;
    right: 0;
    top: 72px;
  }

  .menu-open .site-nav {
    display: flex;
  }

  .site-nav a {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding: 104px 0 28px;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .section {
    padding: 60px 0;
  }

  .skills-section {
    padding-top: 34px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .skill-card {
    min-height: auto;
  }

  .hero-actions,
  .contact-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .project-card,
  .background-card,
  .contact-card {
    padding: 22px;
  }

  .contact-icon {
    height: 40px;
    width: 40px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .brand-copy strong {
    display: none;
  }

  .project-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .impact-box {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
