:root {
  --ink: #141816;
  --ink-soft: #3a433e;
  --paper: #e7ebe6;
  --mist: #cfd8d2;
  --sage: #4f6f5c;
  --sage-deep: #2f4a3a;
  --line: rgba(20, 24, 22, 0.12);
  --white: #f7f9f6;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, #d9e2dc 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 100% 20%, #c5d0c8 0%, transparent 50%),
    linear-gradient(165deg, #eef2ed 0%, #dfe6e1 45%, #d2dcd6 100%);
  background-attachment: fixed;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.045;
  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");
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem var(--space);
  color: var(--white);
  background: rgba(12, 18, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--white);
}

.nav {
  display: flex;
  gap: 1.75rem;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(247, 249, 246, 0.92);
  transition: color 0.25s var(--ease);
}

.nav a:hover {
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--space) clamp(3rem, 8vw, 5.5rem);
  color: var(--white);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
  animation: hero-zoom 18s var(--ease) forwards;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 18, 14, 0.35) 0%, rgba(12, 18, 14, 0.15) 35%, rgba(12, 18, 14, 0.78) 100%),
    linear-gradient(90deg, rgba(12, 18, 14, 0.45) 0%, transparent 55%);
  pointer-events: none;
}

.hero-content {
  max-width: 42rem;
  padding-bottom: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.35rem;
}

.headline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin-bottom: 0.85rem;
}

.lede {
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  font-weight: 300;
  color: rgba(247, 249, 246, 0.82);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--white);
  color: var(--ink);
}

.btn-primary:hover {
  background: #e8eee8;
}

.btn-ghost {
  border-color: rgba(247, 249, 246, 0.45);
  color: var(--white);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--white);
  background: rgba(247, 249, 246, 0.08);
}

.scroll-hint {
  position: absolute;
  right: var(--space);
  bottom: clamp(2.5rem, 6vw, 4rem);
  width: 1.5rem;
  height: 2.4rem;
  border: 1px solid rgba(247, 249, 246, 0.4);
  display: flex;
  justify-content: center;
  padding-top: 0.4rem;
}

.scroll-hint span {
  width: 3px;
  height: 8px;
  background: var(--white);
  animation: scroll-pulse 1.8s var(--ease) infinite;
}

/* Tech marquee */
.tech-marquee {
  background: #121614;
  color: #f2f4f1;
  padding: 1.35rem 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.marquee {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee-scroll 32s linear infinite;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-right: clamp(2rem, 5vw, 3.5rem);
  list-style: none;
  margin: 0;
}

.marquee-group li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.marquee-group svg {
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
}

.marquee-group span {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(242, 244, 241, 0.92);
}

@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* Sections */
.section {
  padding: clamp(4.5rem, 12vw, 8rem) var(--space);
  max-width: calc(var(--max) + var(--space) * 2);
  margin: 0 auto;
}

.section-head {
  max-width: 36rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  font-weight: 400;
}

.section-copy {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 38ch;
}

/* Work */
.project-list {
  border-top: 1px solid var(--line);
}

.project {
  padding: 1.65rem 0 1.9rem;
  border-bottom: 1px solid var(--line);
}

.project-link {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.2rem;
  margin-left: 4.75rem;
}

.project-shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: #1a211d;
  overflow: hidden;
  cursor: zoom-in;
  appearance: none;
  font: inherit;
  aspect-ratio: 16 / 10;
}

.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s var(--ease);
}

.project-shot:hover img,
.project-shot:focus-visible img {
  transform: scale(1.05);
}

.project-shot:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 14, 12, 0.96);
  color: var(--white);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox::backdrop {
  background: rgba(10, 14, 12, 0.96);
}

.lightbox-bar {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 0.9rem 1.15rem;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem 1.25rem;
}

.lightbox-stage img {
  width: auto;
  height: auto;
  max-width: min(100%, 1120px);
  max-height: calc(100vh - 5.5rem);
  object-fit: contain;
}

.lightbox-close {
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  background: rgba(12, 18, 14, 0.9);
  border: 1px solid rgba(247, 249, 246, 0.35);
  cursor: pointer;
}

.lightbox-close:hover {
  background: #1a211d;
  border-color: var(--white);
}

body.lightbox-open {
  overflow: hidden;
}

body.lightbox-open .site-header,
body.lightbox-open .grain {
  visibility: hidden;
  pointer-events: none;
}

