/* Change colors and fonts here. Everything else uses these variables. */
:root {
  color-scheme: dark;
  --bg: #080d1c;
  --card: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --ink: #eaf0ff;
  --muted: #9ba8c5;
  --accent: #5aa2ff;
  --accent-2: #a78bfa;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --width: 1040px;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
}

a {
  color: var(--accent);
}

a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0;
}

/* Fixed background: stays in place while the page scrolls */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bg span {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
  animation: drift 26s ease-in-out infinite alternate;
}

.bg span:nth-child(1) {
  background: #2f6db5;
  top: -15vmax;
  left: -10vmax;
}

.bg span:nth-child(2) {
  background: #6d4fd6;
  bottom: -18vmax;
  right: -12vmax;
  animation-duration: 32s;
}

.bg span:nth-child(3) {
  background: #0e7490;
  top: 35%;
  left: 40%;
  width: 28vmax;
  height: 28vmax;
  opacity: .28;
  animation-duration: 38s;
}

@keyframes drift {
  to {
    transform: translate(8vmax, 6vmax) scale(1.15);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  /* brand | centered nav | actions */
  padding: .85rem max(1.25rem, calc((100% - var(--width)) / 2));
  background: rgba(8, 13, 28, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.btn-hire {
  padding: .5rem 1.15rem;
  font-size: .95rem;
}

.brand {
  font: 700 1.15rem var(--font-head);
  color: var(--ink);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  white-space: nowrap;
  padding: .2rem 0;
  transition: color .2s;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
}

/* Shared width */
.hero,
section[id],
.site-footer {
  width: min(var(--width), 100% - 2.5rem);
  margin-inline: auto;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(2.5rem, 6vw, 6rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.25rem;
  padding: .35rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: .92rem;
}

.dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 .6rem rgba(52, 211, 153, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.hero h1 {
  font-size: clamp(2.0rem, 5.0vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  max-width: 17ch;
}

.lead {
  max-width: 54ch;
  margin: 1.4rem 0 2rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-photo {
  position: relative;
  margin: 0;
  justify-self: center;
  width: clamp(210px, 30vw, 330px);
  aspect-ratio: 1;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-2), #22d3ee, var(--accent));
  animation: spin 7s linear infinite;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: inherit;
  filter: blur(28px);
  opacity: .35;
  z-index: -1;
}

.hero-photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  border: 6px solid var(--bg);
  transition: transform .4s;
}

.hero-photo:hover img {
  transform: scale(1.04) rotate(-2deg);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px -10px rgba(90, 162, 255, .5);
}

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #08101f;
}

.btn-primary:hover {
  border-color: transparent;
  box-shadow: 0 12px 34px -8px rgba(167, 139, 250, .65);
}

/* Looping skill strips */
.marquees {
  display: grid;
  gap: .75rem;
  padding: 1rem 0 2rem;
}

.marquee {
  overflow: hidden;
  padding-top: 3px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.track {
  display: flex;
  width: max-content;
  animation: scroll 40s linear infinite;
}

.marquee.reverse .track {
  animation-direction: reverse;
}

.marquee:hover .track {
  animation-play-state: paused;
}

@keyframes scroll {
  to {
    transform: translateX(-50%);
  }
}

.track .chip {
  margin-right: .75rem;
  font-size: 1rem;
  padding: .5rem 1.2rem;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .6rem;
}

.chip {
  display: inline-block;
  white-space: nowrap;
  padding: .35rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: .95rem;
  transition: transform .2s, border-color .2s, background .2s;
}

.chip.small {
  padding: .15rem .7rem;
  font-size: .85rem;
  color: var(--muted);
}

.chip:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: rgba(90, 162, 255, .14);
}

/* Sections */
section[id] {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1rem 2.5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

section h2 {
  position: sticky;
  top: 88px;
  align-self: start;
  font-size: 1.25rem;
}

.body {
  max-width: 62ch;
}

.body.wide {
  max-width: none;
}

.body>p:first-child {
  margin-top: 0;
}

.skill-group+.skill-group {
  margin-top: 1.75rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--muted);
}

ul {
  margin: .5rem 0;
  padding-left: 1.2rem;
}

li+li {
  margin-top: .25rem;
}

/* Cards: projects and experience */
.project {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}

.project+.project {
  margin-top: 1.25rem;
}

.project:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px -16px rgba(90, 162, 255, .4);
}

.project h3 {
  font-size: 1.2rem;
}

.project p {
  margin: .4rem 0;
}

/* Live project cards: preview on top, details below */
#live-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.live-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}

.live-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px -16px rgba(90, 162, 255, .4);
}

.preview {
  position: relative;
  display: block;
  border-bottom: 1px solid var(--line);
}

/* 16:10 box; the iframe inside is 1280x800 and scaled down by main.js */
.frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
}

.frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.frame .shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.frame.is-missing .shot {
  display: none;
}

.frame.is-missing::after {
  content: "Preview coming soon";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .95rem;
}

.open-hint {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(8, 13, 28, .85);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 600;
  transition: border-color .2s, background .2s;
}

.preview:hover .open-hint,
.preview:focus-visible .open-hint {
  border-color: var(--accent);
  background: rgba(90, 162, 255, .25);
}

.live-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .5rem;
  padding: 1.25rem 1.4rem 1.4rem;
}

