:root {
  color-scheme: dark;
  --bg: #0b1320;
  --bg-panel: #101b2d;
  --bg-hover: rgba(126, 232, 212, 0.035);
  --text: #eef4fa;
  --muted: #b0bfd0;
  --subtle: #8397ad;
  --accent: #7ee8d4;
  --accent-soft: rgba(126, 232, 212, 0.1);
  --accent-border: rgba(126, 232, 212, 0.3);
  --line: rgba(181, 207, 225, 0.14);
  --line-strong: rgba(181, 207, 225, 0.26);
  --radius-sm: 4px;
  --radius-md: 6px;
  --font-sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 68% 48% at 10% 0%, rgba(28, 53, 82, 0.68), transparent 62%),
    radial-gradient(ellipse 48% 42% at 90% 12%, rgba(19, 54, 67, 0.3), transparent 55%),
    radial-gradient(rgba(181, 207, 225, 0.085) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 26px 26px;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    560px circle at var(--spot-x, 50%) var(--spot-y, 20%),
    rgba(126, 232, 212, 0.05),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(126, 232, 212, 0.35), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-progress, 0));
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.has-scrolled .scroll-progress {
  opacity: 1;
}

body.has-pointer .spotlight {
  opacity: 1;
}

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

button {
  font: inherit;
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.55rem 0.95rem;
  background: var(--accent);
  color: #08121e;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 96px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(290px, 39%) 1fr;
  gap: clamp(2.5rem, 7vw, 6.5rem);
}

/* Left Sidebar */
.profile {
  min-height: 100svh;
  position: sticky;
  top: 0;
  align-self: start;
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
}

.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.identity {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.06em;
}

.identity span,
h1 span,
.about h2 span {
  color: var(--accent);
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(16, 27, 45, 0.8);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.03em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(126, 232, 212, 0.55);
  animation: pulse 2.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(126, 232, 212, 0.55);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(126, 232, 212, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(126, 232, 212, 0);
  }
}

.profile-main {
  margin: auto 0;
  padding: 2.5rem 0;
}

h1 {
  font-size: clamp(3.6rem, 5.5vw, 5.2rem);
  letter-spacing: -0.06em;
  line-height: 0.94;
  margin: 0 0 1.2rem;
}

