/* aurora - a northern-lights band over a dark platform; dark-first light-dark() tokens, zero dependencies */

/* ---------- tokens ---------- */

:root {
  color-scheme: light dark;

  --bg:            light-dark(#f4f6fc, #0a0d19);
  --text:          light-dark(#0f1428, #e7eaf6);
  --muted:         light-dark(#4d5674, #98a1bd);

  --raised:        light-dark(rgb(255 255 255 / 0.66), rgb(19 24 41 / 0.62));
  --border:        light-dark(rgb(15 20 40 / 0.12), rgb(231 234 246 / 0.10));
  --border-strong: light-dark(rgb(15 20 40 / 0.24), rgb(231 234 246 / 0.22));
  --chip-bg:       light-dark(rgb(15 20 40 / 0.05), rgb(231 234 246 / 0.06));
  --glass-edge:    light-dark(rgb(255 255 255 / 0.65), rgb(231 234 246 / 0.07));

  /* ink-safe accents (AA on --bg) */
  --teal:          light-dark(#0a6e61, #46d4c2);
  --violet:        light-dark(#5d4ce0, #8b7cf6);

  /* decorative glows */
  --dot:           light-dark(#0e9c8a, #46d4c2);
  --glow-teal:     light-dark(rgb(70 212 194 / 0.34), rgb(70 212 194 / 0.38));
  --glow-violet:   light-dark(rgb(139 124 246 / 0.30), rgb(139 124 246 / 0.32));
  --glow-green:    light-dark(rgb(126 226 168 / 0.24), rgb(126 226 168 / 0.22));
  --shadow:        light-dark(rgb(15 20 40 / 0.35), rgb(2 4 10 / 0.85));

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --gutter: clamp(1.25rem, 5vw, 3rem);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  /* the hero ribbon paints wider than the viewport on phones */
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

::selection {
  background: rgb(70 212 194 / 0.3);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--violet);
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -4rem;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0.6rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 1.25rem;
}

/* ---------- shared bits ---------- */

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  color: var(--text);
  border-color: var(--teal);
  box-shadow: 0 4px 24px -6px var(--glow-teal);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: light-dark(rgb(10 110 97 / 0.5), rgb(70 212 194 / 0.42));
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--chip-bg);
  color: var(--muted);
}

.pills {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pills li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
}

/* ---------- theme switcher ---------- */

.theme-switch {
  position: absolute;
  top: 1.4rem;
  right: var(--gutter);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.switch-label {
  color: var(--muted);
  opacity: 0.75;
}

.theme-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.theme-switch a:hover {
  color: var(--teal);
}

.theme-switch a[aria-current="true"] {
  color: var(--text);
  border-bottom-color: var(--teal);
}

/* ---------- hero + aurora ribbon ---------- */

.hero {
  position: relative;
  min-height: 85vh;
  min-height: 85svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 6rem var(--gutter) 4rem;
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6%;
  width: min(110rem, 150vw);
  height: 62%;
  border-radius: 999px;
  transform: translateX(-50%) rotate(-8deg);
  filter: blur(clamp(40px, 7vw, 90px));
}

.aurora::before {
  background:
    radial-gradient(42% 46% at 24% 46%, var(--glow-teal), transparent 68%),
    radial-gradient(38% 44% at 55% 32%, var(--glow-violet), transparent 70%),
    radial-gradient(26% 34% at 77% 54%, var(--glow-green), transparent 72%),
    radial-gradient(30% 30% at 42% 62%, var(--glow-teal), transparent 75%);
  animation: aurora-drift 30s ease-in-out infinite;
}

.aurora::after {
  background: conic-gradient(
    from 250deg at 50% 55%,
    transparent 0deg,
    var(--glow-violet) 40deg,
    var(--glow-teal) 95deg,
    transparent 150deg,
    var(--glow-green) 215deg,
    transparent 265deg
  );
  opacity: 0.45;
  animation: aurora-drift-b 38s ease-in-out infinite;
}

@keyframes aurora-drift {
  0%, 100% { transform: translate3d(-54%, 0, 0) rotate(-9deg) scale(1); opacity: 0.8; }
  50%      { transform: translate3d(-46%, -3%, 0) rotate(-5deg) scale(1.07); opacity: 1; }
}

@keyframes aurora-drift-b {
  0%, 100% { transform: translate3d(-46%, -2%, 0) rotate(-6deg) scale(1.05); opacity: 0.3; }
  50%      { transform: translate3d(-54%, 1%, 0) rotate(-10deg) scale(1); opacity: 0.5; }
}

.hero .eyebrow {
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
  margin-bottom: 1.1rem;
}

.hero .role {
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.1rem;
}

.hero .tagline {
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 46ch;
  margin: 0 auto 2.5rem;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.875rem;
}

/* ---------- sections ---------- */

main {
  /* Content pieces below cap at ~56-60ch, so the container matches them:
     a wider main leaves a dead right margin next to the centered hero. */
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main > section {
  padding-block: clamp(3.5rem, 9vh, 6.5rem);
}

main h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 2rem;
}

main h2::before {
  content: "";
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 8px var(--glow-teal);
  margin-right: 0.65rem;
  vertical-align: 0.09em;
}

/* about */

#about p {
  max-width: 60ch;
}

#about p:first-of-type {
  font-size: clamp(1.15rem, 2.2vw, 1.375rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  text-wrap: pretty;
}

#about p + p {
  color: var(--muted);
  font-size: 1rem;
}

/* experience - the uptime timeline */

.timeline {
  list-style: none;
  margin: 0;
  position: relative;
  padding-left: 2.5rem;
  max-width: 56rem;
  display: grid;
  gap: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    var(--glow-teal),
    var(--glow-violet) 16%,
    var(--border-strong) 42%,
    var(--border) 90%,
    transparent
  );
}

.timeline > li {
  position: relative;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 1.75rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--dot);
  box-shadow:
    0 0 0 3px light-dark(rgb(70 212 194 / 0.22), rgb(70 212 194 / 0.18)),
    0 0 16px var(--glow-teal);
}

/* the current role's dot pulses slowly */
.timeline > li:first-child::after {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 1.75rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--dot);
  animation: dot-pulse 4.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes dot-pulse {
  0%       { transform: scale(0.5); opacity: 0.9; }
  70%, 100% { transform: scale(2.2); opacity: 0; }
}

/* glass cards */

.card {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(1.25rem, 3vw, 2rem);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 var(--glass-edge);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow:
      inset 0 1px 0 var(--glass-edge),
      0 18px 40px -20px var(--shadow);
  }
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.job-head h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.job-role {
  color: var(--muted);
  font-size: 0.9375rem;
}

.job-points {
  margin: 1.1rem 0 1.35rem;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.9375rem;
  max-width: 68ch;
}

.job-points li::marker {
  color: var(--teal);
}

/* skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2.5rem 3.5rem;
  max-width: 56rem;
}

.skill-group .eyebrow {
  margin-bottom: 0.85rem;
}

/* education */

.edu {
  list-style: none;
  padding: 0;
  max-width: 56rem;
}

.edu-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 2rem;
  padding-block: 1.15rem;
  border-top: 1px solid var(--border);
}

