/* ══ Header ══════════════════════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--border); }
.header__inner { display: flex; align-items: center; gap: var(--sp-5); }

.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--step-0); letter-spacing: -0.04em;
  text-decoration: none; display: flex; align-items: center; gap: 0.55rem;
  margin-right: auto;
}
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--turquoise), var(--indigo));
  display: grid; place-items: center;
  color: #fff; font-size: 11px; letter-spacing: 0;
}

.nav { display: flex; gap: var(--sp-5); align-items: center; }
.nav a {
  text-decoration: none; font-size: var(--step--1); color: var(--text-soft);
  transition: color var(--dur-fast) var(--ease); position: relative; padding-block: 4px;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--turquoise), var(--indigo));
}

.header__tools { display: flex; align-items: center; gap: 0.35rem; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-soft);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 17px; height: 17px; }

.kbd-hint {
  display: none; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-faint); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 7px; background: var(--surface);
}
@media (min-width: 900px) { .kbd-hint { display: block; } }

/* Til tanlash */
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 9px; border-radius: 9px; color: var(--text-soft);
  border: 1px solid transparent;
}
.lang__btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 150px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 5px; display: none; z-index: 70;
}
.lang__menu[data-open="true"] { display: block; }
.lang__menu a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 8px 10px; border-radius: 8px; text-decoration: none;
  font-size: var(--step--1); color: var(--text-soft);
}
.lang__menu a:hover { background: var(--surface-2); color: var(--text); }
.lang__menu a[aria-current="true"] { color: var(--text); font-weight: 500; }
.lang__menu a[aria-current="true"]::after { content: "●"; color: var(--brass); font-size: 8px; }

.nav-toggle { display: none; }
@media (max-width: 780px) {
  .nav-toggle { display: grid; }
}
/* ══ Tugmalar ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.25rem; border-radius: var(--radius-full);
  font-size: var(--step--1); font-weight: 500; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: linear-gradient(120deg, var(--turquoise-deep), var(--indigo));
  color: #fff; box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--indigo) 70%, transparent);
}
.btn--primary:hover { box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--indigo) 75%, transparent); }

.btn--ghost { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--text-faint); }

.btn--quiet { color: var(--text-soft); padding-inline: 0.4rem; }
.btn--quiet:hover { color: var(--text); }

/* ══ Holat nishoni ═══════════════════════════════════════════════════════ */
.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: var(--step--2);
  letter-spacing: 0.05em; color: var(--text-soft);
  border: 1px solid var(--border); background: var(--surface);
  padding: 0.4rem 0.85rem; border-radius: var(--radius-full);
}
.status__dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--text-faint);
}
.status--open .status__dot {
  background: var(--brass);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brass) 70%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ══ Hero ════════════════════════════════════════════════════════════════ */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 6rem); }
.hero__inner { max-width: 940px; }
.hero h1 { margin-block: 1.6rem 1.8rem; max-width: 17ch; }
.hero__name {
  display: block; font-family: var(--font-mono); font-weight: 400;
  font-size: var(--step--1); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 1rem;
}
.hero .grad {
  background: linear-gradient(100deg, var(--turquoise) 5%, var(--indigo) 65%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__intro { max-width: 58ch; margin-bottom: 2.25rem; font-size: var(--step-1); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.hero__facts {
  display: flex; flex-wrap: wrap; gap: var(--sp-6);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: var(--sp-5); border-top: 1px solid var(--border);
}
.fact__value {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); letter-spacing: -0.04em; line-height: 1;
}
.fact__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.45rem;
}

/* ══ Loyiha kartochkalari ════════════════════════════════════════════════ */
.projects { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
@media (min-width: 860px) { .projects--two { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  text-decoration: none; height: 100%;
  position: relative;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }

/* Hover'da chetidan yumshoq nur o'tadi */
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--turquoise), var(--indigo));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
  z-index: 1;
}
.card:hover::before { opacity: 0.55; }

.card__img {
  aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2);
  border-bottom: 1px solid var(--border); position: relative;
}
.card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  transition: transform 700ms var(--ease-out);
}
.card__img--empty {
  display: grid; place-items: center;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--turquoise) 12%, var(--surface-2)),
    color-mix(in srgb, var(--indigo) 12%, var(--surface-2)));
}
.card__img--empty span { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-faint); }

.card__count {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--font-mono); font-size: 11px; color: #fff;
  background: rgb(0 0 0 / 0.55); backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: var(--radius-full);
}

.card__body {
  padding: var(--sp-5); display: flex; flex-direction: column;
  gap: 0.7rem; flex: 1; position: relative; z-index: 2;
}