.job-title {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.intro {
  max-width: 26rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0.85rem 0 0;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 2.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.15rem 0;
  transition: color 0.2s ease;
}

.nav-index {
  color: #5c7188;
  transition: color 0.2s ease;
}

.site-nav a::before {
  content: '';
  width: 20px;
  height: 1px;
  background: #53687e;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a:hover .nav-index,
.site-nav a:focus-visible .nav-index,
.site-nav a.is-active .nav-index {
  color: var(--accent);
}

.site-nav a:hover::before,
.site-nav a:focus-visible::before,
.site-nav a.is-active::before {
  width: 42px;
  background: var(--accent);
}

.profile-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #cdd8e4;
}

.action-link,
.copy-email {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.36rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(16, 27, 45, 0.55);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.action-link svg,
.copy-email svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.action-link:hover,
.copy-email:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.copy-email .icon-check {
  display: none;
}

.copy-email.is-copied {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.copy-email.is-copied .icon-copy {
  display: none;
}

.copy-email.is-copied .icon-check {
  display: block;
}

/* Main Column */
main {
  padding: 6.25rem 0 4rem;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.about {
  padding-bottom: 5.5rem;
}

.about h2 {
  font-size: clamp(2.1rem, 3.4vw, 3.1rem);
  line-height: 1.13;
  letter-spacing: -0.04em;
  margin: 0 0 1.65rem;
  font-weight: 600;
}

.about p {
  font-size: 1.03rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.1rem;
}

/* Architectural Metric Strip */
.highlights {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2.15rem 0 1.65rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(16, 27, 45, 0.35);
}

.highlights::before,
.highlights::after {
  content: '+';
  position: absolute;
  top: -0.58rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.highlights::before {
  left: -0.22rem;
}

.highlights::after {
  right: -0.22rem;
}

.highlight-item {
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.highlight-item + .highlight-item {
  border-left: 1px solid var(--line);
}

.highlight-value {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--accent);
}

.highlight-label {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.35;
}

.specialties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.specialties span {
  color: #b7ded8;
}

.specialties span:not(:last-child)::after {
  content: ' /';
  color: #4f667a;
  margin-left: 0.35rem;
}

/* Section Headers */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line-strong);
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.75rem;
}

.section-heading h2 {
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-right: 0.35rem;
}

.section-heading > span {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* Experience Timeline */
.timeline {
  position: relative;
  padding-left: 1.65rem;
}

.timeline::before,
.timeline::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.65rem;
  width: 1px;
  pointer-events: none;
}

.timeline::before {
  bottom: 0.65rem;
  background: linear-gradient(
    to bottom,
    var(--line-strong),
    var(--line) 85%,
    transparent
  );
}

.timeline::after {
  height: calc((100% - 1.3rem) * var(--trace-progress, 0));
  background: linear-gradient(
    to bottom,
    var(--accent),
    rgba(126, 232, 212, 0.5)
  );
}

.role {
  position: relative;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  padding: 1.45rem 1rem;
  margin: 0;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.role:last-child {
  border-bottom: none;
}

.role::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 1.78rem;
  width: 9px;
  height: 9px;
  border-radius: 1px;
  background: var(--bg);
  border: 1.5px solid #597088;
  z-index: 1;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.role.is-reached::before {
  border-color: var(--accent);
}

.role.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(126, 232, 212, 0.14);
}

.role:hover {
  background: var(--bg-hover);
}

.role:hover::before {
  border-color: var(--accent);
}

.role-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.2rem;
}

.role-dates {
  color: #b7c6d6;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.role:hover .role-dates {
  color: var(--accent);
}

.role-location {
  color: var(--subtle);
  font-size: 0.78rem;
}

.role-header h3 {
  font-size: 1.07rem;
  line-height: 1.35;
  margin: 0;
  font-weight: 700;
}

.role-header h4 {
  font-size: 0.96rem;
  color: var(--accent);
  font-weight: 500;
  margin: 0.2rem 0 0;
}

.role-progression {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--accent-border);
  background: rgba(16, 27, 45, 0.65);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: #d3dfeb;
}

.role-progression span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.role-progression time {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.73rem;
}

.role-points {
  margin: 0.85rem 0 0.8rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.62;
}

.role-points li + li {
  margin-top: 0.42rem;
}

.role-focus {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #96dcd0;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.role:hover .role-focus {
  color: #bcf5eb;
}

.resume-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 2rem 0 5.5rem;
}

.resume {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.98rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s ease;
}

.resume::after,
.footer-cta::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.resume svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.resume:hover,
.resume:focus-visible {
  color: var(--accent);
}

.resume:hover::after,
.resume:focus-visible::after,
.footer-cta:hover::after,
.footer-cta:focus-visible::after {
  transform: scaleX(1);
}

.resume:hover svg {
  transform: translate(2px, -2px);
}

.resume-secondary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.4rem 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.resume-secondary:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* Technical Skills Datasheet Matrix */
.skills {
  padding-bottom: 5.5rem;
}

