html {
  scroll-padding-top: 96px;
}

body {
  animation: page-enter 650ms cubic-bezier(.22, 1, .36, 1) both;
}

.scroll-progress {
  position: fixed;
  z-index: 1200;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--sand), var(--teal));
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  will-change: transform;
}

.nav-links a.active {
  color: var(--teal);
}

.nav-links a.active::after {
  right: 0;
}

[data-magnetic] {
  position: relative;
  overflow: hidden;
  will-change: transform;
  transition: transform 280ms cubic-bezier(.22, 1, .36, 1), background-color 200ms, color 200ms, border-color 200ms;
}

[data-magnetic]::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -80% auto -80% -45%;
  width: 32%;
  background: rgba(255, 255, 255, .22);
  transform: skewX(-22deg);
  transition: left 500ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}

[data-magnetic]:hover::before {
  left: 125%;
}

[data-magnetic] > * {
  position: relative;
  z-index: 1;
}

[data-magnetic] .ui-icon,
.contact-email .ui-icon,
.back-top .ui-icon {
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
}

[data-magnetic]:hover .ui-icon,
.contact-email:hover .ui-icon {
  transform: translate(2px, -2px);
}

.button-dark:hover .ui-icon:first-of-type {
  transform: translateY(3px);
}

[data-tilt] {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --pointer-x: 50%;
  --pointer-y: 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.skill-card::before {
  content: "";
  position: absolute;
  z-index: 5;
  left: -35%;
  top: -20%;
  width: 28%;
  height: 145%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: rotate(14deg);
  opacity: 0;
  pointer-events: none;
}

.skill-card:hover::before {
  left: 112%;
  opacity: .65;
  transition: left 850ms cubic-bezier(.22, 1, .36, 1), opacity 180ms;
}

.skill-card > div:last-child,
.skill-card .network-art,
.skill-card .radar,
.skill-card .code-window,
.skill-card .docker-art {
  transition: transform 420ms cubic-bezier(.22, 1, .36, 1), opacity 300ms;
}

.skill-card:hover > div:last-child {
  transform: translateY(-5px) translateZ(24px);
}

.skill-card:hover .network-art,
.skill-card:hover .radar,
.skill-card:hover .code-window,
.skill-card:hover .docker-art {
  transform: translateY(-4px) scale(1.015) translateZ(18px);
}

.skill-card:hover .radar {
  transform: translateX(-50%) translateY(-4px) scale(1.015) translateZ(18px);
}

.skill-card li {
  transition: transform 220ms, background-color 220ms, color 220ms, opacity 220ms;
}

.skill-card:hover li {
  opacity: .92;
  transform: translateY(-2px);
}

.skill-card:hover li:nth-child(2) { transition-delay: 35ms; }
.skill-card:hover li:nth-child(3) { transition-delay: 70ms; }
.skill-card:hover li:nth-child(4) { transition-delay: 105ms; }

.skill-primary:hover li { background: rgba(255, 255, 255, .2); }
.skill-teal:hover li, .skill-ink:hover li { background: rgba(255, 255, 255, .08); }
.skill-light:hover li { background: var(--paper); }

.js [data-tilt].reveal.visible {
  transform: perspective(1100px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(250px circle at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, .3), transparent 68%);
  transition: opacity 250ms;
}

[data-tilt]:hover::after {
  opacity: 1;
}

.skill-light[data-tilt]::after {
  background: radial-gradient(250px circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--teal) 18%, transparent), transparent 68%);
}

.skill-primary[data-tilt]::after {
  background: radial-gradient(250px circle at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, .34), transparent 68%);
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: width 180ms, height 180ms, opacity 180ms, background-color 180ms, border-color 180ms;
  will-change: transform;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--teal);
  box-shadow: 0 0 14px color-mix(in srgb, var(--teal) 55%, transparent);
}

.cursor-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid color-mix(in srgb, var(--sand-deep) 65%, transparent);
}

.cursor-ready .cursor-dot,
.cursor-ready .cursor-ring {
  opacity: 1;
}

.cursor-active .cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--sand-deep);
}

.cursor-active .cursor-ring {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 7%, transparent);
}

.lab-section {
  position: relative;
  overflow: hidden;
  background: #151814;
  color: #f6f2e9;
}

.lab-section::before {
  content: "";
  position: absolute;
  width: 720px;
  height: 720px;
  left: -280px;
  top: 15%;
  border-radius: 50%;
  background: rgba(35, 150, 127, .1);
  filter: blur(100px);
  pointer-events: none;
}

.lab-section .section-index {
  border-color: #353a33;
}

.lab-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 4rem;
  margin: 4rem 0;
}

.lab-heading .section-title {
  margin-top: .8rem;
  font-size: clamp(3.6rem, 6vw, 6.2rem);
}