.card__title { transition: color var(--dur-fast) var(--ease); }

.card__foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-top: auto; padding-top: 0.9rem;
}

.card__arrow {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  color: var(--text-soft);
  transform: translateX(-6px);
  opacity: 0;
  transition: transform 420ms var(--ease-out), opacity 320ms var(--ease-out),
              background 320ms var(--ease), color 320ms var(--ease),
              border-color 320ms var(--ease);
}
.card__arrow svg { width: 15px; height: 15px; }
.card:hover .card__arrow {
  transform: none; opacity: 1;
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.card__meta {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--step--2);
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em;
}
.card h3 { font-size: var(--step-1); }
.card__tagline { color: var(--text-soft); font-size: var(--step--1); }
.card__tech { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  font-family: var(--font-mono); font-size: var(--step--2);
  padding: 0.22rem 0.6rem; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--text-soft); background: var(--surface-2);
}

.badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--turquoise) 40%, transparent);
  color: var(--turquoise-deep); background: color-mix(in srgb, var(--turquoise) 10%, transparent);
}
:root[data-theme="dark"] .badge { color: var(--turquoise); }
.badge--research { border-color: color-mix(in srgb, var(--brass) 45%, transparent); color: var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, transparent); }
.badge--archived { border-color: var(--border); color: var(--text-faint); background: var(--surface-2); }

/* ══ Filtr ═══════════════════════════════════════════════════════════════ */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding-bottom: var(--sp-5); margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.filter {
  font-family: var(--font-mono); font-size: var(--step--2);
  padding: 0.35rem 0.8rem; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--text-soft);
  text-decoration: none; background: var(--surface);
  transition: all var(--dur-fast) var(--ease);
}
.filter:hover { border-color: var(--text-faint); color: var(--text); }
.filter[aria-pressed="true"], .filter.is-active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}

/* ══ Loyiha sahifasi: galereya ═══════════════════════════════════════════ */
.gallery { display: grid; gap: 0.75rem; }
.gallery__main {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: zoom-in; position: relative; width: 100%;
}
.gallery__main img { width: 100%; height: auto; display: block; }

