/* =========================================================
   Király Nándor — CGI Artist Portfolio
   ========================================================= */

/* ---------- DESIGN TOKENS ---------- */
:root {
  color-scheme: dark;
  --bg: #182013;
  --bg-soft: #0f160c;
  --panel: #131c0f;
  --panel-line: rgba(232, 230, 225, 0.09);
  --ink: #e8e6e1;
  --ink-dim: #9aa38c;
  --ink-faint: #6b7261;
  --lime: #cadb00;
  --lime-soft: #cad77f; 
  --lime-deep: #6aab00;
  --btn-ink: #16210f;
  --radius-l: 28px;
  --radius-m: 16px;
  --radius-s: 10px;
  --maxw: 1280px;
  --pad: clamp(20px, 5vw, 64px);
  --font-display: "Stack Sans Notch", sans-serif;
  --font-body: "IBM Plex Mono", monospace;  
  --font-mono: "IBM Plex Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--lime); color: var(--btn-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- DOT-GRID BACKGROUND ---------- */
.dot-grid {
  background-image: radial-gradient(rgba(129, 162, 100, 0.3) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---------- LAYOUT HELPERS ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.section { padding-top: clamp(72px, 10vw, 140px); padding-bottom: clamp(72px, 10vw, 140px); position: relative; }
section[id], main#home { scroll-margin-top: 92px; }
.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--lime-soft);
  margin: 0 0 14px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--lime);
  letter-spacing: -0.01em;
}
.section-desc {
  color: var(--ink-dim);
  margin-top: 14px;
  font-size: 16px;
  max-width: 52ch;
}
.section-head.center .section-desc { margin-left: auto; margin-right: auto; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--lime-soft);
  color: var(--btn-ink);
}
.btn-primary:hover { background: var(--lime); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(202, 219, 0, 0.18); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--panel-line);
}
.btn-ghost:hover { border-color: var(--lime-soft); color: var(--lime-soft); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- REVEAL ON SCROLL ------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px) scale(0.94);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 0;
  transition: top 0.5s var(--ease), left 0.5s var(--ease), right 0.5s var(--ease), padding 0.5s var(--ease), border-radius 0.5s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
/* floating island once the page is scrolled: both edges move in towards the centre */
.site-header.scrolled {
  top: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  border-color: var(--panel-line);
  background: rgba(15, 22, 12, 0.66);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(232, 230, 225, 0.05);
}
@media (min-width: 664px) {
  .site-header.scrolled { left: calc(50% - 320px); right: calc(50% - 320px); } /* 640px wide island */
}
.site-header .menu-btn { transition: width 0.5s var(--ease), height 0.5s var(--ease); }
.site-header.scrolled .menu-btn { width: 42px; height: 42px; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 196px;  
  height: auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.brand-role {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--lime-soft);
  letter-spacing: 0.02em;
}
.menu-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(19, 28, 15, 0.8);
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.menu-btn .dots {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 3px;
}
.menu-btn .dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  transition: background 0.2s var(--ease);
}
.menu-btn .x-icon { display: none; font-family: var(--font-mono); font-size: 20px; }
.menu-btn:hover .dots span { background: var(--lime-soft); }

/* ---------- NAVIGATION OVERLAY ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 12, 6, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 110px 20px 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-overlay-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
  text-align: center;
}
.nav-overlay-list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 4.5vw, 36px);
  color: var(--ink-dim);
  padding: 6px 18px;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
  display: inline-block;
}
.nav-overlay-list a:hover,
.nav-overlay-list a:focus-visible { color: var(--lime); transform: translateX(6px); }
.nav-overlay-list .n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime-soft);
  vertical-align: super;
  margin-right: 10px;
}
.nav-overlay-foot {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 12px;
}
.nav-overlay-foot a { color: var(--ink-dim); border-bottom: 1px solid transparent; white-space: nowrap; }
.nav-overlay-foot a:hover { color: var(--lime-soft); border-color: var(--lime-soft); }

body.nav-open { overflow: hidden; }

/* ---------- HERO SECTION/LANDING PAGE ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 120px;
  padding-bottom: 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 78% 20%, rgba(202, 219, 0, 0.10), transparent 60%),
    radial-gradient(45% 40% at 10% 85%, rgba(106, 171, 0, 0.10), transparent 60%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-dim);
  border: 1px solid var(--panel-line);
  background: rgba(19, 28, 15, 0.6);
  padding: 10px 10px;
  border-radius: 999px;
  margin: 0 0 46px;

}
.hero-badge .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(205, 219, 31, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(205, 219, 31, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(205, 219, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(205, 219, 31, 0); }
}
.hero-headline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(14px, 3vw, 34px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 11vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-align: center;
}

/* FOR PREVIOUS STATIC VERSION */
/*.hero-headline .hi { color: var(--ink); } FOR STATIC VERSION */ 
/*.hero-headline .name { color: var(--lime); } FOR STATIC VERSION */