.lab-heading > p {
  max-width: 430px;
  color: #92988f;
  line-height: 1.75;
}

.lab-shell {
  overflow: hidden;
  border: 1px solid #353a33;
  border-radius: 2.6rem;
  background: #10120f;
  box-shadow: 0 45px 120px rgba(0, 0, 0, .3);
}

.lab-toolbar {
  height: 58px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2c302a;
  color: #858b82;
  font: 500 .63rem "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.lab-toolbar > div {
  display: flex;
  gap: .4rem;
}

.lab-toolbar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d423b;
}

.lab-toolbar i:first-child {
  background: var(--sand);
}

.lab-layout {
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  min-height: 610px;
}

.lab-map {
  position: relative;
  min-height: 610px;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 38px 38px;
}

.lab-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #394038;
  stroke-width: 1.2;
}

.lab-connections .signal-line {
  stroke: var(--teal);
  stroke-width: 1.7;
  stroke-dasharray: 4 13;
  animation: signal-flow 12s linear infinite;
  opacity: .75;
}

.lab-node {
  position: absolute;
  z-index: 2;
  width: 150px;
  min-height: 94px;
  padding: 1rem;
  border: 1px solid #3a4038;
  border-radius: 1.3rem;
  background: rgba(28, 32, 27, .92);
  color: #f6f2e9;
  display: grid;
  gap: .25rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(0, 0, 0, .18);
  transition: transform 250ms, border-color 250ms, background 250ms;
}

.lab-node:hover {
  transform: translateY(-4px);
  border-color: #626a5f;
}

.lab-node::after {
  content: "";
  position: absolute;
  right: .85rem;
  top: .85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #596057;
  transition: background 220ms, box-shadow 220ms, transform 220ms;
}

.lab-node:hover::after,
.lab-node.active::after {
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(35, 150, 127, .12);
  transform: scale(1.08);
}

.lab-node.active {
  border-color: var(--sand);
  background: var(--sand);
  color: #171915;
  box-shadow: 0 0 0 8px rgba(234, 190, 124, .07), 0 20px 55px rgba(0, 0, 0, .3);
}

.lab-node span {
  font: 500 .55rem "DM Mono", monospace;
  letter-spacing: .1em;
  opacity: .55;
}

.lab-node b {
  font-size: 1rem;
}

.lab-node small {
  color: #858b82;
  font-size: .65rem;
}

.lab-node.active small {
  color: #5e503b;
}

.node-core { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.node-core:hover { transform: translate(-50%, calc(-50% - 4px)); }
.node-vpn { left: 7%; top: 10%; }
.node-docker { right: 7%; top: 10%; }
.node-backup { left: 7%; bottom: 10%; }
.node-monitor { right: 7%; bottom: 10%; }

.lab-inspector {
  position: relative;
  padding: 2.3rem;
  border-left: 1px solid #2c302a;
  background: #181b17;
  display: flex;
  flex-direction: column;
}

.lab-inspector.updating > *:not(.inspector-status) {
  opacity: .35;
  transform: translateY(4px);
}

.lab-inspector > * {
  transition: opacity 180ms, transform 180ms;
}

.inspector-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: auto;
  color: #858b82;
  font: 500 .58rem "DM Mono", monospace;
  text-transform: uppercase;
}

.inspector-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(35, 150, 127, .12);
}

.lab-inspector h3 {
  margin: .7rem 0 1rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: .95;
  letter-spacing: -.055em;
}

.lab-inspector > p:not(.card-kicker) {
  min-height: 105px;
  color: #9ba097;
  line-height: 1.7;
}

.lab-inspector dl {
  margin: 1.5rem 0;
  border-top: 1px solid #30342e;
}

.lab-inspector dl div {
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #30342e;
}

.lab-inspector dt {
  color: #737970;
  font: 500 .58rem "DM Mono", monospace;
  text-transform: uppercase;
}

.lab-inspector dd {
  margin: 0;
  text-align: right;
  font-size: .7rem;
}

.inspector-log {
  margin-top: auto;
  padding: .9rem;
  border-radius: 1rem;
  background: #10120f;
  color: #858b82;
  display: flex;
  align-items: center;
  gap: .4rem;
  font: 500 .58rem "DM Mono", monospace;
}

.inspector-log span { color: var(--teal); }
.inspector-log b {
  min-width: 0;
  color: #d6d9d3;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.inspector-log i { width: 5px; height: 11px; background: var(--sand); animation: blink 1s steps(1) infinite; }

.timeline-item {
  position: relative;
  isolation: isolate;
  transition: padding-left 320ms cubic-bezier(.22, 1, .36, 1);
}

.timeline-item::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: .65rem -.9rem;
  border-radius: 1.4rem;
  background: color-mix(in srgb, var(--teal) 7%, transparent);
  opacity: 0;
  transform: scale(.985);
  transition: opacity 250ms, transform 320ms cubic-bezier(.22, 1, .36, 1);
}