/* 2+ rasm bo'lsa: asosiysi katta, qolganlari pastda kichik */
.gallery__thumbs {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.gallery__thumb {
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: zoom-in; padding: 0; position: relative;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { border-color: var(--text-faint); transform: translateY(-2px); }
.gallery__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  opacity: 1; transition: opacity var(--dur-fast) var(--ease);
}
.gallery__thumb:hover::after { opacity: 0; }

.gallery__caption {
  font-size: var(--step--1); color: var(--text-faint);
  margin-top: 0.5rem; text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  padding: clamp(1rem, 4vw, 3rem);
  flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
.lightbox[data-open="true"] { display: flex; animation: fade-in var(--dur) var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 100%; max-height: 78vh; object-fit: contain;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.lightbox__bar {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-soft);
}
.lightbox__close { position: absolute; top: 1rem; right: 1rem; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text);
}
.lightbox__nav--prev { left: clamp(0.5rem, 2vw, 2rem); }
.lightbox__nav--next { right: clamp(0.5rem, 2vw, 2rem); }

/* ══ Case study ══════════════════════════════════════════════════════════ */
.case { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 980px) {
  .case { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .case__aside { position: sticky; top: calc(var(--header-h) + 2rem); }
}

.case-section { padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.case-section + .case-section { margin-top: var(--sp-6); }
.case-section__kind {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint);
  margin-bottom: 0.6rem; display: block;
}
.case-section h2 { font-size: var(--step-2); margin-bottom: 1rem; }

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { color: var(--text-soft); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.prose li::marker { color: var(--turquoise); }
.prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.12em 0.4em; border-radius: 5px; color: var(--text);
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1rem; border-radius: var(--radius); overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose h3 { margin-top: 1.6em; }
.prose a { color: var(--accent); }

/* Metrikalar */
.metrics { display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 620px) { .metrics { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.metric { background: var(--surface); padding: var(--sp-5); }
.metric__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-faint);
  margin-bottom: 0.6rem;
}
.metric__values { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.metric__before { color: var(--text-faint); text-decoration: line-through; font-size: var(--step--1); }
.metric__arrow { color: var(--text-faint); }
.metric__after {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--turquoise), var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.metric__note { font-size: var(--step--2); color: var(--text-faint); margin-top: 0.4rem; }

/* Yon panel (fact list) */
.facts { display: grid; gap: 1.1rem; }
.facts dt {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint);
  margin-bottom: 0.2rem;
}
.facts dd { margin: 0; font-size: var(--step--1); }

/* ══ Timeline ════════════════════════════════════════════════════════════ */
.timeline { display: grid; gap: var(--sp-6); position: relative; }
.timeline__item { display: grid; gap: 0.75rem; padding-left: 1.6rem; position: relative; }
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline__item--current::before {
  background: linear-gradient(135deg, var(--turquoise), var(--indigo)); border-color: transparent;
}
.timeline__item::after {
  content: ""; position: absolute; left: 4px; top: 1.5rem; bottom: -2rem;
  width: 1px; background: var(--border);
}
.timeline__item:last-child::after { display: none; }
.timeline__period {
  font-family: var(--font-mono); font-size: var(--step--2);
  color: var(--text-faint); letter-spacing: 0.06em;
}
.timeline__role { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  letter-spacing: -0.03em; }
.timeline__company { color: var(--text-soft); font-size: var(--step--1); }
.timeline__bullets { display: grid; gap: 0.5rem; padding-left: 1.1rem; }
.timeline__bullets li { color: var(--text-soft); font-size: var(--step--1); }
.timeline__bullets li::marker { color: var(--turquoise); }

/* ══ Skills ══════════════════════════════════════════════════════════════ */
.skill-groups { display: grid; gap: var(--sp-6); }
@media (min-width: 780px) { .skill-groups { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.skill-group h3 { font-size: var(--step-0); margin-bottom: 0.9rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; }
.skill { font-family: var(--font-mono); font-size: var(--step--2);
  padding: 0.28rem 0.65rem; border-radius: 7px;
  border: 1px solid var(--border); color: var(--text-soft); background: var(--surface); }
.skill--core {
  border-color: color-mix(in srgb, var(--indigo) 40%, transparent);
  color: var(--text); font-weight: 500;
  background: color-mix(in srgb, var(--indigo) 8%, var(--surface));
}

/* ══ Principles ══════════════════════════════════════════════════════════ */
.principles { display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.principle { background: var(--surface); padding: var(--sp-5); display: grid; gap: 0.6rem; }
.principle h3 { font-size: var(--step-0); }
.principle p { font-size: var(--step--1); color: var(--text-soft); }

/* ══ Forma ═══════════════════════════════════════════════════════════════ */
.form { display: grid; gap: var(--sp-4); max-width: 560px; }
.field-row { display: grid; gap: 0.4rem; }
.field-row label { font-size: var(--step--1); font-weight: 500; }
.field-row input, .field-row textarea {
  width: 100%; padding: 0.75rem 0.9rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field-row input:focus, .field-row textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field-row textarea { resize: vertical; min-height: 140px; }
.errorlist { list-style: none; padding: 0; margin: 0; color: #d14343; font-size: var(--step--1); }
:root[data-theme="dark"] .errorlist { color: #ff8a8a; }

.alert {
  padding: 0.9rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  font-size: var(--step--1); display: flex; gap: 0.6rem;
}
.alert--success { border-color: color-mix(in srgb, var(--turquoise) 45%, transparent);
  background: color-mix(in srgb, var(--turquoise) 8%, var(--surface)); }
.alert--error { border-color: #d1434355; background: #d1434310; }

/* ══ CTA / Footer ════════════════════════════════════════════════════════ */
.cta {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem); background: var(--surface);
  display: grid; gap: 1.25rem; justify-items: start; position: relative; overflow: hidden;
}
.cta::before {
  content: ""; position: absolute; inset: auto -20% -60% auto;
  width: 420px; height: 420px; border-radius: 50%; filter: blur(80px);
  background: radial-gradient(circle, color-mix(in srgb, var(--indigo) 35%, transparent), transparent 70%);
  pointer-events: none;
}
.cta > * { position: relative; }

.footer {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-8);
  font-size: var(--step--1);
  color: var(--text-soft);
}
.footer__reveal { padding-block: clamp(3rem, 7vw, 5rem) var(--sp-7); }

.footer__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}
@media (min-width: 820px) {
  .footer__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}

.footer__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); letter-spacing: -0.04em;
  color: var(--text); line-height: 1.1;
}
.footer__role { margin-top: 0.4rem; }
.footer__mail { display: inline-block; margin-top: 1.1rem; color: var(--text); }

.footer__cols { display: grid; gap: 2rem; }
@media (min-width: 560px) {
  .footer__cols { grid-template-columns: repeat(3, auto); gap: clamp(2rem, 5vw, 4rem); }
}
.footer__col { display: grid; gap: 0.55rem; align-content: start; }
.footer__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); margin-bottom: 0.3rem;
}
.footer a { text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.footer a:hover { color: var(--text); }
.footer__note { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-faint); }

/* ══ Cmd+K ═══════════════════════════════════════════════════════════════ */
.cmdk {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: color-mix(in srgb, var(--bg-alt) 65%, transparent);
  backdrop-filter: blur(8px); padding-top: 12vh;
}
.cmdk[data-open="true"] { display: block; }
.cmdk__panel {
  width: min(100% - 2rem, 560px); margin-inline: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: cmdk-in var(--dur) var(--ease);
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.cmdk__input {
  width: 100%; padding: 1.05rem 1.2rem; border: none; background: none;
  font-size: var(--step-0); border-bottom: 1px solid var(--border);
}
.cmdk__input:focus { outline: none; }
.cmdk__list { max-height: 46vh; overflow-y: auto; padding: 0.4rem; }
.cmdk__group {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); padding: 0.6rem 0.8rem 0.35rem;
}
.cmdk__item {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  padding: 0.6rem 0.8rem; border-radius: 9px; text-align: left;
  text-decoration: none; color: var(--text); font-size: var(--step--1);
}
.cmdk__item[aria-selected="true"] { background: var(--surface-2); }
.cmdk__item small { margin-left: auto; color: var(--text-faint); font-family: var(--font-mono); font-size: 11px; }
.cmdk__empty { padding: 2rem; text-align: center; color: var(--text-faint); font-size: var(--step--1); }

/* ══ Boshqa ══════════════════════════════════════════════════════════════ */
.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid var(--border); padding-top: var(--sp-5); margin-top: var(--sp-7);
}
.empty-state {
  text-align: center; padding: var(--sp-8) var(--sp-4);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  color: var(--text-soft);
}
.error-page { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 1.2rem; }
.error-page__code {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 16vw, 9rem);
  line-height: 1; letter-spacing: -0.06em;
  background: linear-gradient(120deg, var(--turquoise), var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* ══ Bo'lim sarlavhalari — bir xil ritm ══════════════════════════════════ */
.section__head {
  max-width: 44ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  display: grid;
  gap: 0.9rem;
}
.section__head h2 { font-size: var(--step-2); }
.section__head .lead { font-size: var(--step-0); }
.section__more { margin-top: clamp(2rem, 4vw, 3rem); }

/* Bosh sahifada birinchi kartochka kengroq turadi */
@media (min-width: 900px) {
  .projects--two > .card:first-child { grid-column: 1 / -1; }
  .projects--two > .card:first-child { flex-direction: row; }
  .projects--two > .card:first-child .card__img {
    flex: 0 0 52%; aspect-ratio: auto; border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .projects--two > .card:first-child .card__body { justify-content: center; }
  .projects--two > .card:first-child .card__title { font-size: var(--step-2); }
}

/* Prinsip raqami */
.principle { position: relative; }
.principle__index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

/* CTA ichidagi tipografika */
.cta h2 { font-size: var(--step-2); max-width: 16ch; }
.cta .lead { max-width: 52ch; font-size: var(--step-0); }
/* ══ Sahifa sarlavhalari ═════════════════════════════════════════════════ */
.page-title { margin: 1.4rem 0 1.2rem; max-width: 15ch; }
.page-lead { max-width: 54ch; }

.section__head {
  max-width: 46ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  display: grid; gap: 0.9rem;
}
.section__head h2 { font-size: var(--step-2); }
.section__more { margin-top: clamp(2rem, 4vw, 3rem); }

/* ══ Statistika ══════════════════════════════════════════════════════════ */
.stats {
  display: grid; gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
  padding-block: 0 !important;
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }

.stat { background: var(--bg); padding: clamp(1.75rem, 4vw, 2.75rem) var(--sp-5); }
.stat__value {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); letter-spacing: -0.045em; line-height: 1.05;
  background: linear-gradient(100deg, var(--turquoise), var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-top: 0.6rem;
}

/* ══ Prinsiplar ══════════════════════════════════════════════════════════
   Uchta kartochka yonma-yon. Ilgari bu yerda "sticky stack" bor edi —
   kartochkalar ustma-ust yig'ilardi. U ko'rinishi qiziq, lekin matnlar
   bir-birining ustiga tushib o'qishni buzardi, shuning uchun olib tashlandi. */
.principles {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 860px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}

.principle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  gap: 0.8rem;
  align-content: start;
  transition: transform var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.principle:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.principle__index {
  font-family: var(--font-mono); font-size: var(--step--2);
  letter-spacing: 0.12em; color: var(--brass);
}
.principle h3 { font-size: var(--step-1); }
.principle p { color: var(--text-soft); font-size: var(--step--1); }

/* ══ Loyihalar ro'yxati (hover preview) ══════════════════════════════════ */
.preview { position: relative; }

.row {
  position: relative; z-index: 2;
  display: grid; align-items: center; gap: 0.35rem 1.5rem;
  grid-template-columns: auto 1fr auto;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  transition: padding-inline var(--dur) var(--ease);
}
.row:last-of-type { border-bottom: 1px solid var(--border); }

.row__index {
  font-family: var(--font-mono); font-size: var(--step--2);
  color: var(--text-faint); align-self: start; padding-top: 0.4rem;
}
.row__main { display: grid; gap: 0.35rem; min-width: 0; }
.row__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); letter-spacing: -0.04em; line-height: 1.1;
  transition: color var(--dur) var(--ease);
}
.row__tagline {
  color: var(--text-soft); font-size: var(--step--1);
  max-width: 58ch;
}
.row__tech { display: none; }
.row__year {
  font-family: var(--font-mono); font-size: var(--step--2);
  color: var(--text-faint); white-space: nowrap;
}
.row__arrow {
  display: none; width: 38px; height: 38px; border-radius: 50%;
  place-items: center; border: 1px solid var(--border);
  color: var(--text-soft);
  transform: translateX(-8px); opacity: 0;
  transition: all 420ms var(--ease-out);
}
.row__arrow svg { width: 15px; height: 15px; }

@media (min-width: 900px) {
  .row {
    grid-template-columns: auto 1fr auto auto auto;
    transition: background var(--dur) var(--ease),
                padding-left var(--dur) var(--ease);
  }
  .row__tech { display: flex; gap: 0.35rem; }
  .row__arrow { display: grid; }

  /* Fon o'zgarishi qaysi qator faol ekanini rasmdan ko'ra aniqroq bildiradi */
  .row:hover {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    padding-left: 1rem;
  }
  .row:hover .row__title { color: var(--accent); }
  .row:hover .row__arrow {
    transform: none; opacity: 1;
    background: var(--text); color: var(--bg); border-color: var(--text);
  }
}

/* Sensorli ekranda rasm qatorning ichida ko'rinadi */
.row__thumb {
  grid-column: 1 / -1;
  margin-top: 0.9rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .row__thumb { display: none; } }

/* ── Rasm paneli ──
   O'ng chekkada, matn maydonidan tashqarida. Sarlavhalarni hech qachon
   berkitmaydi — faqat vertikal siljiydi. */
.preview__layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 200px;
  pointer-events: none;
  z-index: 3;
  display: none;
}
[data-preview-active="true"] .preview__layer { display: block; }

/* Rasm paneli chiqqanda matnga joy qoldiramiz */
@media (min-width: 1100px) {
  [data-preview-active="true"] .row { padding-right: 330px; }
}

.preview__image {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  background: var(--surface-2);
}
.preview__image img { width: 100%; height: 100%; object-fit: cover; }

/* Rasm hali yuklanmagan loyihalar uchun */
.preview__placeholder {
  display: grid; place-items: center; height: 100%;
  padding: 1.25rem; text-align: center;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--turquoise) 16%, var(--surface)),
    color-mix(in srgb, var(--indigo) 16%, var(--surface)));
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  line-height: 1.5;
}
/* -- Hero portrait ------------------------------------------------------ */
.hero__media {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--indigo) 60%, transparent),
              var(--shadow-lg);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (min-width: 900px) {
  .hero--with-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: clamp(2.5rem, 5vw, 5.5rem);
    align-items: center;
  }
}

