:root {
  --black: #0a0a0a;
  --black-light: #111111;
  --black-card: #161616;
  --black-border: #222222;
  --gold: #F5C84C;
  --gold-dim: #c9a832;
  --gold-glow: rgba(245, 200, 76, 0.15);
  --gold-glow-strong: rgba(245, 200, 76, 0.35);
  --white: #f0ece4;
  --white-dim: #a8a49c;
  --gray: #666;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) var(--black);
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ── GLOBAL NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── SELECTION ── */
::selection { background: var(--gold); color: var(--black); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 300; line-height: 1.15; }
h1 { font-size: clamp(2.8rem, 7vw, 6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
p { font-size: clamp(0.95rem, 1.1vw, 1.1rem); color: var(--white-dim); max-width: 60ch; }
a { color: var(--gold); text-decoration: none; transition: all 0.4s var(--ease-out-expo); }
a:hover { color: var(--white); }

.accent { color: var(--gold); }
.small-caps { font-variant: small-caps; letter-spacing: 0.15em; font-size: 0.85rem; color: var(--gold-dim); font-weight: 500; }

/* ── LAYOUT ── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1.5rem, 4vw, 3rem); }
.section { padding: clamp(5rem, 10vh, 8rem) 0; position: relative; }

/* ── NAVIGATION ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 1.2rem 0;
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: all 0.5s var(--ease-out-expo);
}
.nav.scrolled { border-bottom-color: var(--black-border); background: rgba(10,10,10,0.9); }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; color: var(--white); }
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; gap: 2.5rem; align-items: center; list-style: none; }
.nav-links a {
  font-size: 0.85rem; font-weight: 400; color: var(--white-dim);
  letter-spacing: 0.08em; text-transform: uppercase; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--gold); transition: width 0.4s var(--ease-out-expo);
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.lang-switch {
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.4rem 1rem; border: 1px solid var(--black-border); border-radius: 100px;
  cursor: pointer; color: var(--white-dim); background: transparent;
  transition: all 0.4s var(--ease-out-expo); font-family: var(--font-body);
}
.lang-switch:hover { border-color: var(--gold); color: var(--gold); }

/* Mobile menu */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
  display: block; width: 24px; height: 1.5px; background: var(--white);
  transition: all 0.3s ease; margin: 6px 0;
}

/* ── HERO ── */
.hero {
  min-height: 100vh; display: flex; align-items: center; position: relative;
  overflow: hidden; padding-top: 5rem;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center; background-attachment: fixed;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.7) 50%, rgba(10,10,10,0.85) 100%);
}
.hero-content { position: relative; z-index: 1; }
.hero-label { margin-bottom: 1.5rem; }
.hero h1 { margin-bottom: 1.5rem; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero-desc { font-size: clamp(1rem, 1.3vw, 1.2rem); margin-bottom: 2.5rem; max-width: 50ch; }
.hero-avatar {
  width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--gold-dim);
  object-fit: cover; margin-bottom: 2rem;
  box-shadow: 0 0 40px var(--gold-glow);
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 2.2rem; font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; border-radius: 2px;
  transition: all 0.5s var(--ease-out-expo); cursor: pointer; border: none;
  font-family: var(--font-body); position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--gold); color: var(--black);
}
.btn-primary:hover { background: var(--white); color: var(--black); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(245,200,76,0.2); }
.btn.success { background: #63E6A7 !important; color: #0a0a0a !important; border-color: #63E6A7 !important; pointer-events: none; }
.btn-outline {
  background: transparent; color: var(--gold); border: 1px solid var(--gold-dim);
}
.btn-outline:hover { background: var(--gold); color: var(--black); transform: translateY(-2px); }

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 4rem; }
.section-header .small-caps { margin-bottom: 0.8rem; display: block; }
.section-header h2 { margin-bottom: 1rem; }
.section-divider {
  width: 60px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent);
  margin-top: 1.5rem;
}

/* ── ABOUT GRID ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-image { position: relative; }
.about-image img {
  width: 100%; border-radius: 4px; filter: grayscale(20%);
  transition: filter 0.5s ease;
}
.about-image:hover img { filter: grayscale(0%); }
.about-image::before {
  content: ''; position: absolute; inset: -12px; border: 1px solid var(--gold-dim);
  border-radius: 4px; opacity: 0.3; z-index: -1;
}
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); font-weight: 300; }
.stat-label { font-size: 0.75rem; color: var(--white-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.3rem; }

/* ── TILT CARD ── */
.tilt-card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: 6px; overflow: hidden; position: relative;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
  transform-style: preserve-3d; will-change: transform;
}
.tilt-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--gold-glow);
}
.tilt-card .card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}
.tilt-card:hover .card-img { transform: scale(1.05); }
.tilt-card .card-body { padding: 1.5rem; transform: translateZ(20px); }
.tilt-card .card-tag { margin-bottom: 0.6rem; display: inline-block; }
.tilt-card .card-title { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--white); }
.tilt-card .card-desc { font-size: 0.9rem; }

