:root {
  --bg-light: #efe8f8;
  --bg-dark: #161126;
  --panel-light: #f7f2fc;
  --panel-dark: #251a3b;
  --heading-light: #2a1b3f;
  --heading-dark: #f1e9ff;
  --text-light: #4a3863;
  --text-dark: #c8bddc;
  --accent: #643294;
  --accent-bright: #9bcd6b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  scroll-behavior: smooth;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: 0.45rem;
  background: var(--accent-bright);
  color: #10151d;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

#main-content:focus {
  outline: none;
}

body {
  background: var(--bg-light);
  color: var(--text-light);
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(52px);
  opacity: 0.44;
  will-change: transform;
}

body::before {
  width: 30rem;
  height: 30rem;
  top: 7rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(155, 205, 107, 0.24) 0%, rgba(155, 205, 107, 0) 68%);
  animation: site-ambient-drift-a 18s ease-in-out infinite alternate;
}

body::after {
  width: 34rem;
  height: 34rem;
  right: -11rem;
  bottom: 5rem;
  background: radial-gradient(circle, rgba(100, 50, 148, 0.20) 0%, rgba(100, 50, 148, 0) 70%);
  animation: site-ambient-drift-b 24s ease-in-out infinite alternate;
}

html.dark body {
  background: var(--bg-dark);
  color: var(--text-dark);
}

html.dark body::before {
  background: radial-gradient(circle, rgba(155, 205, 107, 0.16) 0%, rgba(155, 205, 107, 0) 68%);
}

html.dark body::after {
  background: radial-gradient(circle, rgba(146, 91, 204, 0.24) 0%, rgba(146, 91, 204, 0) 70%);
}

