/* ─────────────────────────────────────────────
   doniyor.io — product engineer portfolio
   deep navy · electric blue · engineering-grade
───────────────────────────────────────────── */

:root {
  --bg: #06080f;
  --bg-raise: #0b101c;
  --ink: #e8edf6;
  --muted: rgba(232, 237, 246, 0.55);
  --faint: rgba(232, 237, 246, 0.28);
  --line: rgba(232, 237, 246, 0.12);
  --accent: #4c7dff;
  --font-sans: "Geist", -apple-system, sans-serif;
  --font-mono: "Geist Mono", monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --section-gap: clamp(96px, 14vw, 220px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 340;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.accent { color: var(--accent); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Preloader ─────────────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.loader__count {
  position: absolute;
  right: var(--gutter); bottom: var(--gutter);
  font-family: var(--font-mono);
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 400;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.loader__word {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(20px, 3.2vw, 32px);
  letter-spacing: -0.02em;
  overflow: hidden;
}
.loader__word-em { color: var(--accent); }

/* ── Cursor ────────────────────────────────── */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 99;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  display: none;
  align-items: center; justify-content: center;
  transition: width 0.3s, height 0.3s, margin 0.3s, background-color 0.3s, border-radius 0.3s;
}
.cursor__label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.cursor--hover { width: 36px; height: 36px; margin: -18px 0 0 -18px; background: var(--ink); }
.cursor--view  { width: 68px; height: 68px; margin: -34px 0 0 -34px; background: var(--accent); border-radius: 8px; }
.cursor--view .cursor__label { opacity: 1; }
@media (pointer: fine) {
  .cursor { display: flex; }
}

/* ── Nav ───────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px var(--gutter);
  mix-blend-mode: difference;
}
.nav__logo {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.02em;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.6, 0, 0.2, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__meta {
  display: flex; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.nav { gap: 16px; }
@media (max-width: 640px) {
  .nav__meta .nav__city { display: none; }
}
@media (max-width: 560px) {
  .nav__meta { display: none; }
}

/* ── Hero ──────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
  overflow: hidden;
}
.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero__gridlines {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(232, 237, 246, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 237, 246, 0.045) 1px, transparent 1px);
  background-size: clamp(48px, 8vw, 120px) clamp(48px, 8vw, 120px);
  mask-image: radial-gradient(120% 90% at 50% 45%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 45%, black 30%, transparent 78%);
}
.hero__grain {
  position: absolute; inset: -50%;
  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='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

.hero__meta { position: absolute; top: 84px; }
.hero__meta--tl { left: var(--gutter); }
.hero__meta--tr { right: var(--gutter); text-align: right; }
@media (max-width: 640px) { .hero__meta--tr { display: none; } }

.hero__core { position: relative; z-index: 2; }
.hero__role {
  color: var(--accent);
  margin-bottom: clamp(16px, 2.5vw, 28px);
}
.hero__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(48px, 11.5vw, 184px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  display: flex; flex-direction: column;
}
.hero__line { display: block; overflow: hidden; white-space: nowrap; }
.hero__line--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
@media (max-width: 640px) {
  .hero__title { font-size: clamp(32px, 9.4vw, 60px); }
  .hero__line--outline { -webkit-text-stroke-width: 1px; }
}

.hero__bottom {
  position: absolute; left: var(--gutter); right: var(--gutter);
  bottom: clamp(24px, 4.5vh, 48px);
  z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
}
.hero__tagline {
  max-width: 460px;
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--muted);
  line-height: 1.55;
}
.hero__scroll { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero__scroll-bar {
  width: 1px; height: 48px;
  background: var(--faint);
  position: relative; overflow: hidden;
}
.hero__scroll-bar::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrolldrip 1.8s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}
@keyframes scrolldrip {
  to { top: 100%; }
}
@media (max-width: 760px) {
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero__scroll { display: none; }
}
/* short landscape phones: corner meta collides with centered content */
@media (max-height: 520px) and (orientation: landscape) {
  .hero__meta, .hero__scroll { display: none; }
  .hero__title { font-size: clamp(36px, 8vw, 84px); }
  .hero__tagline { max-width: 520px; font-size: 13px; }
}

/* ── Marquee ───────────────────────────────── */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
  background: var(--bg);
  position: relative; z-index: 2;
}
.marquee__track {
  display: flex; align-items: center; gap: 40px;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee__track span {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.6vw, 17px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}
.marquee__track i {
  color: var(--accent);
  font-style: normal;
  font-size: 9px;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ── Sections shared ───────────────────────── */
.section {
  padding: var(--section-gap) var(--gutter) 0;
  position: relative;
}
.section__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px clamp(16px, 3vw, 48px);
  align-items: baseline;
  margin-bottom: clamp(48px, 7vw, 110px);
}
.section__index { color: var(--accent); }
.section__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.section__note {
  grid-column: 2;
  max-width: 400px;
  color: var(--muted);
  font-size: 15px;
}

/* ── Work ──────────────────────────────────── */
.work__list { border-top: 1px solid var(--line); }
.work__item { border-bottom: 1px solid var(--line); position: relative; }
.work__row {
  display: grid;
  grid-template-columns: 64px 1fr 1.15fr 40px;
  align-items: center;
  gap: clamp(12px, 2.5vw, 32px);
  padding: clamp(26px, 4vw, 48px) 0;
  position: relative;
  transition: padding-left 0.45s cubic-bezier(0.6, 0, 0.2, 1);
}
.work__num { color: var(--faint); }
.work__name {
  font-family: var(--font-sans);
  font-weight: 560;
  font-size: clamp(28px, 4.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 0.35s;
}
.work__info { display: flex; flex-direction: column; gap: 8px; }
.work__desc { color: var(--muted); font-size: clamp(13px, 1.25vw, 15.5px); max-width: 440px; }
.work__arrow {
  font-size: 26px;
  color: var(--faint);
  transition: transform 0.4s cubic-bezier(0.6, 0, 0.2, 1), color 0.35s;
}
@media (hover: hover) {
  .work__row:hover { padding-left: clamp(8px, 1.5vw, 24px); }
  .work__row:hover .work__name { color: var(--accent); }
  .work__row:hover .work__arrow { transform: translateX(8px) rotate(-45deg); color: var(--accent); }
}

/* floating preview (desktop) */
.work__preview {
  position: fixed; top: 0; left: 0; z-index: 40;
  width: clamp(280px, 26vw, 400px);
  aspect-ratio: 4 / 3;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: none;
}
.work__preview svg { width: 100%; height: 100%; display: block; }
@media (hover: hover) and (min-width: 980px) {
  .work__preview { display: block; }
  .work__thumb { display: none; }
}

/* inline thumbs (mobile / touch) */
.work__thumb {
  margin: 0 0 28px;
  border-radius: 4px;
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 260px;
}
.work__thumb svg { width: 100%; height: 100%; display: block; }

@media (max-width: 760px) {
  .work__row { grid-template-columns: 40px 1fr 28px; }
  .work__num   { grid-area: 1 / 1; }
  .work__name  { grid-area: 1 / 2; }
  .work__arrow { grid-area: 1 / 3; }
  .work__info  { grid-area: 2 / 2; margin-top: 10px; }
}

/* ── About ─────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
}
.about__lede {
  font-family: var(--font-sans);
  font-weight: 460;
  font-size: clamp(21px, 2.5vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}
.about__text {
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 20px;
  font-size: clamp(15px, 1.25vw, 17px);
}
.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  position: sticky; top: 110px;
}
.about__stats li {
  background: var(--bg);
  padding: 24px 20px 20px;
}
.stat__num, .stat__suffix {
  font-family: var(--font-sans);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat__suffix { color: var(--accent); }
.stat__label { display: block; margin-top: 10px; }
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__stats { position: static; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ── Capabilities ──────────────────────────── */
.caps__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.caps__item {
  background: var(--bg);
  padding: clamp(28px, 3.5vw, 48px) clamp(22px, 2.5vw, 36px);
  position: relative;
  transition: background-color 0.4s;
}
.caps__item:hover { background: var(--bg-raise); }
.caps__num {
  color: var(--accent);
  display: block;
  margin-bottom: clamp(36px, 5vw, 80px);
}
.caps__name {
  font-family: var(--font-sans);
  font-weight: 560;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}
.caps__desc { color: var(--muted); font-size: 14.5px; max-width: 320px; }

/* ── Startup track record ──────────────────── */
.track__list { border-top: 1px solid var(--line); }
.track__list li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: clamp(20px, 2.5vw, 32px) 0;
  border-bottom: 1px solid var(--line);
}
.track__year { color: var(--accent); }
.track__name {
  font-family: var(--font-sans);
  font-size: clamp(17px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.track__org { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .track__list li { grid-template-columns: 80px 1fr; }
  .track__org { grid-column: 2; }
}

/* ── Contact ───────────────────────────────── */
.contact {
  margin-top: var(--section-gap);
  padding: clamp(80px, 12vw, 180px) var(--gutter) 0;
  border-top: 1px solid var(--line);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact__kicker { display: block; margin-bottom: 24px; }
.contact__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(56px, 14vw, 230px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.contact__outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}
@media (max-width: 640px) {
  .contact__outline { -webkit-text-stroke-width: 1px; }
}
.contact__btn {
  display: inline-block;
  margin-top: clamp(36px, 5vw, 64px);
  padding: 16px 32px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.3vw, 14px);
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  transition: color 0.4s, border-color 0.4s;
  will-change: transform;
}
.contact__btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(0.6, 0, 0.2, 1);
  z-index: -1;
}
.contact__btn:hover { color: var(--bg); border-color: var(--accent); }
.contact__btn:hover::before { transform: translateY(0); }
.contact__btn span { position: relative; }
@media (max-width: 480px) {
  .contact__btn { padding: 13px 18px; font-size: 11px; }
}

.footer {
  margin-top: clamp(72px, 10vw, 140px);
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  text-align: left;
}
.footer__item { transition: color 0.3s; }
a.footer__item:hover { color: var(--accent); }

/* ── Reveal defaults (pre-JS state) ────────── */
.js .section__title .split-line,
.js .about__lede .split-line { overflow: hidden; display: block; }

/* ── Reduced motion ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .loader { display: none; }
}