/* ── CASES SLIDER ── */
.cases-slider { position: relative; overflow: hidden; padding: 30px 10px; margin: -30px -10px; }
.cases-track { display: flex; gap: 2rem; transition: transform 0.7s var(--ease-out-expo); }
.cases-track .tilt-card { flex: 0 0 calc(33.333% - 1.333rem); width: calc(33.333% - 1.333rem); }
.slider-controls { display: flex; gap: 1rem; margin-top: 2rem; }
.slider-btn {
  width: 48px; height: 48px; border: 1px solid var(--black-border);
  background: var(--black-card); color: var(--white); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1.2rem; transition: all 0.4s var(--ease-out-expo);
}
.slider-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(245,200,76,0.08); }

/* ── PROJECT CARDS ── */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* ── SKILLS / TOOLS ── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.skill-item {
  padding: 1.5rem; border: 1px solid var(--black-border); border-radius: 4px;
  background: var(--black-card); text-align: center;
  transition: all 0.4s var(--ease-out-expo);
}
.skill-item:hover { border-color: var(--gold-dim); transform: translateY(-4px); }
.skill-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.skill-name { font-size: 0.9rem; font-weight: 500; color: var(--white); }

/* ── TIMELINE ── */
#timeline .container { position: relative; }
#timeline .container::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 45%;
  background: url('assets/oyu-bg.avif') repeat-y right top; background-size: cover;
  opacity: 0.15; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}
.timeline { position: relative; padding-left: 2.5rem; max-width: 60%; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: linear-gradient(180deg, var(--gold-dim), var(--black-border));
}
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.5rem; top: 0.6rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow-strong);
}
.timeline-date { font-size: 0.8rem; color: var(--gold-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.4rem; }
.timeline-title { font-size: 1.2rem; color: var(--white); margin-bottom: 0.5rem; font-family: var(--font-display); }
.timeline-desc { font-size: 0.9rem; }

/* ── GALLERY / HOBBIES ── */
.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem;
}
.gallery-item {
  overflow: hidden; border-radius: 4px; position: relative; cursor: pointer;
  aspect-ratio: 1; 
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo), filter 0.5s ease;
  filter: grayscale(30%) brightness(0.8);
}
.gallery-item:hover img { transform: scale(1.1); filter: grayscale(0%) brightness(1); }
.gallery-overlay {
  position: absolute; inset: 0; background: rgba(10,10,10,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.5s var(--ease-out-expo); padding: 1.5rem; text-align: center;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-text {
  color: var(--gold);
  font-size: 0.95rem;
  font-family: var(--font-body);
  letter-spacing: 0.05em;
  transform: translateY(15px);
  transition: transform 0.5s var(--ease-out-expo);
}
.gallery-item:hover .gallery-text { transform: translateY(0); }
.gallery-item.wide { grid-column: span 2; aspect-ratio: 2/1; }

/* ── QUOTE BLOCK ── */
.quote-block {
  text-align: center; padding: 5rem 2rem; position: relative;
}
.quote-block blockquote {
  font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-style: italic; font-weight: 300; color: var(--white); max-width: 700px;
  margin: 0 auto; line-height: 1.4;
}
.quote-block cite {
  display: block; margin-top: 1.5rem; font-size: 0.85rem;
  color: var(--gold-dim); font-style: normal; letter-spacing: 0.1em;
}

/* ── CONTACT ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-links { list-style: none; }
.contact-links li { margin-bottom: 1.5rem; }
.contact-links a {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem;
  border: 1px solid var(--black-border); border-radius: 4px;
  transition: all 0.4s var(--ease-out-expo); color: var(--white);
}
.contact-links a:hover { border-color: var(--gold); background: rgba(245,200,76,0.05); transform: translateX(8px); }
.contact-links .link-icon { font-size: 1.4rem; color: var(--gold); }
.contact-links .link-label { font-size: 0.75rem; color: var(--white-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-links .link-value { font-size: 1rem; color: var(--white); }
.contact-response-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--black-border);
  border-radius: 6px;
  background: var(--black-card);
  color: var(--white);
}
.contact-response-note .link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  border: 1px solid rgba(245,200,76,0.22);
  color: var(--gold);
  background: rgba(0,0,0,0.22);
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
}
.contact-response-note .link-label {
  font-size: 0.75rem;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}
.contact-response-note .link-value {
  font-size: 1rem;
  color: var(--white);
}


.contact-form input, .contact-form textarea {
  width: 100%; padding: 1rem 1.2rem; background: var(--black-card);
  border: 1px solid var(--black-border); border-radius: 4px;
  color: var(--white); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.3s ease; margin-bottom: 1rem; outline: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--gold); }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--black-border); padding: 3rem 0;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; }
.footer-brand span { color: var(--gold); }
.footer-socials { display: flex; gap: 1.5rem; }
.footer-socials a {
  width: 40px; height: 40px; border: 1px solid var(--black-border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white-dim); font-size: 1rem;
  transition: all 0.4s var(--ease-out-expo);
}


.brand-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex: 0 0 auto;
}
.brand-instagram { color: #E4405F; }
.brand-telegram { color: #26A5E4; }
.brand-youtube { color: #FF0000; }
.brand-linkedin { color: #0A66C2; }
.contact-card .brand-icon {
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
}
.contact-links .brand-icon {
  width: 1.45rem;
  height: 1.45rem;
}
.footer-socials a:hover { border-color: var(--gold); transform: translateY(-3px); background: rgba(245,200,76,0.06); }

.footer-copy { font-size: 0.8rem; color: var(--gray); width: 100%; text-align: center; margin-top: 1.5rem; }

/* ── PARALLAX -> HOVER EFFECT ── */
.parallax-section {
  position: relative; min-height: 50vh; display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}
.parallax-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  transition: transform 2.5s var(--ease-out-expo);
}
.parallax-section:hover .parallax-bg {
  transform: scale(1.05);
}
.parallax-bg::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(10,10,10,0.88);
}
.parallax-content { position: relative; z-index: 1; }