@keyframes site-ambient-drift-a {
  from {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  to {
    transform: translate3d(5rem, -3.5rem, 0) scale(1.14) rotate(4deg);
  }
}

@keyframes site-ambient-drift-b {
  from {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  to {
    transform: translate3d(-4.5rem, 3rem, 0) scale(1.12) rotate(-3deg);
  }
}

main,
.top-nav,
.site-footer {
  position: relative;
  z-index: 2;
}

.section-wrap,
.nav-inner,
.landing,
.about {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.top-nav {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background:
    linear-gradient(
      180deg,
      rgba(239, 232, 248, 0.78) 0%,
      rgba(239, 232, 248, 0.64) 54%,
      rgba(239, 232, 248, 0.28) 82%,
      rgba(239, 232, 248, 0.04) 100%
    );
  padding: 1rem 0;
  z-index: 10;
  isolation: isolate;
}

html.dark .top-nav {
  background:
    linear-gradient(
      180deg,
      rgba(22, 17, 38, 0.82) 0%,
      rgba(22, 17, 38, 0.68) 54%,
      rgba(22, 17, 38, 0.30) 82%,
      rgba(22, 17, 38, 0.06) 100%
    );
}

.top-nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 22px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(239, 232, 248, 0.10) 0%, rgba(239, 232, 248, 0) 100%);
}

html.dark .top-nav::after {
  background: linear-gradient(180deg, rgba(22, 17, 38, 0.14) 0%, rgba(22, 17, 38, 0) 100%);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
  transition: transform 180ms ease, box-shadow 220ms ease, filter 220ms ease;
}

html.dark .logo-avatar {
  border-color: #000;
}

.logo-shape {
  width: 48px;
  height: 48px;
  border: 3px solid var(--heading-light);
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
}

html.dark .logo-shape {
  border-color: var(--accent-bright);
}

.desktop-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.desktop-nav a,
.mobile-nav a {
  color: inherit;
  text-decoration: none;
  border-radius: 0.6rem;
  padding: 0.35rem 0.9rem;
  transition:
    transform 180ms ease,
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible,
.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  transform: translateY(-1px);
  background: var(--accent);
  color: #fff;
}

html.dark .desktop-nav a:hover,
html.dark .desktop-nav a:focus-visible,
html.dark .mobile-nav a:hover,
html.dark .mobile-nav a:focus-visible {
  background: #7a47ad;
  color: #fff;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.menu-button {
  display: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 0.45rem;
  padding: 0.35rem 0.65rem;
  transition:
    transform 180ms ease,
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.mobile-nav {
  display: none;
  width: min(1120px, 92%);
  margin: 0.8rem auto 0;
  background: rgba(42, 27, 63, 0.92);
  border-radius: 0.7rem;
  padding: 0.4rem;
}

.mobile-nav a {
  color: #fff;
}

.landing {
  min-height: 92vh;
  display: grid;
  place-items: center;
  padding: 3rem 0 2rem;
}

.terminal-card {
  width: min(900px, 100%);
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(100, 50, 148, 0.5);
  box-shadow: 0 24px 40px rgba(12, 7, 24, 0.35), 0 0 0 1px rgba(155, 205, 107, 0.12) inset;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.centred-card {
  margin-left: auto;
  margin-right: auto;
}

.terminal-head {
  background:
    linear-gradient(90deg, rgba(155, 205, 107, 0.22), transparent 42%),
    linear-gradient(180deg, #312047, #241637);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(155, 205, 107, 0.2);
}

html.dark .terminal-head {
  background:
    linear-gradient(90deg, rgba(155, 205, 107, 0.18), transparent 42%),
    linear-gradient(180deg, #221631, #140f24);
}

.hud-left {
  display: flex;
  align-items: center;
}

.hud-id {
  font-family: 'Cutive Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: #c6e69f;
  text-transform: uppercase;
}

.hud-right {
  display: flex;
  gap: 0.5rem;
}

.hud-pill {
  font-family: 'Cutive Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #d8efbf;
  border: 1px solid rgba(155, 205, 107, 0.38);
  border-radius: 0.3rem;
  padding: 0.16rem 0.4rem;
  background: rgba(155, 205, 107, 0.08);
}

.terminal-body {
  background:
    linear-gradient(180deg, rgba(155, 205, 107, 0.06), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 4px
    ),
    var(--panel-light);
  color: var(--heading-light);
  text-align: center;
  padding: 4.5rem 1.2rem;
}

html.dark .terminal-body {
  background:
    linear-gradient(180deg, rgba(155, 205, 107, 0.07), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 0 1px,
      transparent 1px 4px
    ),
    #1b132b;
  color: var(--heading-dark);
}

.kicker {
  font-family: 'Cutive Mono', monospace;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

html.dark .kicker {
  color: var(--accent-bright);
}

.terminal-body h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  font-weight: 700;
}

.subtitle {
  margin: 1.3rem 0 2rem;
  font-size: clamp(1rem, 3vw, 1.6rem);
  letter-spacing: 0.01em;
}

.cta {
  display: inline-block;
  background: linear-gradient(180deg, #7b43b3, #5f2f93);
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(155, 205, 107, 0.35);
  border-radius: 0.35rem;
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #8f54cb, #7040a8);
  box-shadow: 0 10px 24px rgba(100, 50, 148, 0.18);
}

@media (max-width: 700px) {
  .hud-id {
    font-size: 0.7rem;
  }

  .hud-pill {
    font-size: 0.62rem;
    padding: 0.14rem 0.3rem;
  }

  .hud-right {
    display: none;
  }
}

.panel {
  background: var(--panel-light);
  border-radius: 1.3rem;
  padding: 3rem;
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

html.dark .panel {
  background: #3a2458;
  color: #fff;
}

.about {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.about h2,
.section-wrap h2 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--heading-light);
}

html.dark .about h2,
html.dark .section-wrap h2 {
  color: #fff;
}

.about p {
  font-size: 1.15rem;
  line-height: 1.6;
}

.about img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  justify-self: center;
}

.section-wrap {
  padding: 5rem 0 1rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.skill-pill {
  background: #ede3f7;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  min-height: 92px;
  transition: transform 180ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

html.dark .skill-pill {
  background: #2d2043;
}

.skill-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(100, 50, 148, 0.08);
}

html.dark .skill-pill:hover {
  box-shadow: 0 14px 24px rgba(8, 5, 18, 0.22);
}

.section-intro {
  margin-top: -0.5rem;
  font-size: 1.1rem;
}

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

.project-hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
}

.project-card {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--panel-light);
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

html.dark .project-card {
  background: #30204a;
}

.project-media {
  position: relative;
  height: 190px;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(100, 50, 148, 0.78), rgba(155, 205, 107, 0.58)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 60%);
}

.project-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 17, 38, 0.42), rgba(22, 17, 38, 0.05));
  pointer-events: none;
}

.project-media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  filter: saturate(0.98);
  transform: scale(1);
  transition: filter 0.25s ease, transform 0.25s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(155, 205, 107, 0.55);
  box-shadow: 0 20px 36px rgba(72, 37, 112, 0.16);
}

