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

:root {
  --bg: #0a0a0a;
  --fg: #f0ede8;
  --fg-dim: rgba(240,237,232,0.38);
  --fg-mid: rgba(240,237,232,0.65);
  --border: rgba(240,237,232,0.1);
  --font-body: 'Urbanist', sans-serif;
  --font-heading: 'Urbanist', sans-serif;
  --accent: #f0ede8;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  overflow-x: hidden;
}

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

/* Display / heading font applies to large title elements */
.home-name,
.overlay-title,
.contact-cta,
.proj-end-next-name,
.maint-heading { font-family: var(--font-heading); }

.page-wrapper { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.page-content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; }

/* Nav */
nav { position: relative; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 28px 48px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.nav-logo { font-size: 13px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); cursor: none; transition: letter-spacing 0.3s ease, opacity 0.2s; }
.nav-logo:hover { letter-spacing: 0.08em; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links li { position: relative; }
.nav-links li a, .nav-links li button { font-size: 13px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-mid); background: none; border: none; padding: 0 0 2px; cursor: none; transition: color 0.2s ease; position: relative; }
.nav-links li a:hover, .nav-links li button:hover { color: var(--fg); }
.nav-links li a.active, .nav-links li button.active { color: var(--fg); }
.nav-links li a::after, .nav-links li button::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform 0.3s cubic-bezier(0.76,0,0.24,1); }
.nav-links li a:hover::after, .nav-links li button:hover::after, .nav-links li a.active::after, .nav-links li button.active::after { transform: scaleX(1); }
.nav-avail { font-size: 12px; font-weight: 400; letter-spacing: 0.04em; color: var(--fg-dim); display: flex; align-items: center; gap: 8px; }
.avail-dot { width: 6px; height: 6px; border-radius: 50%; background: #aaffaa; display: inline-block; animation: pulse 2s ease infinite; }
.avail-dot:hover { animation-duration: 0.8s; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Home */
.home-hero { padding: 80px 48px 60px; max-width: 820px; }
.home-name { font-size: clamp(52px,8vw,110px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.92; margin-bottom: 48px; color: var(--fg); }
.home-bio { font-size: clamp(16px,2vw,19px); font-weight: 300; line-height: 1.65; color: var(--fg-mid); max-width: 560px; margin-bottom: 52px; }
.home-bio strong { color: var(--fg); font-weight: 500; }
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { border: 1px solid var(--border); border-radius: 100px; padding: 8px 20px; font-size: 13px; font-weight: 400; letter-spacing: 0.04em; color: var(--fg-mid); cursor: none; transition: color 0.2s, border-color 0.2s, background 0.25s ease; background: transparent; }
.pill:hover { color: var(--fg); border-color: rgba(240,237,232,0.35); background: rgba(240,237,232,0.06); }
.pill.email { color: var(--fg); border-color: rgba(240,237,232,0.3); }
.home-scroll-hint { position: fixed; bottom: 36px; right: 48px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); display: flex; align-items: center; gap: 10px; }
.home-scroll-hint::before { content: ''; display: block; width: 32px; height: 1px; background: var(--fg-dim); }
.home-work-preview { padding: 0 48px 80px; }
.home-section-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 32px; padding-top: 52px; border-top: 1px solid var(--border); }
.home-thumb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-thumb-item { transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.home-thumb-item:hover { transform: translateY(-3px); }

/* Marquee */
.marquee-section { padding: 40px 0; border-top: 1px solid var(--border); overflow: hidden; position: relative; }
.marquee-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); padding: 0 48px; margin-bottom: 28px; }
.marquee-track { display: flex; width: max-content; animation: marqueeScroll 18s linear infinite; }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-item { display: flex; align-items: center; padding: 0 52px; white-space: nowrap; font-size: clamp(15px,2vw,20px); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-mid); transition: color 0.2s; border-right: 1px solid var(--border); height: 36px; }
.marquee-item:hover { color: var(--fg); }

