html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background-color: var(--safari-tint);
}

html {
  color-scheme: light;
}

body {
  min-height: 100%;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--safari-tint);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

:root {
  --safari-tint-light: #fcfbf8;
  --safari-tint-dark: #000000;
  --safari-tint-space: #000000;
  --safari-tint: var(--safari-tint-light);
  --bg: #fcfbf8;
  --bg-deep: #fcfbf8;
  --ink: #000000;
  --muted: #3f3a34;
  --accent: #1b4d6b;
  --accent-soft: #c7d7e2;
  --card: #ffffffcc;
  --shadow: 0 12px 40px rgba(28, 26, 24, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

body.theme-dark,
html.theme-dark {
  --safari-tint: var(--safari-tint-dark);
  --bg: #000000;
  --bg-deep: #000000;
  --ink: #ffffff;
  --muted: #cfcfcf;
  --accent: #6ea6c7;
  --accent-soft: rgba(110, 166, 199, 0.25);
  --card: rgba(20, 24, 32, 0.75);
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  background: #000000;
  color-scheme: dark;
}

body.theme-light,
html.theme-light {
  --safari-tint: var(--safari-tint-light);
  --bg: #fcfbf8;
  --bg-deep: #fcfbf8;
  --ink: #000000;
  --muted: #3f3a34;
  --accent: #1b4d6b;
  --accent-soft: #c7d7e2;
  --card: #ffffffcc;
  --shadow: 0 12px 40px rgba(28, 26, 24, 0.12);
  background: #fcfbf8;
  color-scheme: light;
}

body.theme-space,
html.theme-space {
  --safari-tint: var(--safari-tint-space);
}













h1, h2, h3 {
  font-family: inherit;
  font-weight: 700;
  margin: 0 0 12px;
}

h1 {
  font-weight: 600;
  letter-spacing: 0;
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3 {
  color: #f5f7ff;
}

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

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 7vw 12px;
  position: relative;
  z-index: 10;
  flex-wrap: nowrap;
  overflow: visible;
  background-color: var(--safari-tint);
}

.logo {
  justify-self: start;
}

.theme-toggle {
  border: 1px solid #d7cdc1;
  background: #ffffff;
  color: var(--muted);
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: 40px;
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.theme-menu {
  position: relative;
  overflow: visible;
  justify-self: end;
}

.theme-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: min(320px, calc(100vw - 24px));
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
  font-size: 1rem;
}

.theme-menu.is-open .theme-panel {
  display: grid;
  gap: 14px;
}

.panel-section {
  display: grid;
  gap: 10px;
}

.panel-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}

.panel-subtitle {
  font-weight: 600;
  color: var(--muted);
}

.panel-help {
  font-size: 0.95rem;
  color: var(--muted);
  display: none;
}

.panel-help.is-visible {
  display: block;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  padding: 4px;
  gap: 4px;
  overflow: hidden;
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  min-width: 0;
  white-space: nowrap;
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.segment.is-selected {
  background: #e1ebd5;
  color: #2c3a1f;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.fun-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
}

.fun-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  background: transparent;
}

.fun-row.is-on .fun-check {
  background: #5f8cff;
  border-color: #5f8cff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.theme-dark .theme-panel {
  background: #11161f;
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-dark .panel-title,
.theme-dark .panel-subtitle,
.theme-dark .panel-help {
  color: rgba(233, 238, 248, 0.9);
}

.theme-dark .segmented {
  border-color: rgba(255, 255, 255, 0.12);
  background: #0f141d;
}

.theme-dark .segment {
  color: rgba(233, 238, 248, 0.78);
}

.theme-dark .segment.is-selected {
  background: rgba(110, 166, 199, 0.35);
  color: #f5f7ff;
}

.theme-dark .fun-row {
  background: #161c27;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.theme-dark .fun-check {
  border-color: rgba(255, 255, 255, 0.35);
}

.theme-dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.25);
  background: #161c27;
  color: var(--ink);
}

.hero,
.section,
.resume,
.site-footer {
  position: relative;
  z-index: 2;
}

.theme-space .logo-mark {
  background: #e6e7ff;
  color: #0a0d16;
}

.theme-space .nav-link.is-active,
.theme-space .nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e6e7ff;
}

.theme-space .cta,
.theme-space .button {
  background: #5f8cff;
  color: #0a0d16;
  box-shadow: 0 10px 30px rgba(95, 140, 255, 0.35);
}

.theme-space .ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e6e7ff;
  background: rgba(10, 13, 22, 0.65);
}

