:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-strong: #11142d;
  --text: #11142d;
  --muted: #666b85;
  --line: #dfe2ef;
  --accent: #5b5cf0;
  --accent-soft: #e8e9ff;
  --highlight: #ff6b57;
  --shadow: 0 24px 70px rgba(37, 39, 87, 0.13);
  --radius: 1.5rem;
  --max-width: 1160px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e1c;
  --surface: #15182a;
  --surface-strong: #f5f6ff;
  --text: #f5f6ff;
  --muted: #a7acc4;
  --line: #2b3048;
  --accent: #8587ff;
  --accent-soft: #252958;
  --highlight: #ff806f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--accent) 16%, transparent) 0, transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  transition: background-color 180ms ease, color 180ms ease;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-strong);
  color: var(--bg);
  transform: translateY(-160%);
}

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

.site-header,
.section,
.site-footer {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wordmark__mark {
  display: grid;
  width: 2.1rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.site-nav a,
.site-footer a {
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.theme-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.section {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  min-height: calc(100vh - 5.5rem);
  min-height: calc(100svh - 5.5rem);
  padding-top: 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.eyebrow::before {
  content: "";
  width: 0.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0.35rem var(--accent-soft);
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.25rem, 8vw, 7.6rem);
  font-weight: 850;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

h1 span {
  color: var(--accent);
}

.hero__intro {
  max-width: 35rem;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

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

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 0.8rem 2rem color-mix(in srgb, var(--accent) 26%, transparent);
}

.button--ghost {
  background: var(--surface);
}

.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.profile-card::after {
  content: "";
  position: absolute;
  right: -2.5rem;
  top: -2.5rem;
  width: 8rem;
  aspect-ratio: 1;
  border: 1.2rem solid color-mix(in srgb, var(--highlight) 65%, transparent);
  border-radius: 50%;
}

.profile-card__visual {
  display: grid;
  min-height: 13rem;
  place-items: end start;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, transparent 0 42%, color-mix(in srgb, var(--accent) 24%, transparent) 42% 60%, transparent 60%),
    var(--surface-strong);
  background-position: center;
  background-size: cover;
  color: var(--bg);
}

.profile-card__visual.has-image span {
  opacity: 0;
}

.profile-card__visual span {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.profile-card__body {
  padding: 1.5rem 1.5rem 1.25rem;
}

.profile-card__label {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.profile-card__value {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
}

.profile-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
}

.profile-card__meta div {
  padding: 1.1rem 1.5rem;
}

.profile-card__meta div + div {
  border-left: 1px solid var(--line);
}

.profile-card__meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-card__meta dd {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.about,
.projects,
.contact {
  display: grid;
  grid-template-columns: minmax(10rem, 0.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 7rem);
}

.section-heading {
  align-self: start;
}

.section-index {
  margin: 0 0 0.5rem;
  color: var(--highlight);
  font-size: 0.85rem;
  font-weight: 850;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.about__content,
.contact__content {
  max-width: 48rem;
}

.about__content p,
.contact__content > p {
  color: var(--muted);
  font-size: 1.05rem;
}

.about__content .about__lead {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: -0.03em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0;
  margin: 2rem 0 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 650;
}

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

.project-card {
  display: flex;
  min-height: 16rem;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.project-card__number {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
}

.project-card h3 {
  margin: auto 0 0.5rem;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.project-card p {
  margin: 0;
  color: var(--muted);
}

.project-card .project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-top: 1rem;
  font-size: 0.82rem;
}

.project-card__meta span + span::before {
  content: "·";
  margin-right: 1rem;
  color: var(--line);
}

.repo-state {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 1.5rem;
}

.repo-state a {
  color: var(--accent);
  font-weight: 750;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 750;
}

.contact__content > p {
  max-width: 28ch;
  margin-top: 0;
  color: var(--text);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.35;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.contact-links a {
  border-bottom: 2px solid var(--line);
  padding: 0.35rem 0;
  font-weight: 750;
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 50;
  border-radius: 0.75rem;
  background: #b42318;
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    min-height: auto;
    padding-top: 4rem;
  }

  .profile-card {
    width: min(100%, 28rem);
    transform: rotate(0);
  }

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

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

@media (max-width: 440px) {
  .site-header,
  .section,
  .site-footer {
    width: min(calc(100% - 1.5rem), var(--max-width));
  }

  .theme-toggle__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
  }

  .hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-card__meta {
    grid-template-columns: 1fr;
  }

  .profile-card__meta div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