.hero-photo {
  width: clamp(80px, 11vw, 148px);
  height: clamp(96px, 13vw, 178px);
  border-radius: 20px;
  overflow: hidden;
  /* transform: rotate(-4deg); FOR STATIC VERSION */ 
  border: 3px solid var(--bg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* LANDING PAGE ANIMATION */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroPhotoIn {
  from { opacity: 0; transform: translateY(18px) rotate(-4deg) scale(0.9); }
  to { opacity: 1; transform: translateY(0) rotate(-4deg) scale(1); }
}
.hero-headline .hi {
  color: var(--ink);
  display: inline-block;
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease) 0.1s both;
}
.hero-headline .name {
  color: var(--lime);
  display: inline-block;
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease) 0.4s both;
}
.hero-photo {
  opacity: 0;
  animation: heroPhotoIn 0.9s var(--ease) 0.25s both;
}
.hero-sub {
  max-width: 46ch;
  margin: 34px auto 0;
  text-align: center;
  color: var(--ink-dim);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 300;
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 42px;
  flex-wrap: wrap;
}
.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-faint);
}
.hero-scroll svg { width: 16px; opacity: 0.7; }
.hero-scroll svg:nth-child(2) { margin-top: -9px; opacity: 0.4; }
.hero-scroll { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ---------- ABOUT PAGE ---------- */
.about {
  background: var(--bg);
  border-top: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
}
.about-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.3fr;
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}
.about-photo-wrap {
  position: relative;
}
.about-photo {
  border-radius: var(--radius-l);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: radial-gradient(circle at center, rgba(202, 219, 0, 0.10), transparent 60%);
}
/* entrance animations start when the about block scrolls into view */
.about-photo, .about-tag { opacity: 0; }
.about-photo-wrap.is-visible .about-photo { animation: heroPhotoIn 0.9s var(--ease) 0.25s both; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-tag {
  position: absolute;
  bottom: -18px;
  left: -18px;
  background: var(--lime-soft);
  color: var(--btn-ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-m);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}
.about-photo-wrap.is-visible .about-tag { animation: heroFadeUp 0.9s var(--ease) 0.45s both; }

.about-tag strong { display: block; font-family: var(--font-display); font-size: 24px; }
.about-intro {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 44px;
}
.about-intro strong { color: var(--lime); }
.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
}
.about-fact h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--lime-soft);
  margin-bottom: 10px;
}
.about-fact p { color: var(--ink-dim); font-size: 14px; }
.software-row { display: flex; gap: 10px; flex-wrap: wrap; }
.software-row figure {
  margin: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
}
.software-row figure img { width: 22px; height: 22px; filter: brightness(0) invert(1);}