.timeline-item:hover {
  padding-left: .8rem;
}

.timeline-item:hover::before {
  opacity: 1;
  transform: scale(1);
}

.timeline-item h3,
.timeline-item .timeline-company {
  transition: color 220ms, transform 280ms;
}

.timeline-item:hover h3 {
  color: var(--teal);
  transform: translateX(3px);
}

.certificate-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 rgba(234, 190, 124, 0);
  pointer-events: none;
  transition: border-color 300ms, box-shadow 300ms;
}

.certificate-card:hover::after,
.certificate-card:focus-visible::after {
  border-color: rgba(234, 190, 124, .55);
  box-shadow: inset 0 0 0 6px rgba(234, 190, 124, .06);
}

.certificate-overlay {
  transition: padding-bottom 350ms cubic-bezier(.22, 1, .36, 1);
}

.certificate-card:hover .certificate-overlay {
  padding-bottom: 2rem;
}

.certificate-overlay b {
  opacity: .72;
  transform: translateY(5px);
  transition: opacity 250ms, transform 300ms;
}

.certificate-card:hover .certificate-overlay b {
  opacity: 1;
  transform: none;
}

.contact-email,
.contact-phone,
.pgp-link {
  transition: padding-left 280ms, color 220ms, opacity 220ms;
}

.contact-email:hover,
.contact-phone:hover {
  padding-left: .65rem;
}

.pgp-link:hover {
  color: var(--teal-dark);
}

:where(a, button):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 60%, white);
  outline-offset: 4px;
}

.nav-shell,
.hero-console,
.lab-shell,
.contact-panel {
  transition: box-shadow 350ms, border-color 350ms, background-color 350ms;
}

.hero-console:hover,
.lab-shell:hover {
  border-color: color-mix(in srgb, var(--sand) 38%, #353a33);
  box-shadow: 0 42px 110px rgba(0, 0, 0, .24);
}

@keyframes page-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes signal-flow {
  to { stroke-dashoffset: -170; }
}

@media (max-width: 1000px) {
  .lab-heading { align-items: start; flex-direction: column; gap: 1.5rem; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-inspector { min-height: 430px; border-left: 0; border-top: 1px solid #2c302a; }
}

@media (max-width: 640px) {
  .scroll-progress { height: 2px; }
  .lab-heading .section-title { font-size: clamp(3.1rem, 15vw, 4.5rem); }
  .lab-shell { border-radius: 2rem; }
  .lab-toolbar { padding: 0 1rem; }
  .lab-map { min-height: 550px; }
  .lab-node { width: 122px; min-height: 82px; padding: .8rem; border-radius: 1rem; }
  .node-vpn, .node-backup { left: 4%; }
  .node-docker, .node-monitor { right: 4%; }
  .lab-inspector { padding: 1.5rem; }
  [data-tilt]::after { display: none; }
  .cursor-dot, .cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  [data-magnetic], .js [data-tilt].reveal.visible { transform: none !important; }
  .lab-connections .signal-line { animation: none; }
}

/* Pointer effects use real elements so their position remains reliable across browsers. */
[data-tilt]::after {
  display: none;
}

.card-spotlight {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(circle, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .16) 34%, transparent 70%);
  transition: opacity 180ms;
  will-change: left, top;
}

.skill-light .card-spotlight {
  background: radial-gradient(circle, color-mix(in srgb, var(--teal) 24%, transparent) 0%, color-mix(in srgb, var(--teal) 9%, transparent) 38%, transparent 70%);
}

.skill-primary .card-spotlight {
  background: radial-gradient(circle, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .15) 38%, transparent 70%);
}

[data-tilt].pointer-inside .card-spotlight {
  opacity: 1;
}

/* Lightweight surface glow: isolated from links, buttons and theme controls. */
[data-spotlight-surface] {
  --surface-x: 50%;
  --surface-y: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

[data-spotlight-surface]::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(360px circle at var(--surface-x) var(--surface-y), rgba(255, 255, 255, .22), transparent 68%);
  transition: opacity 220ms ease;
}

[data-spotlight-surface].surface-active::before {
  opacity: 1;
}

[data-spotlight-surface="teal"]::before {
  background: radial-gradient(280px circle at var(--surface-x) var(--surface-y), rgba(255, 255, 255, .36), rgba(255, 255, 255, .09) 42%, transparent 72%);
}

[data-spotlight-surface="sand"]::before {
  background: radial-gradient(420px circle at var(--surface-x) var(--surface-y), rgba(255, 255, 255, .3), transparent 70%);
}

@media (hover: none), (pointer: coarse) {
  .card-spotlight,
  [data-spotlight-surface]::before,
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}