/* Work */
.work-page { padding: 60px 48px 80px; }
.work-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 64px; }
.work-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); }
.work-count { font-size: 11px; letter-spacing: 0.08em; color: var(--fg-dim); }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.project-card { cursor: none; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.project-card:hover { transform: translateY(-4px); }
.project-card-thumb { position: relative; width: 100%; aspect-ratio: 4/3; background: #141414; overflow: hidden; margin-bottom: 14px; transition: box-shadow 0.3s ease; }
.project-card:hover .project-card-thumb { box-shadow: 0 16px 40px rgba(0,0,0,0.5); }
.project-card-thumb-inner { position: absolute; inset: 0; background: repeating-linear-gradient(45deg,transparent,transparent 18px,rgba(240,237,232,0.025) 18px,rgba(240,237,232,0.025) 19px); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
.project-card-thumb-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-card-hover { position: absolute; inset: 0; background: rgba(240,237,232,0.06); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.25s ease; }
.project-card:hover .project-card-hover { opacity: 1; }
.project-card-caption { display: flex; justify-content: space-between; align-items: baseline; }
.project-card-name { font-size: 15px; font-weight: 500; color: var(--fg); letter-spacing: -0.01em; }
.project-card-type { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }
.project-card-num { font-size: 10px; letter-spacing: 0.08em; color: var(--fg-dim); margin-bottom: 8px; }

/* Project overlay */
.project-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.6s cubic-bezier(0.76,0,0.24,1); overflow-y: auto; }
.project-overlay.open { transform: translateY(0); }
.overlay-nav { display: flex; justify-content: space-between; align-items: center; padding: 28px 48px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.overlay-back { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; background: none; border: none; color: var(--fg-mid); cursor: none; transition: color 0.2s, gap 0.25s; display: flex; align-items: center; gap: 10px; }
.overlay-back:hover { color: var(--fg); }
.overlay-back::before { content: '←'; font-size: 16px; display: inline-block; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); margin-right: 8px; }
.overlay-back:hover::before { transform: translateX(-4px); }
.overlay-title { font-size: clamp(40px,6vw,88px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.92; margin-bottom: 24px !important; }
.overlay-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; margin-bottom: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--border); }
.info-block label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); display: block; margin-bottom: 8px; }
.info-block p { font-size: 15px; font-weight: 400; color: var(--fg); line-height: 1.4; }
.overlay-desc { font-size: clamp(15px,1.8vw,18px); font-weight: 300; line-height: 1.75; color: var(--fg-mid); max-width: 640px; }

/* Gallery */
.proj-gallery { padding: 2px; display: flex; flex-direction: column; gap: 2px; }
.gallery-row { display: grid; gap: 2px; }
.gallery-row--full { grid-template-columns: 1fr; }
.gallery-row--half { grid-template-columns: 1fr 1fr; }
.gallery-row--third { grid-template-columns: 1fr 1fr 1fr; }
.gallery-row--single { grid-template-columns: 1fr; max-width: 60%; }
.gallery-tile-wrap { overflow: hidden; transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1); }
.gallery-tile-wrap:hover { transform: scale(1.01); }
@keyframes tileIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* Lightbox */
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.6); font-size: 18px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s, color 0.2s; z-index: 10; }
.lb-arrow:hover { border-color: rgba(255,255,255,0.4); color: white; }
.lb-prev { left: 0; } .lb-next { right: 0; }

/* Project end CTA */
.proj-end-cta { padding: 0 0 80px; }
.proj-end-divider { height: 1px; background: var(--border); margin: 0 2px; }
.proj-end-inner { display: flex; justify-content: space-between; align-items: flex-end; padding: 52px 48px 0; gap: 40px; }
.proj-end-label { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 12px; }
.proj-end-next-name { font-size: clamp(28px,4vw,56px); font-weight: 700; letter-spacing: -0.03em; color: var(--fg); background: none; border: none; padding: 0; cursor: pointer; line-height: 1; text-align: left; transition: opacity 0.2s, letter-spacing 0.3s ease; }
.proj-end-next-name:hover { opacity: 1 !important; letter-spacing: -0.01em; }
.proj-end-contact { text-align: right; flex-shrink: 0; }
.proj-end-cta-link { display: inline-block; font-size: 14px; font-weight: 300; color: var(--fg-mid); border-bottom: 1px solid var(--border); padding-bottom: 4px; transition: color 0.2s, border-color 0.2s; position: relative; }
.proj-end-cta-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--fg); transition: width 0.35s cubic-bezier(0.76,0,0.24,1); }
.proj-end-cta-link:hover::after { width: 100%; }
.proj-end-cta-link:hover { color: var(--fg); border-bottom-color: transparent !important; }