/* ── SCROLL ANIMATIONS ── */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* stagger children */
.stagger > * { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo); }
.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger.visible > * { opacity: 0; transform: translateY(20px); }
.stagger.visible > * { opacity: 1; transform: translateY(0); }

/* Skills cards should enter as one clean row, without the CAD card finishing late. */
.skills-grid.stagger.visible > * {
  transition-delay: 0s !important;
}


/* ── PAGE HEADER (for sub-pages) ── */
.page-header {
  padding: 10rem 0 4rem; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
}
.page-header::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  transform: translate(-50%, -50%); pointer-events: none;
}

/* ── CASES PAGE ── */
.cases-filters { display: flex; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.5rem 1.5rem; border: 1px solid var(--black-border);
  background: transparent; color: var(--white-dim); border-radius: 100px;
  font-size: 0.8rem; letter-spacing: 0.05em; cursor: pointer;
  transition: all 0.3s ease; font-family: var(--font-body);
}
.filter-btn:hover, .filter-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(245,200,76,0.08); }

.cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 2rem; }
.case-card-large {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: 6px; overflow: hidden; transition: all 0.5s var(--ease-out-expo);
}
.case-card-large:hover { border-color: var(--gold-dim); transform: translateY(-6px); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.case-card-large img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.case-card-large .case-info { padding: 2rem; }
.case-card-large .case-tags { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.case-tag {
  padding: 0.25rem 0.8rem; border: 1px solid var(--black-border);
  border-radius: 100px; font-size: 0.7rem; color: var(--gold-dim);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.case-card-large h3 { margin-bottom: 0.8rem; }
.case-card-large p { margin-bottom: 1.5rem; }

/* ── CONTACT PAGE ── */
.contact-hero { text-align: center; }
.contact-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.contact-card {
  padding: 2.5rem; border: 1px solid var(--black-border); border-radius: 6px;
  background: var(--black-card); text-align: center;
  transition: all 0.4s var(--ease-out-expo);
}
.contact-card:hover { border-color: var(--gold); transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.3); }
.contact-card .card-icon { font-size: 2rem; color: var(--gold); margin-bottom: 1rem; }
.contact-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .cases-track .tilt-card { flex: 0 0 calc(50% - 1rem); width: calc(50% - 1rem); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(10,10,10,0.97); flex-direction: column; align-items: center; justify-content: center; gap: 2rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .cases-track .tilt-card { flex: 0 0 100%; width: 100%; }
  .projects-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.wide { grid-column: span 2; }
  .hero-bg { background-attachment: scroll; }
  .footer-inner { flex-direction: column; text-align: center; }
  .timeline { max-width: 100%; }
  #timeline .container::after { opacity: 0.05; width: 100%; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.wide { grid-column: span 1; }
  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .btn { width: 100%; justify-content: center; }
}

/* ── CUSTOM CURSOR ── */
@media (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea, .tilt-card, .gallery-item { cursor: none !important; }
  #custom-cursor {
    position: fixed; top: 0; left: 0; width: 6px; height: 6px;
    background: var(--gold); border-radius: 50%;
    pointer-events: none; z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background 0.3s, opacity 0.3s;
    will-change: transform;
    opacity: 0;
  }
  #custom-cursor-ring {
    position: fixed; top: 0; left: 0; width: 34px; height: 34px;
    border: 1px solid var(--gold-dim); border-radius: 50%;
    pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s, opacity 0.3s;
    will-change: transform;
    opacity: 0;
  }
  #custom-cursor.hover { width: 4px; height: 4px; }
  #custom-cursor-ring.hover {
    width: 50px; height: 50px; border-color: var(--gold);
    background: rgba(245, 200, 76, 0.08);
  }
}


