/* ==========================================================
   Mirsaidov I.T. — Portfolio
   Palette: qora · to‘q qizil · kulrang · yashil
   ========================================================== */
:root {
  --black: #0a0a0b;
  --black-2: #111113;
  --black-3: #17171a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --gray-1: #e9e7e3;
  --gray-2: #a9a8ad;
  --gray-3: #6c6b71;
  --gray-4: #3a3a3f;
  --red: #c21f3a;
  --red-deep: #7a0f1c;
  --red-ink: #3a0710;
  --green: #2fbf7f;
  --green-deep: #135c3e;
  --green-ink: #0b2a1d;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(20px, 5vw, 80px);
  --max: 1320px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--gray-1);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
img, canvas { display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
strong { color: #fff; font-weight: 600; }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 90; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(3%, -6%); }
  60% { transform: translate(-7%, -2%); }
  80% { transform: translate(5%, 5%); }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-content: center; justify-items: center; gap: 28px;
  background: var(--black);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__board {
  display: grid; grid-template-columns: repeat(4, 22px); grid-template-rows: repeat(4, 22px);
  transform: rotateX(55deg) rotateZ(45deg);
}
.loader__board span { animation: tile 1.6s var(--ease) infinite; }
.loader__board span:nth-child(odd) { background: var(--red-deep); }
.loader__board span:nth-child(even) { background: var(--gray-4); }
.loader__board span:nth-child(4n+1), .loader__board span:nth-child(4n+3) { }
.loader__board span:nth-child(5), .loader__board span:nth-child(7),
.loader__board span:nth-child(13), .loader__board span:nth-child(15) { background: var(--gray-4); }
.loader__board span:nth-child(6), .loader__board span:nth-child(8),
.loader__board span:nth-child(14), .loader__board span:nth-child(16) { background: var(--red-deep); }
.loader__board span:nth-child(n) { animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes tile {
  0%, 100% { transform: translateZ(0); filter: brightness(1); }
  50% { transform: translateY(-6px); filter: brightness(1.6); }
}
.loader__text { font-size: 12px; color: var(--gray-2); text-transform: uppercase; letter-spacing: 0.2em; }
.loader__dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.loader__bar { width: 180px; height: 1px; background: var(--gray-4); overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.4s var(--ease); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1px solid rgba(233, 231, 227, 0.5); border-radius: 50%;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), border-color 0.35s, background 0.35s;
  mix-blend-mode: difference;
}
.cursor i {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px;
  border-radius: 50%; background: #fff;
}
.cursor.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255,255,255,0.08); border-color: #fff; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  transition: padding 0.4s var(--ease), background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.nav__logo em { font-style: italic; color: var(--red); margin-left: 6px; font-weight: 500; }
.nav__glyph {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line-2); border-radius: 50%;
  font-size: 20px; color: var(--gray-1);
  transition: transform 0.6s var(--ease), border-color 0.3s;
}
.nav__logo:hover .nav__glyph { transform: rotate(-20deg); border-color: var(--red); }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); font-size: 14px; }
.nav__links a { position: relative; color: var(--gray-2); transition: color 0.3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: #fff; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__links .nav__cta {
  padding: 8px 18px; border: 1px solid var(--line-2); border-radius: 100px; color: #fff;
}
.nav__links .nav__cta::after { display: none; }
.nav__links .nav__cta:hover { background: var(--red); border-color: var(--red); }
.nav__burger { display: none; }

