:root {
  --bg: #050714;
  --fg: #f6f6f1;
  --muted: rgba(246, 246, 241, 0.7);
  --accent: #7aa8ff;
  --accent-strong: #8ef2ff;
  --card: rgba(8, 14, 30, 0.68);
  --border: rgba(177, 214, 255, 0.14);
  --body-font: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono-font: "IBM Plex Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--fg);
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.6;
  padding: 0 5vw 8rem;
  position: relative;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body::selection {
  background: var(--accent-strong);
  color: #10131b;
}

.background-gradient,
.background-glow,
.texture {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.background-gradient {
  background: radial-gradient(circle at var(--pointer-x, 60%) var(--pointer-y, 20%), rgba(106, 91, 255, 0.5), transparent 42%),
    radial-gradient(circle at 18% 78%, rgba(48, 107, 255, 0.3), transparent 48%),
    radial-gradient(circle at 82% 62%, rgba(77, 237, 255, 0.3), transparent 52%),
    linear-gradient(140deg, #02030b, #091120 48%, #12072a 100%);
  mix-blend-mode: screen;
}

.background-glow {
  z-index: -3;
  background: radial-gradient(circle at 30% 18%, rgba(172, 97, 255, 0.2), transparent 58%),
    radial-gradient(circle at 82% 10%, rgba(69, 147, 255, 0.28), transparent 68%),
    radial-gradient(circle at 52% 82%, rgba(69, 231, 255, 0.18), transparent 58%);
  filter: blur(72px);
}

.texture {
  z-index: -1;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"%3E%3Crect fill="none" width="160" height="160"/%3E%3Cg fill="%23ffffff" fill-opacity="0.015"%3E%3Cpath d="M0 0h1v160H0z"/%3E%3Cpath d="M0 0h160v1H0z"/%3E%3C/g%3E%3C/svg%3E');
  opacity: 0.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(18px);
  background: rgba(4, 8, 20, 0.62);
  z-index: 10;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.2rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a,
.resume {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.resume:hover {
  color: var(--fg);
}

.resume {
  font-family: var(--mono-font);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero {
  padding: 6rem 0 4rem;
  max-width: 1200px;
  display: flex;
  gap: 4rem;
  align-items: center;
}

.hero-copy {
  flex: 1 1 60%;
}

.hero h1 {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.1;
  margin: 0.5rem 0 1rem;
}

.headline-primary,
.headline-secondary {
  display: block;
}

.headline-primary {
  color: #b5b9ff;
}

.hero p {
  color: var(--muted);
  margin-bottom: 2rem;
}

.eyebrow {
  font-family: var(--mono-font);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--fg);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(120deg, #7b6dff, #63d8ff);
  border-color: transparent;
  color: #04101d;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hero-media {
  flex: 0 0 260px;
  border-radius: 32px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(10, 18, 36, 0.82);
  box-shadow: 0 20px 60px rgba(1, 7, 22, 0.48);
  position: relative;
  overflow: hidden;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(103, 131, 255, 0.35), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  filter: saturate(0.9) contrast(1.05);
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 2rem;
  background: var(--card);
  backdrop-filter: blur(30px);
}

.panel-heading {
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.panel-content {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.about-intro {
  align-items: flex-start;
}

.about-copy {
  flex: 2 1 360px;
  min-width: 280px;
}

.panel h2 {
  margin-top: 0;
  font-size: 2rem;
}

.panel p {
  color: var(--muted);
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pill-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
}

.project-roll {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.project-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.project-row:last-child {
  border-bottom: none;
}

.project-row-meta {
  flex: 0 0 160px;
}

.project-label,
.project-sub {
  display: block;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.project-label {
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.project-sub {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
}

.project-row-body {
  flex: 1 1 320px;
  min-width: 250px;
}

.project-row-body h3 {
  margin: 0 0 0.35rem;
}

.project-row-actions {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-end;
}


.project-row-actions.single {
  flex: 0 0 220px;
  width: 220px;
  align-items: stretch;
}

.project-row-actions.single .project-row-cta {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  padding: 1.8rem 1.4rem;
}

.project-row-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.project-row-cta:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.project-row-cta.secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.contact {
  align-items: center;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-footer {
  margin: 4rem 0 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-switch {
  position: fixed;
  right: 0.9rem;
  bottom: 0.9rem;
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  z-index: 40;
  cursor: default;
}

.admin-modal[hidden],
.admin-toolbar[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(3, 8, 20, 0.72);
  backdrop-filter: blur(24px);
}

.admin-card {
  width: min(100%, 420px);
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(8, 14, 30, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.admin-card h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.6rem;
}

.admin-card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.admin-label {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.admin-field span {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font: inherit;
}

.admin-field input:focus {
  outline: 2px solid rgba(99, 216, 255, 0.45);
  outline-offset: 2px;
}

.admin-error {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: #ff9bc8;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1rem;
}

.admin-toolbar {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(6, 12, 28, 0.88);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 45px rgba(1, 7, 22, 0.42);
}

.admin-toolbar .btn {
  padding: 0.7rem 1.2rem;
}

.admin-toolbar-label {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.admin-status {
  min-width: 7.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-status[data-tone='error'] {
  color: #ff9bc8;
}

body.is-admin-editing [data-edit-key] {
  outline: 1px dashed rgba(142, 242, 255, 0.45);
  outline-offset: 6px;
  background: rgba(99, 216, 255, 0.06);
}

body.is-admin-editing a[data-edit-key],
body.is-admin-editing button[data-edit-key] {
  cursor: text;
}

body.is-admin-editing [data-edit-key]:focus {
  outline: 2px solid rgba(123, 109, 255, 0.8);
  background: rgba(123, 109, 255, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.985);
  filter: blur(10px);
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.8s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.project-row.reveal {
  transform: translateY(26px);
}

.project-row.reveal.is-visible {
  transform: translateY(0);
}

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

  .reveal,
  .reveal.is-visible,
  .project-row.reveal,
  .project-row.reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0 1.5rem 5rem;
  }

  .site-header {
    flex-direction: column;
    gap: 1rem;
    position: static;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .panel {
    padding: 1.5rem;
  }

  .hero {
    flex-direction: column;
    gap: 2rem;
  }

  .hero-media {
    width: 100%;
    max-width: 320px;
  }

  .project-row {
    flex-direction: column;
  }

  .project-row-meta {
    width: 100%;
  }

  .project-row-actions {
    width: 100%;
    margin-left: 0;
    align-items: stretch;
  }

  .project-row-cta {
    width: 100%;
  }

  .project-row-actions.single {
    width: 100%;
  }

  .project-row-actions.single .project-row-cta {
    aspect-ratio: auto;
  }
}