.skill-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.skill-cell {
  padding: 1.25rem 1.3rem;
  background: var(--bg-panel);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-cell:hover {
  background: #132035;
  box-shadow: inset 0 0 0 1px rgba(126, 232, 212, 0.14);
}

.skill-cell h3 {
  margin: 0 0 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags li {
  padding: 0.24rem 0.56rem;
  border-radius: var(--radius-sm);
  background: rgba(11, 19, 32, 0.85);
  border: 1px solid var(--line);
  color: #d2dde8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.35;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.skill-tags li:hover {
  border-color: var(--accent-border);
  background: rgba(126, 232, 212, 0.08);
  color: var(--text);
}

/* Background */
.background {
  padding-bottom: 5.5rem;
}

.background-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bg-item {
  padding: 1.35rem 1.25rem;
}

.bg-item:first-child {
  padding-left: 0;
}

.bg-item + .bg-item {
  border-left: 1px solid var(--line);
}

.bg-item h3 {
  margin: 0.45rem 0 0.25rem;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.bg-item h4 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.bg-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
footer {
  border-top: 1px solid var(--line-strong);
  padding-top: 2.25rem;
}

footer p {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 0.45rem;
}

.footer-cta {
  position: relative;
  display: inline-block;
  padding-bottom: 0.15rem;
  font-size: clamp(1.35rem, 2.5vw, 1.72rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: color 0.2s ease;
}

.footer-cta:hover,
.footer-cta:focus-visible {
  color: var(--accent);
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.25rem;
}

.footer-meta small {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.back-to-top {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.back-to-top:hover {
  color: var(--accent);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .page {
    width: min(100% - 48px, 720px);
    display: block;
  }

  .profile {
    position: static;
    min-height: 0;
    padding: 2rem 0 2.5rem;
  }

  .profile-main {
    margin: 0;
    padding: 3rem 0 2rem;
  }

  h1 {
    font-size: clamp(3.25rem, 11vw, 4.25rem);
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin-top: 1.75rem;
  }

  .site-nav a::before {
    display: none;
  }

  main {
    padding: 1.5rem 0 3rem;
  }

  .about,
  .skills,
  .background {
    padding-bottom: 4.25rem;
  }

  .resume-actions {
    margin-bottom: 4.25rem;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 32px);
  }

  .highlights,
  .skill-matrix,
  .background-strip {
    grid-template-columns: 1fr;
  }

  .highlight-item + .highlight-item {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .timeline {
    padding-left: 1.25rem;
  }

  .role {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1.25rem 0.65rem;
    margin: 0;
  }

  .role::before {
    left: -1.25rem;
    top: 1.5rem;
  }

  .role-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
  }

  .bg-item {
    padding: 1.2rem 0;
  }

  .bg-item + .bg-item {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

@media (max-height: 680px) and (min-width: 961px) {
  .profile {
    position: static;
    min-height: 0;
  }

  .profile-main {
    margin: 2.5rem 0;
  }
}

/* Scroll-reveal settle (progressive enhancement) */
.has-reveal .reveal-item {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.has-reveal .role.reveal-item {
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.2s ease;
}

.has-reveal .skill-cell.reveal-item {
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.has-reveal .skill-cell.reveal-item:nth-child(even) {
  transition-delay: 60ms, 60ms, 0ms, 0ms;
}

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

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

  .pulse-dot {
    animation: none;
  }

  .spotlight,
  .scroll-progress {
    display: none;
  }

  .has-reveal .reveal-item {
    opacity: 1;
    transform: none;
  }

  * {
    transition: none !important;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #111827;
  }

  .spotlight,
  .scroll-progress,
  .skip-link,
  .site-nav,
  .copy-email,
  .resume-actions,
  .back-to-top,
  .timeline::before,
  .timeline::after,
  .role::before,
  .highlights::before,
  .highlights::after {
    display: none !important;
  }

  .has-reveal .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }

  .page {
    display: block;
    width: 100%;
  }

  .profile {
    position: static;
    min-height: 0;
    padding: 0 0 1.5rem;
  }

  main {
    padding: 0;
  }

  .timeline {
    padding-left: 0;
  }

  .skill-matrix {
    background: #d1d5db;
    border-color: #d1d5db;
  }

  .skill-cell {
    background: #ffffff;
    break-inside: avoid;
  }

  .role,
  .bg-item {
    break-inside: avoid;
  }

  .identity span,
  h1 span,
  .about h2 span,
  .section-kicker,
  .section-num,
  .highlight-value,
  .role-header h4,
  .bg-item h4,
  .skill-cell h3 {
    color: #0f766e;
  }

  .intro,
  .about p,
  .role-points,
  .bg-item p,
  footer p {
    color: #374151;
  }
}