@media (max-width: 900px) {
  .nav__burger {
    display: grid; gap: 6px; width: 44px; height: 44px; place-content: center;
    background: none; border: 1px solid var(--line-2); border-radius: 50%; cursor: pointer;
  }
  .nav__burger span { width: 18px; height: 1px; background: #fff; transition: transform 0.4s var(--ease); }
  .nav.is-open .nav__burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 22px;
    background: rgba(10, 10, 11, 0.97); font-family: var(--serif); font-size: 34px;
    opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav__links .nav__cta { font-size: 22px; padding: 10px 28px; }
}

/* ---------- Buttons / small bits ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 100px; font-size: 15px; font-weight: 500;
  transition: background 0.35s, border-color 0.35s, color 0.35s, transform 0.35s var(--ease);
  will-change: transform;
}
.btn span { transition: transform 0.35s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 10px 40px -10px rgba(194, 31, 58, 0.7); }
.btn--primary:hover { background: #d62a47; }
.btn--ghost { border: 1px solid var(--line-2); color: #fff; backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--green { background: var(--green); box-shadow: 0 0 12px var(--green); }
.dot--red { background: var(--red); box-shadow: 0 0 12px var(--red); }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gray-2);
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10,10,11,0.92) 0%, rgba(10,10,11,0.55) 32%, rgba(10,10,11,0) 58%),
    linear-gradient(0deg, var(--black) 0%, rgba(10,10,11,0) 24%),
    linear-gradient(180deg, rgba(10,10,11,0.6) 0%, rgba(10,10,11,0) 18%);
}
.hero__content {
  position: absolute; left: var(--pad); bottom: clamp(90px, 16vh, 170px);
  max-width: 600px; z-index: 2;
}
.hero__title {
  margin: 22px 0 24px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(64px, 10.5vw, 168px); line-height: 0.86; letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > * { display: inline-block; transform: translateY(110%); transition: transform 1.3s var(--ease); }
.hero__title em { color: var(--red); font-style: italic; padding-left: 0.6em; }
.is-ready .hero__title .line > * { transform: none; }
.is-ready .hero__title .line:nth-child(2) > * { transition-delay: 0.12s; }
.hero__lead { max-width: 470px; color: var(--gray-2); font-size: clamp(15px, 1.2vw, 18px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__content > *:not(.hero__title) { opacity: 0; transform: translateY(20px); transition: opacity 1s var(--ease) 0.4s, transform 1s var(--ease) 0.4s; }
.is-ready .hero__content > * { opacity: 1; transform: none; }

.hud {
  position: absolute; right: var(--pad); top: 50%; transform: translateY(-50%);
  width: 250px; z-index: 2;
  padding: 20px; border: 1px solid var(--line); border-radius: 18px;
  background: rgba(17, 17, 19, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 1.2s var(--ease) 0.8s;
}
.is-ready .hud { opacity: 1; }
.hud__head { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hud__head .dot { margin-top: 6px; flex: none; }
.hud__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--gray-3); }
.hud__title { font-family: var(--serif); font-size: 19px; line-height: 1.2; margin-top: 2px; }
.hud__moves {
  list-style: none; margin: 12px 0; padding: 0;
  display: grid; grid-template-columns: 26px 1fr 1fr; row-gap: 3px;
  font-size: 12px; height: 170px; overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
  align-content: end;
}
.hud__moves li { display: contents; }
.hud__moves .n { color: var(--gray-3); }
.hud__moves .w, .hud__moves .b { color: var(--gray-2); transition: color 0.3s; }
.hud__moves .is-current { color: var(--green); text-shadow: 0 0 10px rgba(47, 191, 127, 0.6); }
.hud__moves .is-mate { color: var(--red); text-shadow: 0 0 10px rgba(194, 31, 58, 0.7); }
.hud__note { font-size: 12px; color: var(--gray-3); line-height: 1.5; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--gray-3);
}
.hero__scroll i { width: 1px; height: 42px; background: linear-gradient(var(--gray-3), transparent); position: relative; overflow: hidden; }
.hero__scroll i::after {
  content: ""; position: absolute; top: -40%; left: 0; width: 1px; height: 40%; background: var(--red);
  animation: scrollLine 2s var(--ease) infinite;
}
@keyframes scrollLine { to { top: 110%; } }

@media (max-width: 1100px) { .hud { display: none; } }
@media (max-width: 700px) {
  .hero__vignette {
    background: linear-gradient(0deg, var(--black) 8%, rgba(10,10,11,0.7) 45%, rgba(10,10,11,0.15) 75%), linear-gradient(180deg, rgba(10,10,11,0.6), transparent 20%);
  }
  .hero__content { right: var(--pad); bottom: 80px; }
  .hero__scroll { display: none; }
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 42px 22px; border-left: 1px solid var(--line); position: relative; overflow: hidden; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--green)); transform: scaleX(0); transform-origin: left;
  transition: transform 0.8s var(--ease);
}
.stat:hover::before { transform: scaleX(1); }
.stat__num { font-family: var(--serif); font-size: clamp(48px, 5vw, 76px); line-height: 1; color: #fff; }
.stat p { margin-top: 12px; font-size: 13px; color: var(--gray-3); line-height: 1.5; }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 28px 18px; border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:first-child, .stat:nth-child(2) { border-top: 0; }
  .stat:first-child { padding-left: 18px; }
  .stat:last-child { grid-column: span 2; }
}

/* ---------- Sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(90px, 13vw, 170px) var(--pad) 0; }
.section__head { margin-bottom: clamp(40px, 6vw, 72px); }
.section__index { font-size: 12px; color: var(--gray-3); letter-spacing: 0.15em; text-transform: uppercase; }
.section__index b { color: var(--red); font-weight: 500; text-transform: none; }
.section__title {
  margin-top: 14px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(44px, 6.4vw, 96px); line-height: 0.95; letter-spacing: -0.015em;
}
.section__sub { max-width: 560px; margin-top: 20px; color: var(--gray-2); }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about__grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 90px);
  grid-template-areas: "quote text" "facts text";
}
.about__quote {
  grid-area: quote; margin: 0; position: relative;
  font-family: var(--serif); font-size: clamp(28px, 3.1vw, 44px); line-height: 1.18; color: #fff;
}
.about__quote em { color: var(--green); }
.about__mark { position: absolute; left: -0.1em; top: -0.55em; font-size: 3.4em; line-height: 1; color: var(--red); opacity: 0.35; }
.about__text { grid-area: text; display: grid; gap: 20px; color: var(--gray-2); }
.about__facts { grid-area: facts; margin: 0; border-top: 1px solid var(--line); align-self: start; }
.about__facts div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.about__facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gray-3); padding-top: 3px; }
.about__facts dd { margin: 0; font-size: 15px; }
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; grid-template-areas: "quote" "text" "facts"; }
  .about__facts div { grid-template-columns: 110px 1fr; }
}

/* ---------- Courses ---------- */
.courses__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.course {
  grid-column: span 2; position: relative; overflow: hidden;
  min-height: 300px; padding: 30px; border-radius: 22px;
  background: var(--black-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color 0.5s, transform 0.6s var(--ease);
}
.course:nth-child(4), .course:nth-child(5) { grid-column: span 3; }
.course::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(194, 31, 58, 0.18), transparent 45%);
}
.course:hover { border-color: var(--line-2); transform: translateY(-4px); }
.course:hover::before { opacity: 1; }
.course__top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; }
.course__num { font-size: 12px; color: var(--gray-3); }
.course__glyph {
  font-size: 84px; line-height: 0.8; color: var(--gray-4);
  transition: color 0.5s, transform 0.8s var(--ease), text-shadow 0.5s;
}
.course:hover .course__glyph { color: var(--red); transform: translateY(-6px) rotate(-8deg); text-shadow: 0 0 30px rgba(194,31,58,0.5); }
.course:nth-child(even):hover .course__glyph { color: var(--green); text-shadow: 0 0 30px rgba(47,191,127,0.45); }
.course h3 { position: relative; font-family: var(--serif); font-size: 32px; line-height: 1.05; margin-bottom: 12px; }
.course p { position: relative; color: var(--gray-2); font-size: 14px; }
.course__role { position: relative; margin-top: 16px; font-size: 11px; color: var(--gray-3); text-transform: uppercase; letter-spacing: 0.15em; }
@media (max-width: 900px) {
  .courses__grid { grid-template-columns: 1fr; }
  .course, .course:nth-child(4), .course:nth-child(5) { grid-column: auto; min-height: 240px; }
}

