:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #101620;
  --muted: #5f6b7a;
  --line: #d8e0ea;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --shadow: 0 24px 70px rgba(36, 55, 84, 0.14);
  --radius: 16px;
  --max: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f131a;
  --surface: #161c25;
  --surface-soft: #202938;
  --ink: #f3f7fb;
  --muted: #a6b2c1;
  --line: #2f3a4b;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.06), transparent 30%),
    linear-gradient(240deg, rgba(37, 99, 235, 0.08), transparent 24%),
    var(--bg);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

body,
.tag-cloud span,
.stack-tags span,
.module-card,
.button,
.theme-toggle {
  cursor: default;
}

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

a,
button,
.module-card,
.project-tech-links a {
  cursor: pointer;
}

.top-sentinel {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  pointer-events: none;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.site-header.is-glass {
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  background: color-mix(in srgb, var(--bg), transparent 18%);
  box-shadow: 0 12px 40px rgba(16, 22, 32, 0.08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.nav-shell {
  width: min(calc(100% - 32px), var(--max));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.82rem;
}

.brand-text {
  font-size: 0.96rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 15%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), transparent 34%);
}

.nav-links a {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  background: var(--accent-soft);
  color: var(--ink);
  transform: translateY(-1px);
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle:active,
.button:active {
  transform: translateY(1px);
}

.theme-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

:root[data-theme="dark"] .theme-icon::after {
  content: "";
  position: absolute;
  inset: -3px -7px -3px 6px;
  border-radius: inherit;
  background: var(--surface);
}

.section {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 96px 0;
  scroll-margin-top: 92px;
}

#hero {
  scroll-margin-top: 0;
}

.hero {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding-top: 92px;
  padding-bottom: 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.82fr);
  gap: 56px;
  align-items: center;
}

.hero-grid-portfolio {
  align-items: stretch;
}

.profile-lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.avatar-placeholder {
  display: grid;
  width: clamp(86px, 11vw, 128px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent),
    var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 700;
}

.small-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(3.1rem, 9vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

h4 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0;
}

.role {
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 720;
}

.positioning {
  max-width: 60ch;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 0 0 26px;
}

.fact-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  padding: 14px 16px;
  box-shadow: 0 12px 30px rgba(36, 55, 84, 0.06);
}

.fact-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.fact-item strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 34px 0 22px;
}

.metric-tile {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(36, 55, 84, 0.08);
}

.metric-tile strong {
  font-size: 1.24rem;
  line-height: 1.1;
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-tags {
  margin-top: 24px;
}

.button {
  appearance: none;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  font: inherit;
  font-weight: 720;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

:root[data-theme="dark"] .button.primary {
  color: #07111f;
}

.button.ghost {
  background: color-mix(in srgb, var(--surface), transparent 20%);
  color: var(--ink);
}

.button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tech-visual {
  min-height: 500px;
}

.visual-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface), var(--accent) 5%), var(--surface-soft)),
    var(--surface);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.visual-stage-portfolio {
  display: grid;
  align-content: center;
  padding: 34px;
}

.visual-stage::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 35%);
  border-radius: 36px;
  transform: rotate(12deg);
}

.orbit-ring {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 50%);
  border-radius: 999px;
}

.ring-one {
  width: 310px;
  height: 310px;
  top: 52px;
  right: -72px;
}

.ring-two {
  width: 220px;
  height: 220px;
  bottom: -70px;
  left: -42px;
}

.code-panel {
  position: absolute;
  top: 112px;
  left: 34px;
  right: 34px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 10%);
  box-shadow: 0 18px 60px rgba(16, 22, 32, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.floating-card {
  position: absolute;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface), transparent 10%);
  box-shadow: 0 18px 60px rgba(16, 22, 32, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card-code {
  top: 50%;
  left: 34px;
  right: 34px;
  z-index: 2;
  overflow: hidden;
  padding: 0;
  transform: translateY(-50%);
}

.card-code pre {
  padding: 18px 20px 20px;
}

.card-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floating-card h3 {
  margin-bottom: 10px;
}

.floating-card p,
.compact-list {
  color: var(--muted);
}

.compact-list {
  margin: 0;
  padding-left: 1rem;
}

.compact-list li + li {
  margin-top: 8px;
}

.panel-top {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-top span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.75;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

code {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.86rem;
}

.code-panel pre {
  padding: 20px;
  color: var(--ink);
}

.metric-chip {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  box-shadow: 0 16px 40px rgba(16, 22, 32, 0.12);
}

.chip-a {
  right: 26px;
  bottom: 102px;
}

.chip-b {
  left: 30px;
  bottom: 42px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 38px;
}

.section-intro {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
}

.about-body p,
.skill-group,
.project-card,
.timeline-content,
.education-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 4%);
  box-shadow: 0 18px 48px rgba(36, 55, 84, 0.08);
}