.theme-space .hero-card,
.theme-space .project-grid article {
  background: rgba(10, 13, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-space .pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(27, 77, 107, 0.12);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: default;
}

.theme-space .site-footer,
.theme-space .subtitle,
.theme-space .resume-summary {
  color: rgba(230, 231, 255, 0.75);
}

.theme-space .bg-orb {
  opacity: 0.1;
}

.theme-dark .bg-orb {
  opacity: 0.06;
}

.space-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 0;
}

.space-scene,
.space-cats,
.storm-clouds,
.storm-rain,
.snowfall,
.snowbank {
  max-width: 100vw;
  overflow: hidden;
}

.theme-space .space-scene {
  opacity: 1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(122, 94, 255, 0.35) 0%, rgba(122, 94, 255, 0) 45%),
    radial-gradient(circle at 80% 20%, rgba(83, 214, 255, 0.25) 0%, rgba(83, 214, 255, 0) 40%),
    radial-gradient(circle at 60% 75%, rgba(255, 120, 214, 0.25) 0%, rgba(255, 120, 214, 0) 45%);
  background-repeat: no-repeat;
}

.space-scene[data-active="true"] {
  opacity: 1;
}

.space-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(220, 252, 255, 1) 0 10.5px, transparent 15px),
    radial-gradient(circle at 40% 80%, rgba(220, 252, 255, 0.95) 0 9px, transparent 13.5px),
    radial-gradient(circle at 75% 30%, rgba(220, 252, 255, 1) 0 10.5px, transparent 15px),
    radial-gradient(circle at 85% 70%, rgba(220, 252, 255, 0.9) 0 9px, transparent 13.5px),
    radial-gradient(circle at 55% 55%, rgba(220, 252, 255, 0.85) 0 7.5px, transparent 12px),
    radial-gradient(circle at 20% 65%, rgba(220, 252, 255, 0.85) 0 7.5px, transparent 12px);
  filter: drop-shadow(0 0 20px rgba(220, 252, 255, 0.95));
  opacity: 1;
}

.space-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
}

.theme-space .space-scene::before {
  animation: twinkle 3.6s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.space-cats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 1;
  overflow: hidden;
  display: block;
  visibility: hidden;
}

.theme-space .space-cats {
  opacity: 1;
  display: block;
  visibility: visible;
}

.space-cats[data-active="true"],
.storm-clouds[data-active="true"],
.storm-rain[data-active="true"],
.snowfall[data-active="true"],
.snowbank[data-active="true"] {
  opacity: 1;
  display: block;
  visibility: visible;
}

.space-cats span {
  position: absolute;
  left: var(--start-x, -120px);
  top: var(--start-y, 220px);
  font-size: 48px;
  animation: catFloat var(--cat-duration, 18s) linear infinite;
  animation-fill-mode: both;
  filter: drop-shadow(0 0 6px rgba(220, 252, 255, 0.6));
}

@keyframes catFloat {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--cat-rot-start, -8deg));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--cat-dx, 115vw), var(--cat-dy, -30px), 0) rotate(var(--cat-rot-end, 8deg));
    opacity: 0;
  }
}

.storm-clouds {
  display: none !important;
}

.theme-storm .storm-clouds {
  display: none !important;
}

.theme-snow .storm-clouds {
  display: none !important;
}

.storm-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 1;
  overflow: hidden;
  display: block;
  visibility: hidden;
}

.theme-storm .storm-rain {
  opacity: 1;
  display: block;
  visibility: visible;
}

.storm-rain span {
  position: absolute;
  top: -10vh;
  font-size: 22px;
  animation: rainFall linear infinite;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

.theme-storm::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  animation: lightningFlash 7s infinite;
}

@keyframes cloudsRoll {
  0% {
    transform: translateY(-25vh);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes rainFall {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(120vh);
    opacity: 0;
  }
}

@keyframes lightningFlash {
  0%,
  90%,
  100% {
    opacity: 0;
  }
  92% {
    opacity: 0.5;
  }
  94% {
    opacity: 0.2;
  }
  96% {
    opacity: 0.65;
  }
  97% {
    opacity: 0.1;
  }
}

.snowfall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 1;
  overflow: hidden;
  display: block;
  visibility: hidden;
}

.theme-snow .snowfall {
  opacity: 1;
  display: block;
  visibility: visible;
}

.snowfall span {
  position: absolute;
  top: -10vh;
  font-size: 20px;
  animation: snowFall linear infinite;
}

.snowbank {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -40px;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  filter: blur(0.3px);
}

.theme-snow .snowbank {
  opacity: 0;
}