/* ---------- Methods ---------- */
.methods__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; perspective: 1200px; }
.method {
  position: relative; overflow: hidden; padding: 34px 30px 110px;
  border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #1a1a1e, var(--black-2) 60%);
  transform-style: preserve-3d; transition: transform 0.25s ease-out, border-color 0.4s;
}
.method--red { background: linear-gradient(160deg, var(--red-ink), var(--black-2) 65%); }
.method--green { background: linear-gradient(160deg, var(--green-ink), var(--black-2) 65%); }
.method:hover { border-color: var(--line-2); }
.method__tag { font-size: 11px; color: var(--gray-3); text-transform: uppercase; letter-spacing: 0.15em; }
.method h3 { margin: 18px 0 14px; font-family: var(--serif); font-size: 44px; line-height: 1; }
.method h3 small { display: block; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--gray-2); letter-spacing: 0.08em; }
.method p { color: var(--gray-2); font-size: 14.5px; }
.method__glyph {
  position: absolute; right: 18px; bottom: -22px; font-size: 150px; line-height: 1;
  color: rgba(255,255,255,0.05); transform: translateZ(40px); transition: color 0.5s;
}
.method:hover .method__glyph { color: rgba(255,255,255,0.12); }
.method--red:hover .method__glyph { color: rgba(194,31,58,0.35); }
.method--green:hover .method__glyph { color: rgba(47,191,127,0.3); }