/* ── PERFORMANCE PATCH ── */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

body::before {
  display: none;
}

.nav {
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.hero-bg {
  background-attachment: scroll;
  transform: translateZ(0);
}

.section,
.parallax-section {
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.hero,
.nav,
.footer {
  content-visibility: visible;
}

.tilt-card,
.case-card-large,
.skill-item,
.contact-card {
  contain: paint;
  will-change: auto;
  backface-visibility: hidden;
}

.tilt-card {
  transform-style: flat;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.tilt-card:hover {
  transform: translateY(-4px);
}

.tilt-card .card-body {
  transform: none;
}

.tilt-card .card-img,
.gallery-item img {
  transform: translateZ(0);
}

.gallery-item img {
  filter: none;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.035);
  filter: none;
}

.gallery-overlay {
  background: rgba(10,10,10,0.74);
  transition: opacity 0.25s ease;
}

.icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
  font: inherit;
  line-height: 1;
}

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

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── MOBILE / UX PATCH ── */
.nav .container {
  gap: 1rem;
}
.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1003;
}
.card-link,
a.tilt-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.tilt-card:focus-visible,
.hero-scroll:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.4rem);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(245, 200, 76, 0.35);
  background: rgba(10, 10, 10, 0.34);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), 0 0 24px rgba(245, 200, 76, 0.08);
  transform: translateX(-50%);
  opacity: 1;
  transition: opacity 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
}
.hero-scroll span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1;
  animation: heroArrowFloat 1.65s ease-in-out infinite;
}
.hero-scroll:hover {
  border-color: var(--gold);
  background: rgba(245, 200, 76, 0.1);
  color: var(--gold);
}
.hero-scroll.is-hidden {
  opacity: 0;
  pointer-events: none;
}
@keyframes heroArrowFloat {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(5px); }
}
.slider-btn {
  flex: 0 0 48px;
  min-width: 48px;
  line-height: 1;
}
.slider-btn .icon-mark {
  width: 1em;
  height: 1em;
  min-width: 1em;
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
}

@media (max-width: 768px) {
  .nav {
    padding: 0.85rem 0;
    background: rgba(10, 10, 10, 0.88);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav .container {
    justify-content: space-between;
  }
  .nav-logo {
    position: relative;
    z-index: 1003;
  }
  .nav-actions .lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 0.9rem;
    background: rgba(10,10,10,0.45);
    border-color: rgba(245, 200, 76, 0.22);
  }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(245, 200, 76, 0.18);
    background: rgba(10,10,10,0.48);
  }
  .nav-toggle span {
    width: 20px;
    height: 1.5px;
    margin: 3px 0;
  }
  .nav-links {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1001;
    min-height: 100dvh;
    width: 100vw;
    padding: 7.5rem 1.5rem 2rem;
    background: linear-gradient(180deg, rgba(10,10,10,0.98), rgba(13,13,13,0.96));
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.55rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links a {
    font-size: 1rem;
    color: var(--white);
  }
  body.menu-open {
    overflow: hidden;
  }
  .slider-controls {
    align-items: center;
    flex-wrap: wrap;
  }
  .slider-controls .btn {
    width: auto;
    margin-left: 0 !important;
  }
  .section,
  .parallax-section {
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }
  .section .reveal,
  .section .reveal-left,
  .section .reveal-right,
  .section .reveal-scale,
  .section.stagger,
  .section .stagger,
  .section .stagger > *,
  .parallax-section .reveal,
  .parallax-section .reveal-left,
  .parallax-section .reveal-right,
  .parallax-section .reveal-scale,
  .footer .reveal,
  .footer .reveal-left,
  .footer .reveal-right,
  .footer .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-scroll {
    width: 42px;
    height: 42px;
    bottom: 1.2rem;
  }
}