@keyframes snowFall {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(120vh) translateX(20px);
    opacity: 0;
  }
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.theme-dark .logo-mark {
  background: #f5f7ff;
  color: #0a0d13;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
 
.site-nav {
  justify-self: center;
}

.nav-link {
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  height: 40px;
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7cdc1;
  background: #ffffff;
  font-weight: 600;
}

.nav-link.is-active,
.nav-link:hover {
  background: #ffffff;
  color: var(--ink);
  border-color: #8c7f72;
  box-shadow: inset 0 0 0 1px rgba(140, 127, 114, 0.45);
}

.theme-dark .nav-link {
  border-color: rgba(255, 255, 255, 0.28);
  background: #161c27;
  color: #e9eef8;
}

.theme-dark .nav-link.is-active,
.theme-dark .nav-link:hover {
  background: #2b3548;
  color: #ffffff;
  border-color: #8fb2d8;
  box-shadow: inset 0 0 0 1px rgba(143, 178, 216, 0.45);
}

.cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.theme-dark .cta {
  background: #9cc2ff;
  color: #0a0d13;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  padding: 40px 7vw 60px;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.hero-copy {
  animation: fadeUp 700ms ease both;
  padding-top: 30px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.theme-dark .subtitle,
.theme-dark .resume-summary,
.theme-dark .role-meta,
.theme-dark .facts,
.theme-dark .site-footer {
  color: rgba(233, 238, 248, 0.78);
}

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

.button {
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.theme-dark .button {
  background: #9cc2ff;
  color: #0a0d13;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.ghost {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #d7cdc1;
  color: var(--muted);
  background: #ffffffaa;
}

.theme-dark .ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef2fb;
  background: rgba(15, 18, 26, 0.85);
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: fadeUp 900ms ease both;
  animation-delay: 120ms;
}

.card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 16px;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.section {
  padding: 20px 7vw 60px;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.container * {
  max-width: 100%;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1f3643;
  font-size: 0.9rem;
}

.theme-dark .pill {
  background: rgba(80, 120, 180, 0.28);
  color: #f0f4ff;
}

.site-footer {
  display: flex;
  margin-top: auto;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px 7vw 8px;
  color: var(--muted);
}

.footer-links:empty {
  display: none;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-button {
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7cdc1;
  background: #ffffffaa;
  color: var(--muted);
  font-weight: 600;
}

.theme-dark .footer-button {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(20, 24, 32, 0.6);
  color: var(--ink);
}

.egg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.egg-button {
  border: 1px solid #d7cdc1;
  background: #ffffffaa;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-dark .egg-button {
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef2fb;
  background: rgba(15, 18, 26, 0.85);
}

.resume {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 7vw 0;
}

.resume-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid #e2d7c8;
}

.resume-summary {
  padding: 24px 0 6px;
  color: var(--muted);
  line-height: 1.7;
}

.resume-summary p {
  margin: 0 0 12px;
}

.resume-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  padding: 32px 0;
}

.resume-section h2 {
  margin-top: 0;
}

.skill-groups {
  display: grid;
  gap: 20px;
}

.skill-group h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.role {
  margin-bottom: 24px;
}

.role-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.role ul,
.resume-section ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.project-grid article {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.bg-orb {
  display: none;
}

.bg-orb-1 {
  background: radial-gradient(circle, #f7d9b6 0%, rgba(247, 217, 182, 0) 70%);
  top: -120px;
  left: -80px;
}

.bg-orb-2 {
  background: radial-gradient(circle, #cfe3d1 0%, rgba(207, 227, 209, 0) 70%);
  bottom: -140px;
  right: -60px;
  animation-delay: 4s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo options"
      "nav nav";
    align-items: center;
    gap: 8px;
    padding: 12px 4vw 8px;
  }

  .logo {
    grid-area: logo;
  }

  .theme-menu {
    grid-area: options;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .site-nav {
    grid-area: nav;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-link {
    padding: 0 10px;
    font-size: 0.78rem;
    height: 34px;
    min-width: 0;
    width: 100%;
  }

  .theme-toggle {
    padding: 0 10px;
    font-size: 0.78rem;
    height: 34px;
    min-width: 0;
    width: auto;
  }

  .theme-panel {
    right: 0;
    min-width: min(300px, calc(100vw - 20px));
    width: min(320px, calc(100vw - 20px));
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 30px 5vw 40px;
  }

  .section {
    padding: 16px 5vw 40px;
  }

  .section h2,
  .section .pill-row {
    max-width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .nav-link {
    padding: 4px 6px;
    font-size: 0.72rem;
    min-width: 82px;
  }
  .theme-toggle {
    padding: 4px 6px;
    font-size: 0.7rem;
    min-width: 82px;
  }
}