/* About */
.about-page { padding: 60px 48px 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 80px; max-width: 1100px; }
.about-right { padding-top: 4px; }
.about-section-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 32px; transition: letter-spacing 0.3s ease; }
.about-bio-text { font-size: clamp(16px,1.8vw,20px); font-weight: 300; line-height: 1.7; color: var(--fg-mid); margin-bottom: 48px; }
.about-bio-text strong { color: var(--fg); font-weight: 500; }
.services-list { list-style: none; margin-bottom: 52px; }
.services-list li { padding: 16px 0; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 300; color: var(--fg-mid); display: flex; justify-content: space-between; align-items: center; transition: padding-left 0.25s ease, color 0.2s; cursor: default; }
.services-list li:hover { padding-left: 8px; color: var(--fg); }
.services-list li span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }
.services-list li:hover span { color: var(--fg-mid); }
.clients-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.client-item { padding: 14px 0; font-size: 14px; font-weight: 300; color: var(--fg-dim); border-bottom: 1px solid var(--border); }
.client-item:nth-child(odd) { padding-right: 20px; }
.about-resume-btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--border); padding: 14px 28px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font); color: var(--fg); cursor: none; transition: background 0.2s, border-color 0.2s; margin-top: 32px; background: none; }
.about-resume-btn:hover { background: rgba(240,237,232,0.05); border-color: rgba(240,237,232,0.3); }
.exp-list { list-style: none; }
.exp-item { padding: 20px 0; border-bottom: 1px solid var(--border); transition: padding-left 0.25s ease; cursor: default; }
.exp-item:first-child { border-top: 1px solid var(--border); }
.exp-item:hover { padding-left: 8px; }
.exp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.exp-company { font-size: 15px; font-weight: 500; color: var(--fg); letter-spacing: -0.01em; }
.exp-item:hover .exp-company { color: var(--fg); }
.exp-period { font-size: 11px; letter-spacing: 0.06em; color: var(--fg-dim); }
.exp-bottom { display: flex; justify-content: space-between; align-items: baseline; }
.exp-role { font-size: 13px; font-weight: 300; color: var(--fg-mid); }
.exp-type { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); }

/* Contact */
.contact-page { padding: 80px 48px; display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 74px); }
.contact-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 40px; }
.contact-cta { font-size: clamp(36px,6vw,88px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.92; margin-bottom: 64px; max-width: 700px; }
.contact-email-link { display: inline-block; font-size: clamp(18px,2.5vw,28px); font-weight: 300; color: var(--fg-mid); padding-bottom: 6px; margin-bottom: 56px; cursor: none; transition: color 0.2s; position: relative; }
.contact-email-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: var(--fg-mid); transform: scaleX(1); transform-origin: left; transition: background 0.2s; }
.contact-email-link:hover::after { background: var(--fg); }
.contact-email-link:hover { color: var(--fg); }
.contact-socials { display: flex; flex-direction: column; gap: 12px; }
.contact-social { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 300; color: var(--fg-dim); cursor: none; transition: color 0.2s; width: fit-content; }
.contact-social:hover { color: var(--fg); }
.contact-social-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; width: 80px; color: var(--fg-dim); display: flex; align-items: center; gap: 8px; }
.contact-social:hover .contact-social-label { color: var(--fg-mid); }