/* Name and location: the dot separator is drawn by CSS, so it can be
   dropped when the two stack on separate lines (phones). */
.hero__loc::before { content: " \00B7  "; }

/* Text-only card: used automatically when a project has no image.
   Upload an image in the admin and the card switches back on its own. */
.card--text {
  background: linear-gradient(160deg,
              color-mix(in srgb, var(--turquoise) 7%, var(--surface)),
              var(--surface) 55%);
}
.card--text .card__body {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  gap: 0.9rem;
}
.card--text .card__title { font-size: var(--step-2); }
.card--text .card__tagline { font-size: var(--step-0); max-width: 52ch; }

/* -- Contact page ------------------------------------------------------- */
.contact__status { margin-top: 1.75rem; }
.contact {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  align-items: start;
}
@media (min-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); }
}
.contact__form { display: grid; gap: 1.25rem; }
.contact__form .form { max-width: none; }
.req { color: var(--brass); }
.contact__aside { display: grid; gap: 1.25rem; align-content: start; }

.aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.aside-card__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); margin-bottom: 1rem;
}
.steps { list-style: none; padding: 0; display: grid; gap: 0.85rem; }
.steps li { display: flex; align-items: flex-start; gap: 0.75rem; font-size: var(--step--1); color: var(--text-soft); }
.steps li > span {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: #fff;
  background: linear-gradient(135deg, var(--turquoise), var(--indigo));
}
.hints { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.hints li { position: relative; padding-left: 1.1rem; font-size: var(--step--1); color: var(--text-soft); }
.hints li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brass);
}