html.dark .project-card:hover,
html.dark .project-card:focus-within {
  border-color: rgba(155, 205, 107, 0.42);
  box-shadow: 0 22px 38px rgba(10, 4, 22, 0.34);
}

.project-card:hover .project-media img,
.project-card:focus-within .project-media img {
  filter: saturate(1.08);
  transform: scale(1.02);
}

.project-content {
  padding: 1rem 1.1rem 1.3rem;
}

.tags {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-content h3 {
  margin: 0.5rem 0;
  font-size: 1.7rem;
  color: var(--heading-light);
}

html.dark .project-content h3 {
  color: #fff;
}

.project-content a {
  color: var(--accent);
  font-weight: 700;
}

html.dark .section-intro a,
html.dark .project-content a {
  color: var(--accent-bright);
}

.logo:hover .logo-avatar,
.logo:focus-visible .logo-avatar {
  transform: scale(1.03);
  box-shadow: 0 0 0 4px rgba(155, 205, 107, 0.18);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 3px;
}

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

  body::before,
  body::after,
  .logo-avatar,
  .desktop-nav a,
  .mobile-nav a,
  .menu-button,
  .terminal-card,
  .cta,
  .panel,
  .skill-pill,
  .project-card,
  .project-media img {
    transition: none;
  }

  body::before,
  body::after {
    animation: none;
  }
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.contact-copy .section-intro {
  margin-top: 0.4rem;
  max-width: 32rem;
}

.contact-form {
  padding: 1.2rem;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--heading-light);
}

html.dark .contact-field {
  color: #fff;
}

.contact-field span {
  font-size: 0.92rem;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid rgba(100, 50, 148, 0.28);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.75);
  color: var(--heading-light);
  font: inherit;
  padding: 0.85rem 0.95rem;
}

html.dark .contact-field input,
html.dark .contact-field textarea {
  background: rgba(17, 12, 29, 0.92);
  border-color: rgba(155, 205, 107, 0.18);
  color: #fff;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: 3px solid var(--accent-bright);
  outline-offset: 3px;
}

.contact-field textarea {
  resize: vertical;
  min-height: 9rem;
}

.contact-honeypot {
  display: none;
}

.contact-submit {
  border: 0;
  cursor: pointer;
}

.site-footer {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 1rem 0 3rem;
  font-size: 0.95rem;
}

.site-footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.brand {
  font-weight: 800;
  color: var(--heading-light);
}

html.dark .brand {
  color: #fff;
}

.site-footer .dot {
  color: var(--accent);
}

.footer-hidden-link {
  color: inherit;
  font-family: 'Cutive Mono', monospace;
  font-size: 0.78rem;
  opacity: 0.78;
  text-decoration: none;
  transition: opacity 180ms ease, color 180ms ease;
}

.footer-hidden-link:hover,
.footer-hidden-link:focus-visible {
  color: var(--accent);
  opacity: 1;
}

html.dark .footer-hidden-link:hover,
html.dark .footer-hidden-link:focus-visible {
  color: var(--accent-bright);
}

.dot-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.16;
  background: var(--accent);
  animation: drift linear infinite;
}

html.dark .dot {
  background: var(--accent-bright);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(120px, -220px, 0);
  }
}

@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: inline-block;
  }

  .mobile-nav.open {
    display: grid;
  }

  .about {
    grid-template-columns: 1fr;
    padding: 2rem;
  }

  .contact {
    flex-direction: column;
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .contact-form-grid {
    grid-template-columns: 1fr;
  }
}