.edu-row:last-child {
  border-bottom: 1px solid var(--border);
}

.edu-what strong {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.edu-school {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

/* contact - a faint aurora echo */

#contact {
  position: relative;
  text-align: center;
}

#contact::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(46rem, 92vw);
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background:
    radial-gradient(50% 50% at 46% 52%, var(--glow-teal), transparent 70%),
    radial-gradient(40% 45% at 62% 40%, var(--glow-violet), transparent 72%);
  filter: blur(60px);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

.contact-lead {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  max-width: 24ch;
  margin: 0 auto 0.85rem;
}

.contact-note {
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 2.25rem;
  text-wrap: pretty;
}

.contact-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.875rem;
}

/* footer */

footer {
  margin-top: 2rem;
  padding: 2.75rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- 404 ---------- */

.error-page .lost {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem var(--gutter);
}

.lost-dot {
  position: relative;
  width: 0.875rem;
  height: 0.875rem;
  margin: 0 auto 2.25rem;
  border-radius: 50%;
  background: var(--dot);
  box-shadow:
    0 0 0 4px light-dark(rgb(70 212 194 / 0.22), rgb(70 212 194 / 0.18)),
    0 0 28px 6px var(--glow-teal);
}

.lost-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--dot);
  animation: dot-pulse 4.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.error-page .eyebrow {
  margin-bottom: 1rem;
}

.error-page h1 {
  font-size: clamp(1.9rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
  margin-bottom: 0.85rem;
}

.lost-note {
  color: var(--muted);
  margin-bottom: 2.25rem;
}

/* ---------- small screens ---------- */

@media (max-width: 30rem) {
  .theme-switch {
    gap: 0.7rem;
  }

  .timeline {
    padding-left: 1.75rem;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline > li::before,
  .timeline > li:first-child::after {
    left: -1.75rem;
    top: 1.55rem;
    width: 0.75rem;
    height: 0.75rem;
  }
}

/* ---------- reduced motion: everything static ---------- */

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .card:hover,
  .btn:hover {
    transform: none;
  }
}

/* ---------- print ---------- */

@page {
  margin: 1.4cm;
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #000;
  }

  .aurora,
  .theme-switch,
  .skip-link,
  #contact::before,
  .lost-dot {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 1rem 0 2rem;
  }

  main > section {
    padding-block: 1.5rem;
  }

  .card {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid #bbb;
    box-shadow: none;
    break-inside: avoid;
  }

  .timeline::before,
  .timeline > li::before,
  .timeline > li:first-child::after {
    display: none;
  }

  .timeline {
    padding-left: 0;
  }

  a {
    color: #000;
  }
}