@media (max-width: 480px) {
  .slider-controls {
    gap: 0.75rem;
  }
  .slider-btn {
    flex: 0 0 46px;
    min-width: 46px;
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }
  .slider-controls .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ── Final contact/mobile ordering + no card entrance reveals ── */
.cards-static .tilt-card,
.cards-static .gallery-item,
.cases-track .tilt-card,
.projects-grid .tilt-card,
.gallery-grid .gallery-item {
  opacity: 1;
}

@media (max-width: 768px) {
  .contact-layout {
    display: flex;
    flex-direction: column;
  }
  .contact-layout .contact-grid {
    order: 1;
  }
  .contact-layout .contact-methods {
    order: 2;
    margin-top: 2rem;
    margin-bottom: 0 !important;
  }
}

/* ── HOME: PLUGIN ECOSYSTEM ──────────────────────────────────────── */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.eco-card {
  display: block;
  padding: 1.8rem 1.6rem;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.eco-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-4px);
  color: inherit;
}
.eco-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 2px; width: 30px;
  background: var(--gold);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.eco-card:hover::before { width: 100%; }
.eco-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.eco-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.eco-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--white-dim);
  margin: 0;
}
.eco-tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--black-border);
  border-radius: 100px;
}

/* ── HOME: PROCESS / HOW I BUILD ─────────────────────────────────── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 2.5rem;
  counter-reset: process;
}
.process-step {
  padding: 2rem 1.5rem;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: 4px;
  counter-increment: process;
  position: relative;
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.process-step:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
}
.process-step::before {
  content: counter(process, decimal-leading-zero);
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
}
.process-step h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.process-step p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--white-dim);
}
@media (max-width: 900px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .process-grid { grid-template-columns: 1fr; }
}

/* ── HOME: PRINCIPLES (small inline cards) ───────────────────────── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.principle {
  padding: 1.4rem 1.5rem;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  transition: border-color 0.4s ease;
}
.principle:hover { border-color: var(--gold-dim); border-left-color: var(--gold); }
.principle-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.principle h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.principle p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--white-dim);
  margin: 0;
}

/* ── HOME: METRICS STRIP ─────────────────────────────────────────── */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 2.5rem 0;
  border-top: 1px solid var(--black-border);
  border-bottom: 1px solid var(--black-border);
}
.metric {
  padding: 1.8rem 1.5rem;
  text-align: left;
  border-right: 1px solid var(--black-border);
}
.metric:last-child { border-right: none; }
.metric-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  color: var(--gold);
  line-height: 1;
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.metric-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white-dim);
}
@media (max-width: 768px) {
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--black-border); }
}

/* ── PROJECTS PAGE: CATEGORY SECTION HEADER ──────────────────────── */
.section-eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-eyebrow .small-caps { margin: 0; }
.section-eyebrow .count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--white-dim);
  letter-spacing: 0.05em;
}

/* Projects 6-card grid — needs 3 columns for cases */
@media (min-width: 1025px) {
  .projects-grid.cases-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Card meta tag (status / category indicator) */
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--white-dim);
}
.card-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}
.card-meta-dot.live { background: #63E6A7; box-shadow: 0 0 6px #63E6A7; }


/* ── SEO alias line + Telegram contact form states ── */
.hero-aliases {
  margin: -0.4rem 0 1rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.response-clock svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.form-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.form-status {
  min-height: 1.35rem;
  margin-top: 0.85rem;
  color: var(--white-dim);
  font-size: 0.9rem;
  text-align: center;
}
.form-status[data-state="success"] { color: var(--green); }
.form-status[data-state="error"] { color: var(--red); }
button[disabled] { opacity: 0.68; cursor: wait; }

@media (max-width: 480px) {
  .slider-controls {
    display: grid;
    grid-template-columns: 46px 46px;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
  }
  .slider-btn,
  .slider-controls .slider-btn,
  .slider-prev,
  .slider-next {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    flex: 0 0 46px !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
  }
  .slider-controls .btn {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0 !important;
  }
}
