:root {
  --bg: #0e0f13;
  --bg-alt: #16181f;
  --card: #1b1e27;
  --border: #2a2d38;
  --text: #f2f1ed;
  --text-muted: #a3a6b3;
  --accent: #ff7a4d;
  --accent-2: #35d4c7;
  --radius: 10px;
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

ul { margin: 0; padding: 0; list-style: none; }

.section {
  padding: 96px 24px;
}

.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 2.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75em 1.5em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #191008;
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-block {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 15, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

.header-resume {
  padding: 0.5em 1.2em;
  font-size: 0.88rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding: 48px 24px;
  overflow: hidden;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
  animation: blob-float 16s ease-in-out infinite;
}

.hero-blob-1 {
  width: 420px;
  height: 420px;
  top: -10%;
  left: 5%;
  background: radial-gradient(circle, rgba(255, 122, 77, 0.5), transparent 70%);
  transform: translate3d(calc(var(--parallax-x) * 1.4), calc(var(--parallax-y) * 1.4), 0);
}

.hero-blob-2 {
  width: 380px;
  height: 380px;
  bottom: -15%;
  right: 8%;
  background: radial-gradient(circle, rgba(53, 212, 199, 0.4), transparent 70%);
  animation-delay: -6s;
  transform: translate3d(calc(var(--parallax-x) * -1.2), calc(var(--parallax-y) * -1.2), 0);
}

.hero-blob-3 {
  width: 260px;
  height: 260px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, rgba(255, 122, 77, 0.25), transparent 70%);
  animation-delay: -11s;
  transform: translate3d(calc(var(--parallax-x) * 0.8), calc(var(--parallax-y) * 0.8), 0);
}

@keyframes blob-float {
  0%, 100% { margin: 0; }
  50% { margin: 24px 0 0 18px; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin-bottom: 0.4em;
}

.hero-tagline {
  max-width: 620px;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-location {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
}

.about-summary p {
  color: var(--text-muted);
}

.about-summary h3 {
  margin-top: 2rem;
  font-size: 1.1rem;
}

.timeline li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

.timeline-role {
  color: var(--text);
}

.skill-block {
  margin-bottom: 1.75rem;
}

.skill-block h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5em 1.2em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #191008;
  font-weight: 600;
}

.filter-count {
  margin-left: 5px;
  font-size: 0.76rem;
  opacity: 0.6;
}

.filter-btn.active .filter-count {
  opacity: 0.75;
}

/* Gallery */
/* Masonry via CSS columns: source art ranges from wide banners to tall
   posters, so items keep their natural aspect ratio instead of a cropped box. */
.gallery-grid {
  columns: 4 260px;
  column-gap: 18px;
  margin-bottom: 2.5rem;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  border: 1px solid var(--border);
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
  --glare-x: 50%;
  --glare-y: 50%;
}

.gallery-item:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at var(--glare-x) var(--glare-y), rgba(255, 255, 255, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px;
  font-size: 0.8rem;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 60%, transparent 100%);
  color: #fff;
  z-index: 3;
}

/* Expand hint — mouse/trackpad only; touch devices already see the caption. */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  z-index: 3;
  border-radius: 50%;
  background-color: rgba(10, 11, 14, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-item figcaption {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .gallery-item:hover figcaption {
    opacity: 1;
    transform: translateY(0);
  }
  .gallery-item:hover::after {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-placeholder {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.contact-card:not(.contact-card-static):hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  padding: 40px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 0.92rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-nav:hover { border-color: var(--accent); color: var(--accent); }

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

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .header-resume { display: none; }
  .nav-toggle { display: flex; }
  .section { padding: 64px 20px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox { padding: 20px; }
  .gallery-grid { columns: 2 150px; column-gap: 12px; }
  .gallery-item { margin-bottom: 12px; }
}

/* ---------- Scroll-reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- Lightbox motion ---------- */

.lightbox {
  transition: opacity 0.25s ease;
}

.lightbox img#lightbox-img {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.lightbox.open img#lightbox-img {
  animation: lightbox-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes lightbox-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.slide-in-left {
  animation: slide-in-left 0.26s ease !important;
}
.slide-in-right {
  animation: slide-in-right 0.26s ease !important;
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-blob { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .gallery-item {
    transition: none;
  }
  .lightbox.open img#lightbox-img,
  .slide-in-left,
  .slide-in-right {
    animation: none !important;
  }
}