.repertoire {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(30px, 5vw, 80px);
  margin-top: clamp(60px, 8vw, 110px); padding-top: 40px; border-top: 1px solid var(--line);
}
.repertoire h3 { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; margin-bottom: 16px; }
.repertoire__intro p { color: var(--gray-2); }
.repertoire__list { list-style: none; margin: 0; padding: 0; }
.repertoire__list li {
  display: grid; grid-template-columns: 44px 1fr; column-gap: 12px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease), background 0.5s;
}
.repertoire__list li:hover { padding-left: 14px; background: linear-gradient(90deg, rgba(47,191,127,0.07), transparent 60%); }
.repertoire__list span { grid-row: span 2; color: var(--red); font-size: 12px; padding-top: 4px; }
.repertoire__list b { font-weight: 600; font-size: 17px; }
.repertoire__list i { font-style: normal; color: var(--gray-3); font-size: 14px; }

.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 70px);
  margin-top: clamp(50px, 7vw, 90px); padding: clamp(28px, 4vw, 52px);
  border-radius: 26px; border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(19, 92, 62, 0.35), transparent 70%),
    radial-gradient(500px 300px at 0% 100%, rgba(122, 15, 28, 0.35), transparent 70%),
    var(--black-2);
}
.project__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--green); }
.project h3 { font-family: var(--serif); font-size: clamp(36px, 4vw, 58px); line-height: 1; margin: 14px 0 18px; }
.project__meta p:last-child { color: var(--gray-2); }
.project__stack { display: grid; gap: 22px; align-content: center; }
.project__stack p { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gray-3); margin-bottom: 10px; }
.project__stack span, .chips span {
  display: inline-block; margin: 0 6px 8px 0; padding: 7px 14px;
  border: 1px solid var(--line-2); border-radius: 100px; font-size: 13px;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.project__stack span:hover, .chips span:hover { border-color: var(--green); color: var(--green); background: rgba(47,191,127,0.06); }
@media (max-width: 900px) {
  .methods__grid, .repertoire, .project { grid-template-columns: 1fr; }
}

/* ---------- Lab (Babylon) ---------- */
.lab { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; max-width: none; padding-left: 0; }
.lab__stage {
  position: relative; height: min(88vh, 820px); min-height: 480px;
  border-radius: 0 28px 28px 0; overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(19, 92, 62, 0.28), transparent 60%),
    radial-gradient(circle at 30% 80%, rgba(122, 15, 28, 0.25), transparent 50%),
    var(--black-2);
  border: 1px solid var(--line); border-left: 0;
}
.lab__canvas { width: 100%; height: 100%; outline: none; touch-action: none; }
.lab__tip {
  position: absolute; pointer-events: none; z-index: 2;
  padding: 7px 12px; border-radius: 8px; font-size: 12px;
  background: rgba(10,10,11,0.85); border: 1px solid var(--green); color: var(--green);
  transform: translate(-50%, -140%); opacity: 0; transition: opacity 0.2s;
  white-space: nowrap;
}
.lab__tip.is-on { opacity: 1; }
.lab__tip.is-red { border-color: var(--red); color: #ff6a80; }
.lab__hint { position: absolute; left: 24px; bottom: 20px; font-size: 11px; color: var(--gray-3); letter-spacing: 0.1em; }
.lab__content { max-width: 560px; padding-right: var(--pad); display: grid; gap: 20px; color: var(--gray-2); }
.lab__content .section__head { margin-bottom: 10px; }
.chips { margin-top: 6px; }
.chips--muted span { color: var(--gray-2); font-size: 12px; font-family: var(--mono); }
.infra { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.infra > p { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gray-3); margin-bottom: 12px; }
@media (max-width: 1000px) {
  .lab { grid-template-columns: 1fr; padding-left: var(--pad); }
  .lab__stage { border-radius: 24px; border-left: 1px solid var(--line); height: 70vh; min-height: 400px; order: 2; }
  .lab__content { padding-right: 0; order: 1; }
}

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 118px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-2), var(--red) 85%, var(--red)); }
.tl li { display: grid; grid-template-columns: 118px 1fr; gap: 44px; padding: 26px 0; position: relative; }
.tl li::before {
  content: ""; position: absolute; left: 113px; top: 36px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--black); border: 1px solid var(--gray-2); transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.tl li:hover::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 16px var(--green); }
