:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --bg-mesh-a: rgba(183, 57, 57, 0.03);
  --bg-mesh-b: rgba(32, 56, 91, 0.05);
  --panel: #ffffff;
  --panel-strong: #fbfcfe;
  --panel-soft: #f7f9fc;
  --ink: #151a23;
  --muted: #5f6775;
  --line: rgba(21, 26, 35, 0.1);
  --line-strong: rgba(21, 26, 35, 0.16);
  --shadow: 0 12px 28px rgba(18, 24, 38, 0.06);
  --soft-raise: 0 8px 18px rgba(18, 24, 38, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --soft-inset: inset 1px 1px 2px rgba(255, 255, 255, 0.82), inset -2px -3px 8px rgba(18, 24, 38, 0.06);
  --accent: #223a5e;
  --accent-strong: #132743;
  --signal-red: #b63d3d;
  --signal-red-soft: rgba(182, 61, 61, 0.14);
  --timeline-line: linear-gradient(180deg, rgba(182, 61, 61, 0.56), rgba(182, 61, 61, 0.08));
  --chip-bg: #f8fafc;
  --theme-track: #e1e5eb;
  --theme-thumb: #ffffff;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1521;
  --bg-mesh-a: rgba(182, 61, 61, 0.08);
  --bg-mesh-b: rgba(32, 56, 91, 0.16);
  --panel: #121a28;
  --panel-strong: #172131;
  --panel-soft: #151f30;
  --ink: #f2f5fb;
  --muted: #a7b0c2;
  --line: rgba(192, 202, 219, 0.14);
  --line-strong: rgba(220, 228, 242, 0.18);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
  --soft-raise: 0 10px 22px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --soft-inset: inset 1px 1px 2px rgba(255, 255, 255, 0.04), inset -3px -3px 8px rgba(0, 0, 0, 0.24);
  --accent: #bcc7d8;
  --accent-strong: #dbe4f2;
  --signal-red: #ff7878;
  --signal-red-soft: rgba(255, 120, 120, 0.18);
  --timeline-line: linear-gradient(180deg, rgba(255, 120, 120, 0.6), rgba(255, 120, 120, 0.12));
  --chip-bg: #182334;
  --theme-track: #223148;
  --theme-thumb: #f3f6fb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--bg-mesh-a), transparent 22%),
    radial-gradient(circle at bottom right, var(--bg-mesh-b), transparent 24%),
    var(--bg);
  transition: background 180ms ease, color 180ms ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-card,
.content-panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, white), color-mix(in srgb, var(--panel-strong) 96%, transparent));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.profile-card {
  position: sticky;
  top: 22px;
  padding: 24px;
  border-radius: 16px;
}

.content-panel {
  border-radius: 18px;
  padding: 40px;
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--signal-red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.theme-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle__track {
  position: relative;
  width: 72px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 76%, white 24%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--theme-track) 92%, white), color-mix(in srgb, var(--theme-track) 98%, transparent));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  box-shadow: var(--soft-inset), var(--soft-raise);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.theme-toggle__icon {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease;
}

.theme-toggle__icon svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.theme-toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--theme-thumb) 98%, white), color-mix(in srgb, var(--theme-thumb) 96%, transparent));
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

html[data-theme='dark'] .theme-toggle__thumb {
  transform: translateX(36px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

html[data-theme='dark'] .theme-toggle__icon--moon,
html:not([data-theme='dark']) .theme-toggle__icon--sun {
  color: var(--accent-strong);
}

.photo-frame {
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 22px;
  background: #d9d9de;
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(18, 24, 38, 0.06);
}

.photo-frame img {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  object-position: center 24%;
  transform: scale(1.32);
  transform-origin: center 26%;
}

.identity-block h1,
.intro-header h2,
.resume-block h3 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.identity-block h1 {
  font-size: clamp(2rem, 2.4vw, 2.35rem);
  line-height: 1.03;
}

.role {
  margin: 12px 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.micro-bio {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 0.96rem;
  text-wrap: pretty;
}

.tag-list {
  margin: 20px 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span,
.mail-pill {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chip-bg) 98%, white), color-mix(in srgb, var(--chip-bg) 96%, transparent));
  padding: 9px 12px;
  font-size: 0.82rem;
  box-shadow: 0 4px 10px rgba(18, 24, 38, 0.04);
}

.social-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}

.social-icon-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 98%, white), color-mix(in srgb, var(--panel-strong) 94%, transparent));
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(18, 24, 38, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.social-icon-link svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
}

.social-icon-link:hover,
.mail-pill:hover,
.theme-toggle:hover .theme-toggle__track {
  border-color: color-mix(in srgb, var(--accent) 44%, transparent);
  color: var(--accent-strong);
}

.social-icon-link:hover,
.mail-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(18, 24, 38, 0.08);
}

.social-icon-link:active,
.mail-pill:active {
  transform: scale(0.98);
}

.identity-links {
  display: grid;
  gap: 10px;
}

.mail-pill {
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

.intro-header {
  margin-bottom: 26px;
}

.intro-header h2 {
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.lead {
  margin: 18px 0 0;
  max-width: 62rem;
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--muted);
  text-wrap: pretty;
}

.resume-flow {
  position: relative;
  padding-left: 24px;
}

.resume-flow::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
}

.resume-block {
  position: relative;
  margin-bottom: 14px;
  padding: 20px 20px 20px 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-soft) 98%, white), color-mix(in srgb, var(--panel-soft) 94%, transparent));
  border: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(18, 24, 38, 0.04);
}

.resume-block::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 27px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--signal-red) 78%, white), var(--signal-red));
  box-shadow: 0 0 0 5px var(--signal-red-soft);
}

.resume-block h3 {
  margin-bottom: 10px;
  font-size: 1.14rem;
}

.resume-block p {
  margin: 0;
  line-height: 1.82;
  font-size: 0.98rem;
  color: color-mix(in srgb, var(--ink) 90%, var(--muted));
  text-wrap: pretty;
}

.site-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-toggle:focus-visible,
.social-icon-link:focus-visible,
.mail-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .profile-card {
    position: static;
  }

  .content-panel,
  .profile-card {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    margin: 10px auto 18px;
    gap: 14px;
  }

  .content-panel,
  .profile-card {
    border-radius: 16px;
    padding: 18px;
  }

  .theme-toggle__track {
    width: 66px;
    height: 34px;
    padding: 0 10px;
  }

  .theme-toggle__thumb {
    width: 26px;
    height: 26px;
    top: 4px;
    left: 4px;
  }

  html[data-theme='dark'] .theme-toggle__thumb {
    transform: translateX(32px);
  }

  .photo-frame img {
    transform: scale(1.28);
    object-position: center 22%;
  }

  .social-icon-link {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .intro-header h2 {
    font-size: 2.1rem;
  }

  .lead,
  .resume-block p {
    font-size: 0.95rem;
  }

  .resume-flow {
    padding-left: 22px;
  }

  .resume-block {
    padding: 18px 16px 18px 20px;
  }

  .resume-block::before {
    left: -22px;
  }
}