.about-body p {
  margin: 0;
  padding: 24px;
  color: var(--muted);
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-group {
  padding: 24px;
}

.tag-cloud,
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud span,
.stack-tags span,
.stack-tags a {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  user-select: none;
  caret-color: transparent;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.tag-cloud span:hover,
.stack-tags span:hover,
.stack-tags a:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-3px);
}

.tag-cloud span:focus,
.stack-tags span:focus,
.stack-tags a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-list {
  display: grid;
  gap: 24px;
}

.project-card {
  padding: clamp(22px, 4vw, 34px);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.proof-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 18px;
}

.proof-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

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

.project-overview {
  margin-bottom: 24px;
}

.project-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

.project-summary p {
  max-width: 75ch;
  color: var(--muted);
}

.project-index {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 820;
}

.stack-tags {
  margin: 18px 0 24px;
}

.project-tech-links {
  margin-bottom: 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

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

.project-showcase {
  display: grid;
  grid-template-columns: minmax(180px, 0.95fr) minmax(0, 1.05fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface), var(--accent) 4%), var(--surface)),
    var(--surface);
  box-shadow: 0 18px 48px rgba(36, 55, 84, 0.08);
}

.project-poster {
  position: relative;
  display: block;
  min-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 12%), var(--surface));
}

.project-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  padding: 22px;
  text-align: center;
}

.poster-fallback span {
  color: var(--accent);
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: 820;
  letter-spacing: 0.02em;
}

.project-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
}

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

.project-kicker {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-card {
  display: grid;
  min-height: 210px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface), var(--accent) 4%), var(--surface)),
    var(--surface);
  padding: 22px;
  box-shadow: 0 18px 48px rgba(36, 55, 84, 0.08);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.module-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
}

.module-card span {
  color: var(--accent);
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 0.82rem;
}

.module-card h3 {
  margin: 18px 0 10px;
}

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

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 18px;
}

.highlight-box,
.screenshot-box,
.code-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 18px;
}

.highlight-box {
  grid-row: span 2;
}

.highlight-box ul,
.timeline-content ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.highlight-box li + li,
.timeline-content li + li {
  margin-top: 8px;
}

.screen-placeholder {
  display: grid;
  min-height: 190px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 45%);
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(37, 99, 235, 0.1) 12% 13%, transparent 13% 100%),
    linear-gradient(0deg, transparent 0 18%, rgba(37, 99, 235, 0.12) 18% 19%, transparent 19% 100%),
    var(--surface);
  color: var(--muted);
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 0.82rem;
}

.screen-placeholder.alt {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), transparent),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(37, 99, 235, 0.08) 18px 19px),
    var(--surface);
}

.screen-placeholder.dark {
  background:
    radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.22), transparent 30%),
    linear-gradient(135deg, var(--surface-soft), var(--surface));
}

.code-box pre {
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  color: var(--ink);
}

.media-panel {
  display: grid;
  gap: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.media-grid-video-focus {
  grid-template-columns: 1fr;
}

.media-frame {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 50%);
  border-radius: 14px;
  background: var(--surface-soft);
}

.media-frame-video {
  background: #05070b;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame img {
  min-height: 240px;
}

.media-frame video {
  aspect-ratio: 16 / 9;
  min-height: min(32vw, 420px);
  background: #000000;
  object-fit: contain;
}

.detail-note,
.detail-actions {
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-actions .button {
  min-height: 42px;
}

.module-page {
  padding-top: 1px;
}

.module-hero {
  padding-top: 132px;
  padding-bottom: 42px;
}

.module-hero h1 {
  max-width: 10ch;
  margin-bottom: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 720;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}

.module-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 24px;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 4%);
  padding: clamp(22px, 4vw, 30px);
  box-shadow: 0 18px 48px rgba(36, 55, 84, 0.08);
}

.detail-panel-wide {
  grid-column: 1 / -1;
}

.detail-panel h2 {
  margin-bottom: 20px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.detail-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.detail-list li + li {
  margin-top: 10px;
}

.code-panel-static pre {
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 18px;
  color: var(--ink);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 18px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: -8px;
  left: 11px;
  width: 1px;
  background: var(--line);
}

.time-dot {
  width: 23px;
  height: 23px;
  margin-top: 6px;
  border: 6px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--line);
}

.timeline-content {
  margin-bottom: 20px;
  padding: 24px;
}

.timeline-content p,
.education-panel p,
.footer-inner p {
  color: var(--muted);
}

.time-range {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 760;
}

.education-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  padding: clamp(24px, 4vw, 34px);
}

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