.tl__year { font-size: 14px; color: var(--gray-2); padding-top: 6px; }
.tl h4 { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; margin-bottom: 8px; }
.tl p { color: var(--gray-2); max-width: 720px; }
.tl__mate::before { background: var(--red) !important; border-color: var(--red) !important; box-shadow: 0 0 20px var(--red) !important; }
.tl__mate .tl__year { color: var(--red); }
@media (max-width: 700px) {
  .tl::before { left: 5px; }
  .tl li { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .tl li::before { left: 0; top: 34px; }
}

/* ---------- Publications ---------- */
.pubs__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.pubs__filters button {
  font: inherit; font-size: 13px; color: var(--gray-2); cursor: pointer;
  padding: 9px 18px; border-radius: 100px; background: transparent; border: 1px solid var(--line-2);
  transition: all 0.3s;
}
.pubs__filters button sup { font-family: var(--mono); font-size: 10px; margin-left: 4px; color: var(--gray-3); }
.pubs__filters button:hover { color: #fff; border-color: var(--gray-2); }
.pubs__filters button.is-active { background: var(--gray-1); border-color: var(--gray-1); color: var(--black); }
.pubs__filters button.is-active sup { color: var(--red); }
.pubs__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: pub; }
.pub {
  display: grid; grid-template-columns: 56px 1fr 150px; gap: 24px; align-items: start;
  padding: 24px 0; border-bottom: 1px solid var(--line);
  transition: background 0.4s, padding 0.5s var(--ease);
  animation: pubIn 0.6s var(--ease) both;
}
@keyframes pubIn { from { opacity: 0; transform: translateY(14px); } }
.pub:hover { background: linear-gradient(90deg, rgba(194, 31, 58, 0.07), transparent 70%); padding-left: 12px; }
.pub__n { font-family: var(--mono); font-size: 13px; color: var(--red); padding-top: 4px; }
.pub__title { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 25px); line-height: 1.25; color: #fff; }
.pub__venue { margin-top: 8px; font-size: 14px; color: var(--gray-2); }
.pub__authors { margin-top: 4px; font-size: 13px; color: var(--gray-3); }
.pub__authors b { color: var(--gray-1); font-weight: 600; }
.pub__side { text-align: right; display: grid; gap: 8px; justify-items: end; }
.pub__year { font-family: var(--serif); font-size: 30px; line-height: 1; }
.pub__type {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  padding: 4px 9px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--gray-2);
}
.pub__type--intl { border-color: rgba(47,191,127,0.5); color: var(--green); }
.pub__type--oak { border-color: rgba(194,31,58,0.55); color: #ff6a80; }
.pub__link { font-size: 12px; color: var(--green); border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.pub__link:hover { border-color: var(--green); }
@media (max-width: 700px) {
  .pub { grid-template-columns: 36px 1fr; gap: 14px; }
  .pub__side { grid-column: 2; text-align: left; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
  .pub__year { font-size: 22px; }
}

/* ---------- Quiz ---------- */
.quiz {
  position: relative; overflow: hidden;
  border-radius: 28px; border: 1px solid var(--line);
  background:
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.018) 0 25%, transparent 0 50%) 0 0 / 80px 80px,
    radial-gradient(700px 400px at 90% 10%, rgba(122,15,28,0.3), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, rgba(19,92,62,0.3), transparent 70%),
    var(--black-2);
  padding: clamp(28px, 5vw, 64px);
  min-height: 460px;
}
.quiz__progress { display: flex; gap: 6px; margin-bottom: 36px; }
.quiz__progress i { flex: 1; height: 2px; background: var(--gray-4); border-radius: 2px; transition: background 0.5s; }
.quiz__progress i.is-done { background: var(--red); }
.quiz__progress i.is-now { background: var(--gray-1); }
.quiz__step { font-size: 12px; color: var(--gray-3); letter-spacing: 0.15em; text-transform: uppercase; }
.quiz__q { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 52px); line-height: 1.1; margin: 10px 0 32px; max-width: 820px; }
.quiz__opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quiz__opt {
  font: inherit; text-align: left; cursor: pointer; color: var(--gray-1);
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; border-radius: 16px;
  background: rgba(10,10,11,0.5); border: 1px solid var(--line-2);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
}
.quiz__opt:hover { border-color: var(--green); background: rgba(47,191,127,0.07); transform: translateY(-2px); }
.quiz__opt kbd {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--gray-2); border: 1px solid var(--line-2);
}
.quiz__anim { animation: quizIn 0.7s var(--ease) both; }
@keyframes quizIn { from { opacity: 0; transform: translateX(30px); } }
.quiz__result { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 70px); align-items: center; }
.quiz__glyph {
  font-size: clamp(140px, 18vw, 260px); line-height: 0.85; color: var(--red);
  text-shadow: 0 0 60px rgba(194,31,58,0.55); animation: glyphIn 1.2s var(--ease) both;
}
@keyframes glyphIn { from { opacity: 0; transform: translateY(40px) rotate(-12deg) scale(0.8); } }
.quiz__result h3 { font-family: var(--serif); font-size: clamp(40px, 4.6vw, 68px); line-height: 1; margin: 8px 0 18px; }
.quiz__result p { color: var(--gray-2); max-width: 560px; }
.quiz__trait { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.quiz__trait span { font-family: var(--mono); font-size: 11px; padding: 6px 12px; border-radius: 100px; border: 1px solid rgba(47,191,127,0.45); color: var(--green); }
.quiz__again {
  margin-top: 28px; font: inherit; font-size: 14px; cursor: pointer; color: #fff;
  background: none; border: 1px solid var(--line-2); border-radius: 100px; padding: 12px 24px;
  transition: border-color 0.3s, background 0.3s;
}
.quiz__again:hover { border-color: var(--red); background: rgba(194,31,58,0.15); }
@media (max-width: 700px) {
  .quiz__opts { grid-template-columns: 1fr; }
  .quiz__result { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(90px, 12vw, 160px); }
.contact__inner { text-align: center; display: grid; justify-items: center; }
.contact__title {
  margin: 18px 0 22px;
  font-family: var(--serif); font-size: clamp(52px, 9vw, 150px); line-height: 0.92; letter-spacing: -0.02em;
}
.contact__title em { color: var(--red); }
.contact__lead { max-width: 560px; color: var(--gray-2); }
.contact__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 44px; }
.contact__card {
  min-width: 240px; padding: 22px 26px; border-radius: 18px; text-align: left;
  border: 1px solid var(--line); background: var(--black-2);
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
a.contact__card:hover { border-color: var(--green); transform: translateY(-3px); }
.contact__card p { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gray-3); margin-bottom: 6px; font-family: var(--mono); }
.contact__card span { font-size: 16px; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  max-width: var(--max); margin: 0 auto; padding: 28px var(--pad);
  border-top: 1px solid var(--line); font-size: 13px; color: var(--gray-3);
}

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

/* Chess glyphs: force text (not emoji) presentation */
.course__glyph, .method__glyph, .quiz__glyph, .nav__glyph {
  font-family: "Segoe UI Symbol", "DejaVu Sans", "Apple Symbols", var(--serif);
  font-variant-emoji: text;
}

/* PDF portfolio entry points */
.nav__links .nav__pdf {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 7px 14px; border-radius: 100px; border: 1px solid rgba(47, 191, 127, 0.45); color: var(--green);
}
.nav__links .nav__pdf::after { display: none; }
.nav__links .nav__pdf:hover { background: rgba(47, 191, 127, 0.1); color: var(--green); }
.footer__pdf { color: var(--green); }
.footer__pdf:hover { text-decoration: underline; }
@media (max-width: 900px) { .nav__links .nav__pdf { font-size: 18px; padding: 10px 26px; } }