/* ---------- FEATURED WORK PAGE ---------- */
.featured { border-bottom: 1px solid var(--panel-line); }
.featured-carousel .feat-card {
  flex: 0 0 clamp(280px, 34vw, 420px);
  scroll-snap-align: start;
  cursor: pointer;
  border: none;
  background: var(--panel);
  padding: 0;
  border-radius: var(--radius-l);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 5;
}
.featured-carousel .feat-card figure { margin: 0; width: 100%; height: 100%; }
.featured-carousel .feat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.featured-carousel .feat-card:hover img { transform: scale(1.06); }
.featured-carousel .feat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 9, 5, 0.92) 0%, rgba(6, 9, 5, 0.15) 42%, rgba(6, 9, 5, 0) 62%);
}
.feat-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--btn-ink);
  background: var(--lime-soft);
  padding: 7px 14px;
  border-radius: 999px;
}
.feat-info {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}
.feat-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 25px);
  color: var(--ink);
}
.feat-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime-soft);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.feat-card:hover .feat-cta,
.feat-card:focus-visible .feat-cta { opacity: 1; transform: translateY(0); }
@media (hover: none) {
  .feat-cta { opacity: 1; transform: none; }
}
/* ---------- PROJECT MODAL PAGE ---------- */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.project-modal.open { opacity: 1; visibility: visible; }
.project-modal-scroll { height: 100%; overflow-y: auto; }
.project-close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(10, 15, 8, 0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease);
}
.project-close:hover { border-color: var(--lime-soft); }
.project-close svg { width: 18px; height: 18px; }
.project-body { padding-top: 100px; padding-bottom: 90px; max-width: 900px; }
.project-head { margin-bottom: 36px; }
.project-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.viewer-frame {
  position: relative;
  width: 100%;
  height: min(700px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.viewer-expand {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: rgba(10, 15, 8, 0.75);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-dim);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.viewer-expand svg { margin: 2px; width: 16px; height: 16px; }
.viewer-expand:hover {
  border-color: var(--lime-soft);
  color: var(--lime-soft);
  background: rgba(10, 15, 8, 0.92);
}
.viewer-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(10, 15, 8, 0.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.viewer-arrow:hover { border-color: var(--lime-soft); background: rgba(10, 15, 8, 0.92); }
.viewer-arrow svg { width: 20px; height: 20px; }
.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }
.viewer-arrow.is-hidden { display: none; }
.viewer-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.viewer-frame .is-hidden { display: none; }
.project-gallery button { position: relative; }
.thumb-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 15, 8, 0.8);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.thumb-badge svg { width: 9px; height: 9px; }
.project-gallery {
  display: flex;
  gap: 10px;
  margin-bottom: 56px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.project-gallery::-webkit-scrollbar { display: none; }
.project-gallery button {
  flex: 0 0 84px;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 4/5;
  background: var(--panel);
  transition: border-color 0.2s var(--ease);
}
.project-gallery button img,
.project-gallery button video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.project-gallery button.active { border-color: var(--lime-soft); }
.project-process h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--lime);
  margin-bottom: 26px;
}
.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.process-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--panel-line);
}
.process-list li:last-child { border-bottom: none; padding-bottom: 0; }
.process-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--lime-soft);
  border: 1px solid var(--panel-line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.process-list h5 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 4px 0 6px;
}
.process-list p { color: var(--ink-dim); font-size: 14.5px; }

.project-switch {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--panel-line);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .viewer-frame { height: 38vh; }
  .viewer-arrow { width: 40px; height: 40px; }
  .viewer-arrow svg { width: 16px; height: 16px; }
  .project-gallery button { flex-basis: 64px; }
}

/* ---------- CAROUSELS PAGE ---------- */
.work-section {
  border-bottom: 1px solid var(--panel-line);
}
.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.carousel-controls {
  display: flex;
  gap: 10px;
}
.car-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.car-btn:hover { border-color: var(--lime-soft); background: rgba(202, 219, 0, 0.08); }
.car-btn:disabled { opacity: 0.3; pointer-events: none; }
.car-btn svg { width: 18px; height: 18px; }
.carousel {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  overflow-y: hidden; /* otherwise overflow-x forces y to auto and the track can be dragged vertically */
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin-right: calc(var(--pad) * -1);
  padding-right: var(--pad);
  scrollbar-width: none;

  --fade-size: 100px;
  --fade-r: 0px;

  --fade-mask: linear-gradient(to right,
    #000 0, #000 calc(100% - var(--fade-r)),
    rgba(0,0,0,.9) calc(100% - var(--fade-r) * .8), rgba(0,0,0,.68) calc(100% - var(--fade-r) * .6),
    rgba(0,0,0,.4) calc(100% - var(--fade-r) * .4), rgba(0,0,0,.22) calc(100% - var(--fade-r) * .2),
    rgba(0,0,0,.15) 100%);
  -webkit-mask-image: var(--fade-mask);
  mask-image: var(--fade-mask);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), --fade-r 0.6s ease; /* keeps the reveal-on-scroll transition */
}
.carousel.fade-right { --fade-r: var(--fade-size); }
/* registered so the fade width can animate instead of snapping */
@property --fade-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
.carousel::-webkit-scrollbar { display: none; }
.car-card {
  scroll-snap-align: start;
  flex: 0 0 clamp(240px, 30vw, 340px);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  padding: 0;
}
.car-card figure { margin: 0; border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 4/5; background: var(--panel); }
.car-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.car-card:hover img { transform: scale(1.06); }
.car-card figcaption { margin-top: 16px; }
.car-card .piece-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink); }
.car-card .piece-by { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }

/* ---------- GALLERY PAGE ---------- */
.gallery {
  background: var(--bg);
  border-bottom: 1px solid var(--panel-line);
}
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.filter-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-dim);
  transition: all 0.2s var(--ease);
}
.filter-btn:hover { border-color: var(--lime-soft); color: var(--ink); }
.filter-btn.active { background: var(--lime-soft); color: var(--btn-ink); border-color: var(--lime-soft); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;

  /* bottom fade that follows the viewport edge while more of the grid is below the fold;
     --fade-at (distance from the grid top to the viewport bottom) is set from JS */
  --fade-size: 160px;
  --fade-b: 0px;
  --fade-at: 100000px;
  --fade-mask: linear-gradient(to bottom,
    #000 0, #000 calc(var(--fade-at) - var(--fade-b)),
    rgba(0,0,0,.9) calc(var(--fade-at) - var(--fade-b) * .8), rgba(0,0,0,.68) calc(var(--fade-at) - var(--fade-b) * .6),
    rgba(0,0,0,.4) calc(var(--fade-at) - var(--fade-b) * .4), rgba(0,0,0,.22) calc(var(--fade-at) - var(--fade-b) * .2),
    rgba(0,0,0,.15) var(--fade-at));
  -webkit-mask-image: var(--fade-mask);
  mask-image: var(--fade-mask);
  transition: --fade-b 0.6s ease;
}
.gallery-grid.fade-bottom { --fade-b: var(--fade-size); }
@property --fade-b { syntax: "<length>"; inherits: false; initial-value: 0px; }
.g-item {
  border: none;
  background: var(--panel);
  padding: 0;
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.g-item.hidden { display: none; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.g-item:hover img { transform: scale(1.08); }
.g-item .g-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8, 12, 6, 0.85) 0%, rgba(8, 12, 6, 0) 55%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.g-item:hover .g-overlay { opacity: 1; }
.g-overlay span { font-family: var(--font-mono); font-size: 13px; color: var(--ink); text-align: left; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 9, 5, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  padding: 40px;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-inner { max-width: 1100px; width: 100%; text-align: center; }
.lightbox img { max-height: 76vh; margin: 0 auto; border-radius: var(--radius-s); }
.lightbox-caption { margin-top: 18px; font-family: var(--font-mono); font-size: 14px; color: var(--ink-dim); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(19, 28, 15, 0.8);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { border-color: var(--lime-soft); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-prev svg, .lightbox-next svg, .lightbox-close svg { width: 18px; height: 18px; }

/* ---------- CONTACT PAGE ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 6vw, 80px);
}
.contact-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--panel-line);
}
.contact-info-row:first-of-type { border-top: 1px solid var(--panel-line); }

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.contact-icon img { width: 22px; height: 22px; filter: brightness(0) invert(1);}
.contact-info-row a, .contact-info-row span.static { font-size: 16px; min-width: 0; overflow-wrap: break-word; }
.contact-info-row a:hover { color: var(--lime-soft); }

.socials { margin-top: 36px; }
.socials h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime-soft);
  margin-bottom: 16px;
}
.social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.social-row a {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.social-row a img { width: 22px; height: 22px; filter: brightness(0) invert(1);}
.social-row a:hover { border-color: var(--lime-soft); color: var(--lime-soft); transform: translateY(-3px); }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  width: 100%;
  transition: border-color 0.2s var(--ease);
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { border-color: var(--lime-soft); outline: none; }
textarea.field { resize: vertical; min-height: 140px; }
.form-foot { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.form-note { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); }
.field.invalid { border-color: rgba(224, 138, 106, 0.7); }
.field.invalid:focus { border-color: #e08a6a; }
.field.shake { animation: fieldShake 0.4s var(--ease); }
@keyframes fieldShake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Send button: label + paper plane, swapped for a spinner while sending */
.btn-send { position: relative; }
.btn-send .btn-icon { transition: transform 0.35s var(--ease), opacity 0.2s var(--ease); }
.btn-send:hover .btn-icon { transform: translate(2px, -2px); }
.btn-spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(22, 33, 15, 0.25);
  border-top-color: var(--btn-ink);
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.7s linear infinite;
  transition: opacity 0.2s var(--ease);
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-send.is-loading { pointer-events: none; }
.btn-send.is-loading .btn-label,
.btn-send.is-loading .btn-icon { opacity: 0; }
.btn-send.is-loading .btn-spinner { opacity: 1; }
.btn-send .btn-label { transition: opacity 0.2s var(--ease); }
.btn-send:disabled:not(.is-loading) { opacity: 0.6; }

/* Status pill, styled like the hero badge */
.form-status {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
  border: 1px solid var(--panel-line);
  background: rgba(19, 28, 15, 0.6);
  padding: 8px 14px;
  border-radius: 18px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.form-status:empty { display: none; }
.form-status.show { opacity: 1; transform: translateY(0); }
.form-status::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  transform: translateY(-1px);
}
.form-status.err { color: #eab29c; border-color: rgba(224, 138, 106, 0.35); }
.form-status.err::before { background: #e08a6a; }
.form-status a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.form-status a:hover { color: var(--lime-soft); }

/* Success panel, swaps in for the form */
.contact-form-wrap { position: relative; }
.contact-form { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.contact-form[hidden] { display: none; }
.contact-form.leaving { opacity: 0; transform: translateY(-8px); }
.form-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-m);
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(202, 219, 0, 0.10), transparent 60%),
    var(--panel);
  animation: heroFadeUp 0.6s var(--ease) both;
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime-soft);
  border: 1px solid rgba(202, 215, 127, 0.3);
  padding: 8px 14px;
  border-radius: 999px;
}
.form-success-badge .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 2.4s infinite;
}
.form-success-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 500;
}
.form-success-text { color: var(--ink-dim); font-size: 15px; margin-bottom: 8px; }

/* ---------- FOOTER ---------- */
.site-footer {
  padding: 40px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--lime-soft); }