/* -- Quick contact channels --------------------------------------------- */
.channels { display: grid; gap: 0.75rem; }
.channel {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease);
}
.channel:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.channel__icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--turquoise-deep), var(--indigo));
}
.channel__icon svg { width: 20px; height: 20px; }
.channel__text { display: grid; gap: 0.15rem; min-width: 0; }
.channel__label {
  font-family: var(--font-mono); font-size: var(--step--2);
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint);
}
.channel__value {
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.channel__arrow { margin-left: auto; flex: none; color: var(--text-faint); transition: transform var(--dur) var(--ease-out), color var(--dur) var(--ease); }
.channel__arrow svg { width: 16px; height: 16px; }
.channel:hover .channel__arrow { transform: translate(2px, -2px); color: var(--text); }

/* -- Card content: enough to spark interest, the rest lives inside ------ */
.card__title { text-wrap: balance; }
.card__tagline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card--text .card__tagline { -webkit-line-clamp: 4; }

.card__foot { flex-wrap: wrap; row-gap: 0.75rem; }
.card__tech { flex-wrap: nowrap; overflow: hidden; }
.chip--more { color: var(--text-faint); background: transparent; }

.card__cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.card__cta .card__arrow {
  width: 30px;
  height: 30px;
  opacity: 1;
  transform: none;
}
.card:hover .card__cta { color: var(--text); }
.card:hover .card__cta .card__arrow { transform: translateX(3px); }

/* -- /work/ rows: thumbnail always visible -----------------------------
   Muted at rest so the list stays calm and the titles lead; the hovered
   (or keyboard-focused) row brings its image to full colour. Rows without
   an image leave the column empty, so the grid stays aligned. */
@media (min-width: 900px) {
  .row {
    grid-template-columns: auto minmax(0, 1fr) auto auto 200px auto;
    column-gap: 1.75rem;
  }
  .row__thumb {
    display: block;
    grid-column: 5;
    grid-row: 1;
    margin: 0;
    width: 200px;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    opacity: 0.5;
    filter: grayscale(0.7) blur(0.5px);
    transform: scale(0.96);
    transition: opacity 500ms var(--ease-out),
                filter 500ms var(--ease-out),
                transform 600ms var(--ease-out),
                box-shadow 600ms var(--ease-out);
  }
  .row__thumb img { width: 100%; height: 100%; object-fit: cover; }
  .row__arrow { grid-column: 6; grid-row: 1; }

  .row:hover .row__thumb,
  .row:focus-visible .row__thumb {
    opacity: 1;
    filter: none;
    transform: scale(1);
    box-shadow: var(--shadow-lg);
  }
}

/* -- Admin shortcuts in the header (staff only) ------------------------- */
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.admin-pill:hover { color: var(--text); border-color: var(--border-strong); }
.admin-pill svg { width: 15px; height: 15px; }
.admin-pill__badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brass);
  color: #0c1220;
  font-size: 10px;
  letter-spacing: 0;
}
@media (max-width: 780px) {
  .admin-pill__text, .admin-edit { display: none; }
}
@media print {
  .admin-pill, .admin-edit { display: none !important; }
}

