:root {
  --bg: #0b0d10;
  --bg-elevated: #12161c;
  --bg-soft: #171c24;
  --ink: #f3eee6;
  --muted: #9aa3b2;
  --line: rgba(243, 238, 230, 0.1);
  --accent: #e8a35c;
  --accent-2: #5ec4b0;
  --accent-deep: #c4782f;
  --radius: 18px;
  --max: 1120px;
  --header-h: 72px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Sora", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

code {
  font-size: 0.85em;
  color: var(--accent);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(11, 13, 16, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.nav-cta {
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 6px;
  flex-direction: column;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  padding: calc(var(--header-h) + 3rem) 0 4.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 15% 20%, rgba(232, 163, 92, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(94, 196, 176, 0.12), transparent 50%),
    linear-gradient(180deg, #0b0d10 0%, #10151c 45%, #0b0d10 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  left: -8%;
  top: 8%;
  background: rgba(232, 163, 92, 0.22);
}

.orb-b {
  width: 36vw;
  height: 36vw;
  max-width: 420px;
  max-height: 420px;
  right: -6%;
  top: 18%;
  background: rgba(94, 196, 176, 0.16);
  animation-delay: -4s;
}

.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(243, 238, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 238, 230, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, black, transparent 75%);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.brand {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  max-width: 100%;
  background: linear-gradient(120deg, #fff8ef 20%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}

.hero h1 {
  margin: 0 0 1.25rem;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lede {
  margin: 0 0 2rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a1208;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(232, 163, 92, 0.5);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-meta li {
  position: relative;
}

.hero-meta li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.85rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  opacity: 0.7;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s ease forwards;
}

.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.48s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head h2,
.contact-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-sub {
  margin: 1rem 0 0;
  color: var(--muted);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-lead {
  margin: 0;
  font-size: 1.15rem;
  color: #d7d0c5;
}

.about-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.about-points li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--muted);
}

.about-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* Experience */
.experience {
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
}

.experience-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

.experience h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.role,
.dates {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.bullets {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.65rem;
}

.bullets a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Projects */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.filter {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter:hover,
.filter.is-active {
  color: var(--ink);
  border-color: rgba(232, 163, 92, 0.55);
  background: rgba(232, 163, 92, 0.08);
}

.project-list {
  display: grid;
  gap: 1.5rem;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(232, 163, 92, 0.05), transparent 40%),
    var(--bg-elevated);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.project.is-hidden {
  display: none;
}

.project.project--solo {
  grid-template-columns: 1fr;
  max-width: 640px;
}

.project-label {
  margin-bottom: 0.6rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.project-main > p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(243, 238, 230, 0.05);
  border: 1px solid var(--line);
  color: #cfc7ba;
  font-size: 0.75rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0;
}

.links a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-media {
  min-width: 0;
}

.media-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.media-slot {
  margin: 0;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px dashed rgba(243, 238, 230, 0.18);
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  position: relative;
}

.media-slot.is-clickable {
  cursor: zoom-in;
  border-style: solid;
  border-color: rgba(243, 238, 230, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.media-slot.is-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 163, 92, 0.45);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: #111;
}

.lightbox-frame figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(18, 22, 28, 0.9);
  color: var(--ink);
  border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
}

.media-slot.empty span {
  display: block;
  font-size: 0.85rem;
  color: #cfc7ba;
}

.media-slot.empty small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.7;
  max-width: 90%;
  word-break: break-word;
}

.media-slot img,
.media-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-slot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.6rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-size: 0.72rem;
  color: #f3eee6;
}

/* Skills */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.skill-group {
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
}

.skill-group h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.skill-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.edu-block h3 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.timeline li {
  display: grid;
  gap: 0.2rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(232, 163, 92, 0.45);
}

.timeline .year {
  color: var(--accent);
  font-size: 0.82rem;
}

.timeline strong {
  font-weight: 600;
}

.timeline span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Contact */
.contact {
  padding-bottom: 6rem;
}

.contact-panel {
  padding: 3rem clamp(1.5rem, 4vw, 3rem);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 10% 20%, rgba(232, 163, 92, 0.16), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(94, 196, 176, 0.12), transparent 35%),
    var(--bg-elevated);
}

.contact-copy {
  margin: 1rem 0 1.75rem;
  max-width: 34rem;
  color: var(--muted);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
}

.contact-links a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.contact-links span {
  color: var(--muted);
}

.links a {
  overflow-wrap: anywhere;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner a:hover {
  color: var(--ink);
}

/* Motion in view */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .about-grid,
  .project,
  .edu-grid {
    grid-template-columns: 1fr;
  }

  .skill-groups {
    grid-template-columns: 1fr 1fr;
  }

  .project {
    padding: 1.25rem;
  }

  .project.project--solo {
    max-width: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }

  .container {
    width: min(100% - 1.5rem, var(--max));
  }

  .site-header {
    padding: 0 1rem;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
  }

  .nav-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .nav {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1.25rem;
    background: rgba(11, 13, 16, 0.98);
    border-bottom: 1px solid var(--line);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.95rem 0.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .nav-cta {
    margin-top: 0.75rem;
    text-align: center;
    border-radius: 12px;
    border-bottom: 1px solid var(--line) !important;
  }

  .hero {
    align-items: flex-end;
    min-height: 100svh;
    padding: calc(var(--header-h) + env(safe-area-inset-top) + 1.5rem) 0 2.5rem;
  }

  .hero-inner {
    width: min(100% - 1.5rem, var(--max));
  }

  .brand {
    font-size: clamp(2rem, 11.5vw, 3rem);
    letter-spacing: -0.03em;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.25rem, 5.5vw, 1.7rem);
  }

  .lede {
    font-size: 0.98rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1.75rem;
  }

  .btn {
    width: 100%;
    min-height: 48px;
  }

  .hero-meta {
    flex-direction: column;
    gap: 0.45rem;
  }

  .hero-meta li:not(:last-child)::after {
    display: none;
  }

  .orb {
    filter: blur(28px);
    opacity: 0.85;
  }

  .orb-a,
  .orb-b {
    width: 70vw;
    height: 70vw;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-head {
    margin-bottom: 1.75rem;
  }

  .section-head h2,
  .contact-panel h2 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .about-lead {
    font-size: 1.02rem;
  }

  .filters {
    gap: 0.45rem;
    margin-bottom: 1.5rem;
  }

  .filter {
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
  }

  .experience-top {
    flex-direction: column;
    gap: 0.35rem;
  }

  .experience h3,
  .project h3 {
    font-size: 1.25rem;
  }

  .project {
    gap: 1.15rem;
    padding: 1.1rem;
    border-radius: 14px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-slot {
    aspect-ratio: 16 / 11;
  }

  .skill-groups,
  .edu-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    padding: 1.75rem 1.15rem;
    border-radius: 16px;
  }

  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer-inner {
    flex-direction: column;
    width: min(100% - 1.5rem, var(--max));
  }

  .lightbox {
    padding: 0.75rem;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  .lightbox-close {
    top: calc(0.75rem + env(safe-area-inset-top));
    right: 0.75rem;
  }

  .lightbox-frame img {
    max-height: 68vh;
  }

  .lightbox-nav {
    top: auto;
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
    transform: none;
    width: 46px;
    height: 46px;
  }

  .lightbox-prev { left: calc(50% - 58px); }
  .lightbox-next { right: calc(50% - 58px); }
}

@media (max-width: 400px) {
  .brand {
    font-size: clamp(1.85rem, 10.5vw, 2.35rem);
  }

  .tags li {
    font-size: 0.7rem;
  }
}