/* Image placeholder */
.img-placeholder { display: flex; align-items: center; justify-content: center; background: #1a1a1a; font-size: 11px; letter-spacing: 0.08em; color: var(--fg-dim); text-transform: uppercase; width: 100%; height: 100%; position: relative; }
.img-placeholder svg { opacity: 0.15; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }

/* Page transitions */
.page-enter { animation: pageEnter 0.5s cubic-bezier(0.76,0,0.24,1) forwards; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
.footer-icon-link { transition: color 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1) !important; }
.footer-icon-link:hover { transform: scale(1.15) !important; }

/* Tweaks panel */
.tweaks-panel { position: fixed; bottom: 24px; right: 24px; z-index: 9000; background: #111; border: 1px solid rgba(240,237,232,0.15); padding: 20px 24px; width: 240px; display: none; }
.tweaks-panel.visible { display: block; }
.tweaks-title { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 16px; }
.tweak-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tweak-label { font-size: 12px; color: var(--fg-mid); }
.tweak-row input[type="color"] { width: 28px; height: 28px; border: 1px solid var(--border); background: none; cursor: pointer; padding: 2px; }
.tweak-row input[type="range"] { width: 100px; accent-color: var(--fg); cursor: pointer; }
.tweak-swatch-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tweak-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s; }
.tweak-swatch.active { border-color: var(--fg); }

/* Maintenance page */
.maint-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 200px; gap: 2px; }
.maint-cell { position: relative; overflow: hidden; background: #111; transition: opacity 0.3s ease; }
.maint-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.maint-cell-ph { width: 100%; height: 100%; }
.maint-cell:hover { opacity: 1 !important; }
.maint-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.88) 100%); }
.maint-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 40px 20px; text-align: center; }
.maint-tag { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 36px; }
.maint-heading { font-size: clamp(52px, 9vw, 108px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.92; margin-bottom: 32px; }
.maint-msg { font-size: clamp(15px, 1.8vw, 18px); font-weight: 300; color: var(--fg-mid); max-width: 480px; line-height: 1.75; margin-bottom: 52px; }
.maint-email { font-size: clamp(14px, 2vw, 20px); font-weight: 300; color: var(--fg-mid); border-bottom: 1px solid var(--border); padding-bottom: 5px; transition: color 0.2s; }
.maint-email:hover { color: var(--fg); }
.maint-socials { display: flex; gap: 20px; margin-top: 32px; }
.maint-social-link { color: var(--fg); opacity: 0.3; transition: opacity 0.22s; display: flex; align-items: center; }
.maint-social-link:hover { opacity: 1; }
.maint-social-link svg { width: 20px; height: 20px; }

/* Responsive */
@media (max-width: 1024px) {
  nav { padding: 22px 32px; }
  .home-hero { padding: 60px 32px 48px; }
  .home-work-preview { padding: 0 32px 60px; }
  .work-page { padding: 48px 32px 60px; }
  .about-page { padding: 48px 32px 60px; gap: 0 48px; }
  .contact-page { padding: 60px 32px; }
  .marquee-label { padding: 0 32px; }
}

@media (max-width: 768px) {
  nav { padding: 18px 20px; }
  .nav-avail { display: none; }
  .nav-links { gap: 20px; }
  .nav-links li a, .nav-links li button { font-size: 12px; }
  .home-hero { padding: 48px 20px 40px; max-width: 100%; }
  .home-bio { font-size: 15px; margin-bottom: 36px; }
  .home-name { margin-bottom: 32px; }
  .home-work-preview { padding: 0 20px 48px; }
  .home-thumb-grid { grid-template-columns: 1fr; }
  .work-page { padding: 36px 20px 48px; }
  .work-header { margin-bottom: 32px; }
  .project-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-page { grid-template-columns: 1fr; padding: 36px 20px 48px; gap: 0; }
  .about-right { padding-top: 48px; }
  .about-bio-text { font-size: 15px; margin-bottom: 32px; }
  .contact-page { padding: 48px 20px; min-height: unset; }
  .contact-cta { margin-bottom: 40px; }
  .contact-email-link { margin-bottom: 36px; font-size: 16px; }
  .overlay-nav { padding: 16px 20px; }
  .overlay-info-grid { grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; padding-bottom: 32px; }
  .proj-gallery { padding: 1px; gap: 1px; }
  .gallery-row { gap: 1px; }
  .gallery-row--half { grid-template-columns: 1fr; }
  .gallery-row--third { grid-template-columns: 1fr 1fr; }
  .gallery-row--single { max-width: 100%; }
  .lb-arrow { display: none; }
  .proj-end-inner { flex-direction: column; align-items: flex-start; padding: 36px 20px 0; gap: 32px; }
  .proj-end-contact { text-align: left; }
  .home-scroll-hint { display: none; }
  .pill { padding: 10px 18px; min-height: 44px; display: flex; align-items: center; }
  .about-resume-btn { min-height: 44px; }
  .site-footer { padding: 20px !important; flex-direction: column !important; gap: 12px !important; align-items: flex-start !important; }
  .footer-socials { gap: 16px !important; }
  .marquee-section { padding: 28px 0; }
  .marquee-label { padding: 0 20px; }
  .marquee-item { font-size: 13px; padding: 0 28px; }
}

@media (max-width: 400px) {
  .nav-links { gap: 14px; }
  .nav-links li a, .nav-links li button { font-size: 11px; }
  .overlay-info-grid { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: 1fr; }
}