.to-top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  display: grid;
  place-items: center;
}
.to-top:hover { border-color: var(--lime-soft); }
.to-top svg { width: 16px; }

/* ---------- RESPONSIVENESS ---------- */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-photo { max-width: 340px; aspect-ratio: 1/1; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .about-facts { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-headline { gap: 12px; }
  .lightbox { padding: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
  .viewer-expand span { display: none; }
  .viewer-expand { padding: 9px; }
  .field { font-size: 16px; } /* prevents iOS zoom on focus */
  .nav-overlay-foot { flex-direction: column; align-items: center; }
  .nav-overlay-foot .sep { display: none; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 14px; }
  .brand-logo { width: 180px; }
  .menu-btn { width: 46px; height: 46px; }
  .site-header.scrolled { top: 10px; left: 16px; right: 16px; padding: 6px 10px 6px 18px; }
  .about-tag { left: -6px; bottom: -14px; }
  .lightbox { padding: 12px; }
  .lightbox-prev, .lightbox-next, .lightbox-close { width: 40px; height: 40px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .project-close { top: 14px; right: 14px; width: 42px; height: 42px; }
  .project-body { padding-top: 76px; }

  /* smaller type for narrow phones */
  .eyebrow { font-size: 18px; margin-bottom: 10px; }
  .section-title { font-size: 26px; }
  .section-desc { font-size: 14.5px; }
  .section-head { margin-bottom: 32px; }
  .hero-headline { font-size: clamp(40px, 14vw, 52px); }
  .hero-photo { width: 72px; height: 86px; }
  .hero-badge { font-size: 12px; margin-bottom: 32px; }
  .hero-sub { font-size: 14.5px; margin-top: 26px; }
  .hero-cta { margin-top: 32px; }
  .btn { padding: 12px 22px; font-size: 13.5px; }
  .about-intro { font-size: 18px; margin-bottom: 32px; }
  .about-fact h3 { font-size: 16px; }
  .about-fact p, .process-list p { font-size: 13.5px; }
  .feat-title { font-size: 19px; }
  .feat-info { left: 18px; right: 18px; bottom: 18px; }
  .car-card { flex-basis: 220px; }
  .car-card .piece-title { font-size: 15.5px; }
  .carousel { gap: 14px; --fade-size: 48px; }
  .filter-btn { padding: 8px 14px; font-size: 12.5px; }
  .gallery-grid { gap: 10px; --fade-size: 100px; }
  .contact-info-row { gap: 12px; }
  .contact-info-row a, .contact-info-row span.static { font-size: 14px; }
  .project-process h4 { font-size: 18px; }
  .process-list li { grid-template-columns: 34px 1fr; gap: 12px; }
  .site-footer { font-size: 12px; }
}