.live-info h3 {
  font-size: 1.2rem;
}

.live-info p {
  margin: 0;
}

.live-info .chips {
  margin-top: 0;
}

.live-info .actions {
  margin-top: auto;
  padding-top: .5rem;
}

code {
  padding: .1rem .45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  font-size: .9em;
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  align-items: baseline;
}

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

.text-link {
  font-weight: 600;
  margin-right: 1rem;
}

#contact-body {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 2rem;
  max-width: none;
}

.contact-info > p:first-child {
  margin-top: 0;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  margin: .5rem 0;
}

.contact-list a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.contact-list a:hover {
  border-color: var(--accent);
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.contact-form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.field {
  display: grid;
  gap: .35rem;
}

.field label {
  font-size: .95rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.field input::placeholder {
  color: var(--muted);
  opacity: .7;
}

.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90, 162, 255, .25);
}

.field select option {
  background: #0c1226;
  color: var(--ink);
}

.contact-form .btn {
  justify-self: start;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.contact-form .btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  font-size: .95rem;
}

.form-status.success {
  color: #34d399;
}

.form-status.error {
  color: #f87171;
}

.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .95rem;
}

@media (max-width: 860px) {
  nav {
    gap: 1.1rem;
  }

  .brand {
    font-size: 1.05rem;
  }
}

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: border-color .2s;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: top .3s ease, transform .3s ease, opacity .2s ease;
}

.nav-toggle span:nth-child(1) {
  top: 14px;
}

.nav-toggle span:nth-child(2) {
  top: 21px;
}

.nav-toggle span:nth-child(3) {
  top: 28px;
}

.is-open .nav-toggle span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.is-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.is-open .nav-toggle span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

@media (max-width: 700px) {
  #contact-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .site-header {
    display: flex;
    justify-content: space-between;
  }

  .btn-hire {
    display: none;
  }

  /* "Hire me" is desktop-only */
  /* Dropdown panel: floats over the page, so the header and hero never change height */
  nav {
    position: absolute;
    top: calc(100% + .5rem);
    left: 1.25rem;
    right: 1.25rem;
    flex-direction: column;
    gap: 0;
    max-width: none;
    overflow: visible;
    padding: .35rem 1rem;
    background: rgba(12, 18, 38, .97);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(.98);
    transform-origin: top right;
    transition: opacity .25s ease, transform .3s ease, visibility 0s linear .3s;
  }

  .is-open nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
  }

  nav a {
    padding: .85rem .25rem;
    font-size: 1.05rem;
    border-top: 1px solid var(--line);
  }

  nav a:first-child {
    border-top: 0;
  }

  nav a::after {
    display: none;
  }

  nav a:hover {
    color: var(--accent);
  }
}

/* Responsive */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-photo {
    order: -1;
    justify-self: start;
    width: clamp(150px, 42vw, 220px);
  }

  section[id] {
    grid-template-columns: 1fr;
    padding: 2.25rem 0;
  }

  section h2 {
    position: static;
  }
}

@media (max-width: 480px) {
  .btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .project {
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {

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

  .marquee {
    overflow-x: auto;
  }
}