.education-details > div {
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 20px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 20%);
}

.footer-inner {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 42px 0;
}

.footer-inner h2 {
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 10px 28px;
}

.contact-grid p {
  margin: 0;
}

.contact-select {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft), transparent 8%);
  padding: 4px 10px;
  color: var(--ink);
  cursor: pointer;
  user-select: text;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.contact-select:hover,
.contact-select:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  outline: none;
}

.copyright {
  flex: 0 0 auto;
  font-size: 0.9rem;
}

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }

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

@media (prefers-reduced-transparency: reduce) {
  .site-header.is-glass,
  .code-panel {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 980px) {
  .nav-shell {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    gap: 14px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-shell {
    flex-wrap: wrap;
  }

  .hero-grid,
  .about-body,
  .skill-groups,
  .education-panel,
  .module-grid,
  .module-detail-grid {
    grid-template-columns: 1fr;
  }

  .project-showcase-grid,
  .proof-grid,
  .media-grid,
  .media-grid-video-focus,
  .hero-facts,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 128px;
  }

  .hero-grid {
    gap: 32px;
  }

  .hero-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .tech-visual,
  .visual-stage {
    min-height: 390px;
  }

  .code-panel {
    top: 70px;
  }

  .card-code {
    position: relative;
    inset: auto;
    width: auto;
    transform: none;
  }

  .visual-stage-portfolio {
    gap: 16px;
    padding-top: 72px;
  }

  .education-details,
  .project-grid,
  .project-showcase {
    grid-template-columns: 1fr;
  }

  .project-poster {
    min-height: 180px;
  }

  .project-body {
    padding: 20px;
  }

  .highlight-box {
    grid-row: auto;
  }

  .footer-inner {
    display: grid;
    align-items: start;
  }

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

@media (max-width: 620px) {
  .section {
    width: min(calc(100% - 24px), var(--max));
    padding: 64px 0;
  }

  .brand-text {
    display: none;
  }

  .nav-shell {
    width: min(calc(100% - 24px), var(--max));
    gap: 12px;
  }

  .nav-links {
    gap: 6px;
    padding: 5px;
  }

  .nav-links a {
    padding: 8px 10px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .profile-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
    padding-top: 112px;
    padding-bottom: 40px;
  }

  .hero-grid {
    gap: 24px;
  }

  .role {
    margin-bottom: 12px;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  .positioning {
    margin-bottom: 22px;
    font-size: 1rem;
  }

  .hero-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }

  .fact-item {
    padding: 12px 14px;
    border-radius: 14px;
  }

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

  .hero-actions .button:first-child {
    grid-column: auto;
  }

  .button {
    width: 100%;
    padding: 0 12px;
  }

  .hero-tags,
  .stack-tags {
    gap: 8px;
  }

  .tag-cloud span,
  .stack-tags span,
  .stack-tags a {
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .visual-stage {
    min-height: 320px;
    border-radius: 20px;
  }

  .visual-stage::before,
  .orbit-ring {
    display: none;
  }

  .visual-stage-portfolio {
    padding: 18px;
  }

  .card-code pre {
    padding: 16px;
  }

  .metric-chip {
    position: static;
    display: inline-flex;
    margin: 8px 0 0 18px;
  }

  .code-panel {
    left: 16px;
    right: 16px;
  }

  .project-showcase {
    border-radius: 20px;
  }

  .project-poster {
    min-height: 132px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .poster-fallback span {
    font-size: clamp(1.1rem, 8vw, 1.8rem);
  }

  .project-body,
  .timeline-content,
  .education-details > div,
  .proof-card,
  .detail-panel {
    padding: 18px;
  }

  .module-card {
    min-height: 0;
    padding: 18px;
  }

  .module-hero {
    padding-top: 112px;
    padding-bottom: 28px;
  }

  .module-hero h1 {
    max-width: none;
  }

  .module-detail-grid {
    gap: 16px;
  }

  .media-frame img {
    min-height: 180px;
  }

  .media-frame video {
    min-height: auto;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-summary,
  .timeline-item,
  .project-showcase {
    grid-template-columns: 1fr;
  }

  .timeline-item::before {
    display: none;
  }

  .time-dot {
    display: none;
  }

  .footer-inner {
    gap: 16px;
    padding: 32px 0;
  }
}

@media (max-width: 420px) {
  .section,
  .nav-shell,
  .footer-inner {
    width: min(calc(100% - 20px), var(--max));
  }

  .hero {
    padding-top: 104px;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .project-body,
  .timeline-content,
  .education-details > div,
  .proof-card,
  .detail-panel {
    padding: 16px;
  }

  .contact-grid {
    gap: 8px;
  }
}
