:root {
  color-scheme: dark;
  --background: #080910;
  --surface: #10121d;
  --border: #25283a;
  --text: #f2f3ff;
  --muted: #b0b3c9;
  --accent: #a6b2ff;
  --accent-text: #d0d8ff;
  --accent-surface: #141936;
  --control-surface: #c5ceff;
  --control-text: #131834;
  --target-size: 44px;
  --header-height: 67px;
  --mono: ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "DM Sans", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--control-surface); color: var(--control-text); }

.skip-link {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--background);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  z-index: 3;
  inset: 0 0 auto;
  border-bottom: 1px solid #1b1d2a;
  background: #080910ed;
  backdrop-filter: blur(16px);
  transition: background-color 180ms ease, border-color 180ms ease;
}
.site-header.is-over-hero {
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
}
.nav-inner, .footer-inner {
  display: flex;
  width: min(1120px, calc(100% - 48px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: auto;
}
.nav-inner { min-height: calc(var(--header-height) - 1px); }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { color: var(--accent); font-size: 19px; }
.footer-inner > a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav-inner > a, .footer-inner > a {
  display: inline-flex;
  min-width: var(--target-size);
  min-height: var(--target-size);
  align-items: center;
  justify-content: center;
}
.footer-inner > a:hover { color: var(--text); }
.top-nav { display: flex; align-items: center; gap: 5px; }
.top-nav a {
  display: inline-flex;
  min-width: var(--target-size);
  min-height: var(--target-size);
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.site-header.is-over-hero .top-nav a { color: var(--text); }
.top-nav a:hover { color: var(--text); }
.top-nav a[aria-current="location"] {
  background: rgb(166 178 255 / 13%);
  color: var(--text);
}
.section-nav {
  position: fixed;
  z-index: 4;
  top: 50%;
  inset-inline-start: 0;
  display: grid;
  transform: translateY(-50%);
}
.section-nav a {
  position: relative;
  display: flex;
  width: 24px;
  min-height: 26px;
  align-items: center;
  padding-inline-start: 5px;
}
.section-nav a::before {
  width: 10px;
  height: 1px;
  border-radius: 2px;
  background: var(--muted);
  opacity: .55;
  content: "";
  transition: width 160ms ease, opacity 160ms ease, background-color 160ms ease;
}
.section-nav a[aria-current="location"]::before {
  width: 16px;
  height: 2px;
  background: var(--text);
  opacity: 1;
}
.section-nav a:hover::before, .section-nav a:focus-visible::before {
  background: var(--text);
  opacity: 1;
}
.section-nav a:focus-visible { outline-offset: -2px; }
.section-nav a span {
  position: absolute;
  inset-inline-start: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.section-nav a:hover span, .section-nav a:focus-visible span { opacity: 1; }

@media (pointer: coarse) {
  .section-nav a { min-height: var(--target-size); }
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 46%, rgb(31 43 105 / 32%), transparent 72%),
    linear-gradient(180deg, rgb(8 9 16 / 78%), rgb(8 9 20 / 53%) 46%, rgb(8 9 16 / 62%) 75%, var(--background)),
    url("xer-hero-yohan-cho.webp") 67% 52% / cover no-repeat,
    var(--background);
  padding: 76px 24px;
  text-align: center;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    radial-gradient(circle at 16% 37%, #c9d4ff 0 1px, transparent 1.8px),
    radial-gradient(circle at 71% 69%, #b8c7ff 0 .8px, transparent 1.5px),
    radial-gradient(circle at 45% 12%, #6f83d5 0 .8px, transparent 1.5px);
  background-size: 153px 147px, 213px 191px, 91px 117px;
  content: "";
  opacity: .4;
}
.hero-content {
  width: min(100%, 760px);
  animation: intro 700ms ease-out both;
}
.orbit-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, 670px);
  min-height: clamp(120px, 24vw, 245px);
  place-items: center;
  margin: 0 auto;
}
h1 {
  padding: 0 .09em .06em 0;
  color: var(--accent-text);
  font-size: clamp(140px, 23vw, 300px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .95;
}
h1 span { color: var(--accent); }
.orbit { position: absolute; z-index: -1; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.orbit-star { fill: #f0f4ff; filter: drop-shadow(0 0 10px #9cb1ff); }
.orbit-star-still { display: none; }
@keyframes intro {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes section-enter {
  from { opacity: .55; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

.section-enter { animation: section-enter 480ms cubic-bezier(.2, .65, .3, 1); }

.section {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  padding: clamp(60px, 9vw, 108px) 0;
}
.section + .section { border-top: 1px solid var(--border); }
.section-heading { max-width: 640px; }
h2 { font-size: clamp(34px, 5.3vw, 65px); line-height: 1.07; letter-spacing: -.04em; text-wrap: balance; }
.section-heading > p { margin-top: 18px; }
.section-heading > p, .about-bio, .project-copy > p, .case-study-content p {
  color: var(--muted);
  line-height: 1.65;
  text-wrap: pretty;
}
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: 56px; }
.about-bio { display: grid; gap: 6px; margin-top: 18px; }
.about-name { color: var(--text); font-size: clamp(20px, 2.5vw, 27px); font-weight: 700; }
.profile-portrait-frame {
  width: min(100%, 400px);
  justify-self: center;
}
.profile-portrait {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  margin: 0;
  border: 1px solid #3b4568;
  border-radius: 18px;
  background: var(--surface);
}
.portrait-window, .profile-caption { grid-area: 1 / 1; }
.portrait-window {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--accent-surface);
}
.portrait { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-caption {
  z-index: 1;
  align-self: end;
  padding: 52px clamp(18px, 3vw, 27px) clamp(18px, 3vw, 25px);
  background: linear-gradient(180deg, transparent, rgb(8 9 16 / 88%) 57%, var(--background));
}
.profile-caption strong { color: var(--text); font-size: clamp(38px, 5vw, 54px); letter-spacing: -.04em; line-height: 1; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .profile-portrait { transition: transform 260ms ease-out, border-color 260ms ease-out; }
  .profile-portrait-frame:hover .profile-portrait {
    transform: translateY(-7px) rotate(-1deg);
    border-color: #6575ad;
  }
}

.work-placeholder {
  min-height: clamp(160px, 23vw, 270px);
  margin-top: 34px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.project-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  overflow: hidden;
  margin-top: 34px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.project-visual {
  display: grid;
  min-height: 260px;
  align-content: center;
  justify-items: center;
  gap: 19px;
  padding: 24px;
  background: var(--accent-surface);
  text-align: center;
}
.project-emblem {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 27px;
  background: var(--control-surface);
  color: var(--control-text);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.project-visual > span { color: var(--accent-text); font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: .08em; }
.project-copy { align-self: center; padding: clamp(23px, 4vw, 51px); }
.project-copy h3 { margin: 0 0 13px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.04em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tags li { padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; color: var(--accent-text); font-size: 12px; }
.case-study { margin-top: 20px; border-top: 1px solid var(--border); }
.case-study summary {
  display: list-item;
  min-height: var(--target-size);
  padding: 12px 0;
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}
.case-study summary:hover { color: var(--text); }
.case-study-content h4 { margin: 12px 0 4px; font-size: 15px; }
.case-study-content p { font-size: 15px; }

.text-link { color: var(--accent-text); text-decoration: underline; text-underline-offset: .2em; }
.text-link:hover { color: var(--text); }
.github-calendar {
  margin-top: 26px;
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.github-sync { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.calendar-scroll { padding: 2px 0 8px; overflow-x: auto; }
.calendar-chart {
  --cell-size: 11px;
  --cell-gap: 3px;
  display: flex;
  width: max-content;
  gap: 12px;
}
.calendar-month-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.calendar-days {
  display: grid;
  grid-template-rows: repeat(7, var(--cell-size));
  grid-auto-columns: var(--cell-size);
  grid-auto-flow: column;
  gap: var(--cell-gap);
}
.calendar-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--border); }
.calendar-cell[data-level="1"] { background: #44519a; }
.calendar-cell[data-level="2"] { background: #6473c4; }
.calendar-cell[data-level="3"] { background: #8797ef; }
.calendar-cell[data-level="4"] { background: var(--control-surface); }
.calendar-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 6px; }
#contribution-summary { color: var(--muted); font-size: 14px; font-weight: 600; }
.calendar-legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }

.capability-grid {
  display: grid;
  gap: 15px;
  margin-top: 32px;
  padding-inline-start: 23px;
}
.capability-card {
  display: grid;
  min-height: 100px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 12px 24px;
  padding: 20px 24px 20px 74px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.capability-card h3 { font-size: clamp(18px, 2.2vw, 24px); line-height: 1.2; }
.skill-emblem {
  position: absolute;
  top: 50%;
  left: -19px;
  display: grid;
  width: 67px;
  height: 67px;
  place-items: center;
  transform: translateY(-50%) rotate(9deg);
  border: 1px solid #414e83;
  border-radius: 15px;
  background: linear-gradient(145deg, #293669, #151a30 78%);
  color: #b6c5ff;
  box-shadow: 0 5px 10px rgb(0 0 0 / 30%);
}
.skill-emblem svg { width: 30px; height: 30px; }
.skill-tags { justify-content: flex-end; margin-top: 0; }
.skill-tags li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  font-size: 13px;
}
.skill-tags img { display: block; flex: none; }

.sweep-hover { position: relative; isolation: isolate; }
@media (hover: hover) {
  .sweep-hover:hover {
    border-color: #566bb5;
    background-color: #263569;
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .sweep-hover { transition: background-color 180ms ease, border-color 180ms ease; }
  .sweep-hover:hover { transition: background-color 300ms ease 420ms, border-color 180ms ease; }
  .sweep-hover::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background-image:
      radial-gradient(circle, rgb(220 227 255 / 40%) 0 .8px, transparent 1px),
      linear-gradient(90deg, transparent 18%, #4358c7 43%, #596ee6 52%, transparent 76%);
    background-size: 19px 21px, 230% 100%;
    opacity: 0;
    pointer-events: none;
    content: "";
  }
  .sweep-hover:hover::before { animation: hover-sweep 720ms ease-out both; }
  @keyframes hover-sweep {
    0% { background-position: 0 0, 100% 0; opacity: 0; }
    30% { opacity: .8; }
    75% { opacity: .65; }
    100% { background-position: 10px 0, 0 0; opacity: 0; }
  }
}

@media (max-width: 600px) {
  .capability-grid { padding-inline-start: 16px; }
  .capability-card { grid-template-columns: minmax(0, 1fr); padding: 17px 14px 17px 50px; }
  .skill-emblem { top: 15px; left: -13px; width: 47px; height: 47px; transform: rotate(9deg); border-radius: 12px; }
  .skill-emblem svg { width: 23px; height: 23px; }
  .skill-tags { justify-content: flex-start; gap: 6px; }
}

.contact-panel, .contact-link {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.contact-panel { padding: clamp(22px, 5vw, 52px); }
.contact-title {
  font-size: clamp(25px, 5vw, 60px);
  overflow-wrap: anywhere;
  text-wrap: initial;
}
#contact-email:is(:hover, :focus-visible) {
  color: var(--accent-text);
  text-shadow: 0 0 14px rgb(166 178 255 / 65%), 0 0 32px rgb(110 132 255 / 45%);
}
@media (prefers-reduced-motion: no-preference) {
  #contact-email { transition: color 180ms ease, text-shadow 180ms ease; }
}
.contact-panel > p { margin-top: 18px; color: var(--muted); line-height: 1.6; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.contact-actions:has(.copy-email:not([hidden])) { margin-top: 22px; }
.copy-email {
  min-height: var(--target-size);
  padding: 8px 15px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: transparent;
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 700;
}
.copy-email:hover { color: var(--text); }
.copy-status { color: var(--muted); font-size: 14px; }
.contact-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.contact-link {
  display: flex;
  height: 100%;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  overflow-wrap: anywhere;
}
.contact-link:hover .contact-handle { color: var(--text); }
.contact-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  color: white;
}
.contact-icon svg { width: 24px; height: 24px; }
.contact-icon-github { background: var(--text); color: var(--background); }
.contact-icon-instagram { background: linear-gradient(40deg, #ed9a39, #cc276c 54%, #6234be); }
.contact-icon-facebook { background: #0866ff; }
.contact-handle { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

.site-footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 94px; color: var(--muted); font-size: 13px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.footer-brand .wordmark { color: var(--text); }

@media (max-width: 740px) {
  .about, .project-card { grid-template-columns: minmax(0, 1fr); }
  .contact-links { grid-template-columns: 1fr; }
  .about { gap: 29px; }
  .hero { padding-block: 42px 54px; }
  .project-visual { min-height: 205px; }
}
@media (max-width: 480px) {
  .top-nav { display: none; }
}
@media (max-width: 420px) {
  .nav-inner, .footer-inner, .section { width: calc(100% - 32px); }
  .nav-inner { gap: 8px; }
  .wordmark { font-size: 17px; }
  .section { padding-inline-start: 12px; }
  .hero { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-content, .section-enter { animation: none; }
  .orbit-star-moving { display: none; }
  .orbit-star-still { display: inline; }
  .site-header { transition: none; }
  .section-nav a::before { transition: none; }
}