/* -- CTA with a live architecture sketch -------------------------------
   The Smart Yard pipeline drawn as inline SVG: data dashes run along the
   wires, camera dots blink, the detection frame pulses. Colours come from
   the theme tokens, so it follows dark / light mode. Hidden on phones,
   where the space belongs to the text. */
.cta--art { align-items: center; }
.cta__text { display: grid; gap: 1.25rem; justify-items: start; }
@media (min-width: 900px) {
  .cta--art {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.cta-art { width: 100%; height: auto; max-width: 620px; justify-self: end; overflow: visible; }
@media (max-width: 720px) { .cta-art { display: none; } }

.cta-art .node rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.cta-art .node--accent rect { stroke: url(#cta-g); stroke-width: 1.5; }
.cta-art text { font-family: var(--font-mono); font-size: 13px; fill: var(--text); }
.cta-art text.s { font-size: 11px; fill: var(--text-faint); }

.cta-art .wire { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.cta-art .flow {
  fill: none;
  stroke: url(#cta-g);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 4 14;
  animation: cta-flow 1.4s linear infinite;
}
.cta-art .flow--slow { animation-duration: 2.2s; }

.cta-art .scan {
  fill: none;
  stroke: var(--turquoise);
  stroke-width: 2;
  stroke-linecap: round;
  animation: cta-blink 2.4s ease-in-out infinite;
}
.cta-art .live { fill: var(--brass); animation: cta-blink 1.6s ease-in-out infinite; }
.cta-art .dot { fill: var(--turquoise); }
.cta-art .ping {
  fill: none;
  stroke: var(--turquoise);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: cta-ping 2.4s ease-out infinite;
}

@keyframes cta-flow { to { stroke-dashoffset: -36; } }
@keyframes cta-blink { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes cta-ping {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* -- CTA: larger type next to the diagram ------------------------------- */
.cta--art h2 { font-size: var(--step-3); max-width: 14ch; }
.cta--art .lead { font-size: var(--step-1); max-width: 40ch; }

/* -- Page hero with a diagram (contact) --------------------------------- */
.page-hero { display: grid; gap: 2rem; align-items: center; }
.page-hero__text > * + * { margin-top: 0; }
@media (min-width: 1000px) {
  .page-hero--art { grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(2rem, 4vw, 4rem); }
}

/* -- About -------------------------------------------------------------- */
.about-hero { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 900px) {
  .about-hero--media { grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); }
}
.about-hero__text { display: grid; gap: 1.1rem; justify-items: start; }
.about-hero__text .page-title { margin: 0.4rem 0 0; }
.about-hero__role { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-soft); letter-spacing: 0.02em; }
.about-hero__media { position: relative; margin: 0; max-width: 420px; justify-self: center; width: 100%; }
.about-hero__frame {
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--indigo) 60%, transparent), var(--shadow-lg);
}
.about-hero__frame img { width: 100%; height: 100%; object-fit: cover; }

.float-chip {
  position: absolute;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text);
  animation: chip-float 6s ease-in-out infinite;
}
.float-chip--1 { top: 10%; left: -9%; animation-delay: 0s; }
.float-chip--2 { top: 48%; right: -10%; animation-delay: -2s; }
.float-chip--3 { bottom: 9%; left: -6%; animation-delay: -4s; }
@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (max-width: 899px) {
  .about-hero__media { max-width: 300px; }
  .float-chip--1 { left: -4%; }
  .float-chip--2 { right: -4%; }
  .float-chip--3 { left: -2%; }
}

.about-story { display: grid; gap: 1.25rem; }
@media (min-width: 900px) {
  .about-story { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .about-story .eyebrow { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.about-story__body { font-size: var(--step-1); line-height: 1.6; max-width: 62ch; }

/* Timeline: a gradient line grows with the scroll, dots light up */
.timeline--draw { position: relative; }
.timeline--draw::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.6rem; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline--draw .timeline__item::after { display: none; }
.timeline__progress {
  position: absolute;
  left: 3px; top: 0.6rem; bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--turquoise), var(--indigo));
  transform: scaleY(0);
  transform-origin: top;
}
.timeline--draw .timeline__item::before { transition: background 400ms var(--ease), border-color 400ms var(--ease), box-shadow 400ms var(--ease); }
.timeline--draw .timeline__item.is-reached::before {
  background: var(--turquoise);
  border-color: var(--turquoise);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--turquoise) 20%, transparent);
}
:root.no-anim .timeline__progress { transform: none; }

.skill-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.skill-card, .info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: grid;
  gap: 0.8rem;
  align-content: start;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.skill-card:hover, .info-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-card h3 { font-size: var(--step-0); }
.skill-card__note { font-size: var(--step--1); color: var(--text-faint); }

.info-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.info-card__item { display: grid; gap: 0.3rem; }
.info-card__item + .info-card__item { padding-top: 0.8rem; border-top: 1px solid var(--border); }
.info-card h3 { font-size: var(--step-0); }
.lang-list { display: grid; gap: 0.6rem; margin: 0; }
.lang-list > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.lang-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.lang-list dt { font-weight: 600; }
.lang-list dd { margin: 0; color: var(--text-soft); font-family: var(--font-mono); font-size: var(--step--1); }

@media (prefers-reduced-motion: reduce) {
  .float-chip { animation: none; }
}

/* -- Section header with a link on the right ---------------------------- */
.section__head--row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.section__head-text { display: grid; gap: 0.9rem; max-width: 46ch; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover { color: var(--text); border-color: var(--text); }
.link-arrow:hover svg { transform: translateX(4px); }

/* -- Card images: shown whole -------------------------------------------
   The screenshot is never cropped: it sits in the 16:10 frame with
   object-fit: contain, and the empty space is filled by a blurred,
   darkened copy of the same image, so the frame never looks empty. */
.card__img { background: #0b1120; isolation: isolate; }
.card__img .card__img-bg,
.row__thumb .thumb-bg {
  position: absolute; inset: -12%;
  width: 124%; height: 124%;
  object-fit: cover;
  filter: blur(22px) saturate(1.15) brightness(0.7);
  transform: none !important;
  z-index: 0;
}
.card__img .card__img-main,
.row__thumb .thumb-main {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  transform: none;
}
.card__count { z-index: 2; }
.row__thumb { position: relative; background: #0b1120; isolation: isolate; }
.gallery__thumb img { object-fit: contain; background: #0b1120; }

/* -- Footer ----------------------------------------------------------- */
.footer { margin-top: clamp(2rem, 5vw, 3.5rem); border-top: 1px solid var(--border); }
.footer__inner {
  display: grid; gap: 2rem;
  padding-block: clamp(2.25rem, 5vw, 3.5rem) 1.75rem;
}
@media (min-width: 820px) {
  .footer__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 3rem; }
}
.footer__title { font-size: var(--step-1); }
.footer__cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, auto)); column-gap: clamp(2rem, 6vw, 4.5rem); }
.footer__links { display: grid; gap: 0.5rem; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding-block: 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: var(--step--2); color: var(--text-faint);
}
@media (max-width: 720px) {
  .footer__inner { gap: 1.5rem; padding-block: 2rem 1.25rem; }
  .footer__title { font-size: var(--step-0); }
  .footer__role { font-size: var(--step--1); }
  .footer__mail { margin-top: 0.6rem; font-size: var(--step--1); }
  .footer__cols { grid-template-columns: 1fr; gap: 1.1rem; }
  /* Links sit in a row instead of a tall column */
  .footer__links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
  .footer__label { margin-bottom: 0.4rem; }
}

/* The last section sits close to the footer instead of leaving a gap */
main > .section:last-child { padding-bottom: clamp(1.75rem, 4vw, 3rem); }
.footer { margin-top: 0; }

/* ---------- Certificates (CV + About) ---------- */
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.cert-list__item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.cert-list__item:last-child { border-bottom: 0; }
.cert-list__name { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cert-list__link {
  flex: none; display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.875rem; font-weight: 500; color: var(--accent);
  text-decoration: none; padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid currentColor; transition: background-color .2s, color .2s;
}
.cert-list__link:hover, .cert-list__link:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.cert-list__type { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.75; }
@media (max-width: 480px) {
  .cert-list__item { flex-wrap: wrap; gap: 0.4rem; }
}
@media print {
  .cert-list__link { border: 0; padding: 0; }
  .cert-list__type { display: none; }
}

/* ---------- Mobile: visible menu button ---------- */
@media (max-width: 780px) {
  .nav-toggle {
    width: auto; height: 38px; padding: 0 0.85rem 0 0.7rem;
    grid-auto-flow: column; gap: 0.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-sm);
  }
  .nav-toggle:hover { background: var(--surface-2); }
  .nav-toggle svg { width: 18px; height: 18px; }
  .nav-toggle__label { font-size: 0.875rem; font-weight: 600; line-height: 1; }
}
.nav-toggle__label { display: none; }
@media (max-width: 780px) { .nav-toggle__label { display: inline; } }
/* Very narrow phones: icon only, but still a bordered button */
@media (max-width: 340px) { .nav-toggle__label { display: none; } .nav-toggle { padding: 0 0.6rem; } }

/* ---------- Footer page links: easy to spot ---------- */
.footer__links--pages a { color: var(--text); font-weight: 500; }
@media (max-width: 720px) {
  .footer__links--pages { gap: 0.5rem; }
  .footer__links--pages a {
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 1rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius-full);
    background: var(--surface); box-shadow: var(--shadow-sm);
    font-size: var(--step--1); text-decoration: none;
  }
  .footer__links--pages a:active { background: var(--surface-2); }
}