.project-index {
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 500;
}

.project-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.project-body p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 52ch;
}

.project-url {
  display: inline-flex;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sage);
  border-bottom: 1px solid rgba(79, 111, 92, 0.35);
}

.project-url:hover {
  color: var(--sage-deep);
  border-bottom-color: var(--sage-deep);
}

.project-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  white-space: nowrap;
  align-self: center;
}

/* Experience */
.timeline {
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.5rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 500;
}

.timeline-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.timeline-org {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* Education */
.edu-list {
  border-top: 1px solid var(--line);
}

.edu-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--line);
}

.edu-list h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.3vw, 1.65rem);
  font-weight: 400;
  grid-column: 1;
}

.edu-list p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 48ch;
  grid-column: 1;
}

.edu-list span {
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 500;
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}

/* Certifications */
.cert-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
}

.cert-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 1rem;
  padding-left: 1.25rem;
  position: relative;
}

.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--sage);
}

/* References */
.ref-list {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.ref-list li {
  padding: 1.65rem 1.5rem 1.65rem 0;
  border-bottom: 1px solid var(--line);
}

.ref-list li:not(:last-child) {
  border-right: 1px solid var(--line);
  padding-right: 1.75rem;
  margin-right: 1.75rem;
}

.ref-list h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 400;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.ref-list p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* About */
.about {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: calc(var(--max) + var(--space) * 2);
  margin: 0 auto;
  padding: 0 var(--space);
}

.about-visual {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--mist);
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  transform: scale(1.08);
  transform-origin: center top;
  filter: none;
  transition: transform 1.2s var(--ease);
}

.about-visual:hover img {
  transform: scale(1.12);
}

.about-copy .section-title {
  margin-bottom: 1.25rem;
}

.about-copy p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 1rem;
  max-width: 42ch;
}

.facts {
  display: grid;
  gap: 1.15rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.facts div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
}

.facts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage);
  font-weight: 500;
  padding-top: 0.15rem;
}

.facts dd {
  font-size: 1rem;
}

/* Expertise */
.skill-rows {
  border-top: 1px solid var(--line);
}

.skill-rows li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.skill-rows li span:first-child {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.skill-rows li span:last-child {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: right;
  align-self: center;
}

/* Contact */
.contact {
  padding-bottom: clamp(5rem, 12vw, 8rem);
}

.contact-panel {
  background:
    linear-gradient(145deg, rgba(47, 74, 58, 0.94), rgba(31, 52, 40, 0.97)),
    url("https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1600&q=60");
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  color: var(--white);
  padding: clamp(3rem, 8vw, 5rem) clamp(1.75rem, 5vw, 4rem);
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.25rem;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  max-width: 14ch;
  font-weight: 400;
}

.contact-copy {
  max-width: 36ch;
  color: rgba(247, 249, 246, 0.8);
  font-weight: 300;
}

.contact-panel .btn-primary {
  margin-top: 0.5rem;
}

.contact-phone {
  margin-top: 0;
}

.contact-location {
  font-size: 0.9rem;
  color: rgba(247, 249, 246, 0.7);
  margin-top: 0.25rem;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--space) 2rem;
  max-width: calc(var(--max) + var(--space) * 2);
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.site-footer a:hover {
  color: var(--ink);
}

/* Reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }
.delay-4 { transition-delay: 0.48s; }

@keyframes hero-zoom {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

@keyframes scroll-pulse {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0.2; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .project-link {
    grid-template-columns: 2.5rem 1fr;
    grid-template-rows: auto auto;
  }

  .project-meta {
    grid-column: 2;
    white-space: normal;
  }

  .project-gallery {
    margin-left: 0;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .edu-list li {
    grid-template-columns: 1fr;
  }

  .edu-list span {
    grid-column: 1;
    grid-row: auto;
  }

  .ref-list {
    grid-template-columns: 1fr;
  }

  .ref-list li:not(:last-child) {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    max-width: 28rem;
  }

  .skill-rows li {
    flex-direction: column;
    gap: 0.35rem;
  }

  .skill-rows li span:last-child {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .project-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.7rem;
    padding-bottom: 0.25rem;
  }

  .project-shot {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  .nav {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav a {
    font-size: 0.78rem;
  }

  .scroll-hint {
    display: none;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-media img {
    animation: none;
    transform: none;
  }

  .scroll-hint span {
    animation: none;
  }

  .project-shot img {
    transition: none;
  }
}
