/* Akhmed Bunyadov — portfolio
   Monochrome canvas, 24px rounded media, pill controls, serif italic used only for emphasis. */

:root {
  --ink: #070708;
  --ink-2: #3a3a3d;
  --muted: #6b6b70;
  --paper: #ffffff;
  --soft: #f3f2ee;
  --line: rgba(7, 7, 8, 0.12);
  --line-strong: rgba(7, 7, 8, 0.85);
  --band: #070708;
  --band-ink: #f4f3ef;
  --band-muted: #9a9a9f;
  --band-line: rgba(244, 243, 239, 0.16);
  --live: #22b45e;

  --sans: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;

  --r-card: 24px;
  --r-pill: 999px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 144px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1360px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r-pill); }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.i { width: 1em; height: 1em; flex: none; }

/* ---------- Buttons, tags, pills ---------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  height: 48px; padding: 0 22px;
  border-radius: var(--r-pill);
  font: 500 15px/1 var(--sans); letter-spacing: 0.01em;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 90ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #2a2a2e; }
.btn-ghost { border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.tag {
  display: inline-flex; align-items: center;
  height: 34px; padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font: 500 14px/1 var(--sans); letter-spacing: 0.01em;
}
.tag-light { background: var(--band-ink); color: var(--band); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills li {
  padding: 5px 11px; border-radius: var(--r-pill);
  background: rgba(7, 7, 8, 0.06);
  font-size: 13px; line-height: 1.2; letter-spacing: 0.01em;
}
.pills-lg li { padding: 8px 14px; font-size: 14px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); height: 72px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.mark {
  width: 22px; height: 22px; flex: none;
  background: var(--ink);
  border-radius: 50% 50% 50% 0; /* a quarter-squared circle: soft brand, hard business edge */
}
.nav { display: flex; gap: var(--s1); margin-left: auto; }
.nav a { padding: 10px 14px; border-radius: var(--r-pill); font-size: 15px; transition: background-color 120ms ease; }
.nav a:hover { background: rgba(7, 7, 8, 0.06); }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(48px, 9vw, 128px); padding-bottom: clamp(48px, 7vw, 96px); }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: 15px; color: var(--muted); margin-bottom: var(--s6); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(34, 180, 94, 0.16); }

.display {
  font-size: clamp(44px, 8.2vw, 124px);
  line-height: 0.94;
  font-weight: 500;
  letter-spacing: -0.045em;
  max-width: 15ch;
  text-wrap: balance;
}
.display em { letter-spacing: -0.02em; padding-right: 0.04em; }
.hero-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6); align-items: end; margin-top: clamp(32px, 5vw, 64px); }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; letter-spacing: -0.01em; max-width: 46ch; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ---------- Clients ---------- */

.clients {
  display: flex; align-items: baseline; gap: var(--s5);
  padding-top: var(--s5); padding-bottom: var(--s5);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.clients > span { flex: none; }
.clients ul { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); font-weight: 500; }
.wrap.clients { max-width: calc(var(--max) - 2 * var(--gutter)); padding-left: 0; padding-right: 0; }

/* ---------- Work ---------- */

.work { padding-top: clamp(64px, 9vw, 128px); }
.section-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s6); }
.count { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 72px) var(--s5); }
.work-card { display: block; }
.work-card--lead { grid-column: 1 / -1; }
.media { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--soft); }
.work-card .media { aspect-ratio: 4 / 3; }
.work-card--lead .media { aspect-ratio: 16 / 8; }
.work-card .media img, .work-card .plate { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.work-card:hover .media img, .work-card:hover .plate { transform: scale(1.025); }

.plate {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(20px, 3vw, 40px);
  background: var(--plate); color: var(--plate-ink);
}
.plate-client { font-size: 14px; letter-spacing: 0.01em; opacity: 0.7; }
.plate-title { font-size: clamp(28px, 4.2vw, 64px); line-height: 0.98; font-weight: 500; letter-spacing: -0.04em; max-width: 14ch; }

.work-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-top: var(--s4); }
.work-meta h3 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.work-meta p { font-size: 15px; margin-top: 2px; }
.work-meta .pills { justify-content: flex-end; max-width: 50%; }
.empty { color: var(--muted); padding: var(--s8) 0; }

/* Floating preview on the work index (desktop pointer only, toggled in site.js) */
.cursor-preview { display: none; }

/* ---------- Services / about ---------- */

.services { padding-top: clamp(80px, 11vw, 160px); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s7); }
.about-text { margin-top: var(--s5); font-size: clamp(24px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 500; max-width: 18ch; }
.rows { border-top: 1px solid var(--line-strong); }
.row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s4);
  padding: var(--s5) 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.row-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.row h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.row p { font-size: 15px; line-height: 1.5; }

/* ---------- Band (numbers + honours) ---------- */

.band { margin-top: clamp(80px, 11vw, 160px); background: var(--band); color: var(--band-ink); padding: clamp(64px, 9vw, 128px) 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6); margin-top: var(--s7); }
.stat { border-top: 1px solid var(--band-line); padding-top: var(--s5); }
.stat dt { font-size: clamp(56px, 7vw, 104px); line-height: 0.9; font-weight: 500; letter-spacing: -0.05em; }
.stat dd { margin-top: var(--s4); color: var(--band-muted); font-size: 15px; line-height: 1.45; max-width: 26ch; }
.awards { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s7); }
.awards-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(36px, 4vw, 56px); line-height: 1; letter-spacing: -0.01em; }
.awards ul { border-top: 1px solid var(--band-line); }
.awards li { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--band-line); font-size: 16px; }
.awards li .muted { color: var(--band-muted); font-variant-numeric: tabular-nums; }
.awards strong { font-weight: 500; }

/* ---------- Experience ---------- */

.experience { padding-top: clamp(80px, 11vw, 160px); padding-bottom: clamp(80px, 11vw, 160px); }
.xp { border-top: 1px solid var(--line-strong); }
.xp-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr); gap: var(--s5); padding: var(--s6) 0; border-bottom: 1px solid var(--line); }
.xp-period, .xp-place { font-size: 15px; font-variant-numeric: tabular-nums; }
.xp-place { text-align: right; }
.xp-main h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.xp-main .at { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }
.xp-main ul { margin-top: var(--s4); display: grid; gap: var(--s2); max-width: 62ch; }
.xp-main li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 16px; }
.xp-main li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--ink); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); margin-top: clamp(56px, 7vw, 96px); }
.facts > div { border-top: 1px solid var(--line-strong); padding-top: var(--s5); display: grid; align-content: start; gap: var(--s4); }
.facts-title { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.facts p { font-size: 16px; line-height: 1.45; }

/* ---------- Footer ---------- */

.site-footer { background: var(--band); color: var(--band-ink); padding: clamp(64px, 9vw, 128px) 0 var(--s6); }
.footer-title { margin-top: var(--s6); font-size: clamp(36px, 5.6vw, 84px); line-height: 1; font-weight: 500; letter-spacing: -0.04em; max-width: 17ch; text-wrap: balance; }
.footer-email {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: var(--s7);
  font-size: clamp(20px, 2.4vw, 32px); letter-spacing: -0.02em;
  border-bottom: 1px solid var(--band-line); padding-bottom: 6px;
  transition: border-color 150ms ease;
  word-break: break-all;
}
.footer-email:hover { border-color: var(--band-ink); }
.footer-email .i { transition: transform 200ms var(--ease-out); }
.footer-email:hover .i { transform: translate(3px, -3px); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); margin-top: clamp(64px, 9vw, 128px); padding-top: var(--s5); border-top: 1px solid var(--band-line); color: var(--band-muted); font-size: 14px; letter-spacing: 0.01em; }
.footer-links { display: flex; gap: var(--s5); margin-left: auto; }
.footer-links a { color: var(--band-ink); }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Case study ---------- */

.preview-bar { background: #ffe9a8; color: var(--ink); text-align: center; padding: 10px var(--gutter); font-size: 14px; }
.cs-head { padding-top: clamp(32px, 5vw, 64px); }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin-bottom: clamp(32px, 5vw, 64px); transition: color 120ms ease; }
.back:hover { color: var(--ink); }
.display-cs { max-width: 16ch; font-size: clamp(40px, 7vw, 108px); }
.cs-intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s7); margin-top: clamp(32px, 5vw, 64px); align-items: start; }
.cs-meta { border-top: 1px solid var(--line-strong); }
.cs-meta div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: var(--s4); padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cs-meta dt { color: var(--muted); }
.cs-cover { margin-top: clamp(40px, 6vw, 80px); }
.cs-cover .media { aspect-ratio: 16 / 9; }
.cs-cover .media img, .cs-cover .plate { width: 100%; height: 100%; object-fit: cover; }

.cs-body { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); display: grid; gap: clamp(56px, 8vw, 112px); }
.cs-text { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s6); }
.cs-text-head { font-size: 15px; font-weight: 500; letter-spacing: 0.01em; position: sticky; top: 96px; align-self: start; }
.prose { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; letter-spacing: -0.01em; max-width: 62ch; color: var(--ink-2); display: grid; gap: 1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.cs-image figcaption, .cs-gallery figcaption { margin-top: var(--s3); font-size: 14px; color: var(--muted); letter-spacing: 0.01em; }
.cs-image--inset { width: min(100%, 880px); justify-self: end; }
.cs-image .media img { width: 100%; }
.cs-gallery-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--s4); }
.cs-gallery-grid .media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }

.cs-quote { padding: var(--s5) 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.cs-quote blockquote { font-family: var(--serif); font-style: italic; font-size: clamp(32px, 4.4vw, 64px); line-height: 1.05; letter-spacing: -0.01em; max-width: 24ch; }
.cs-quote figcaption { margin-top: var(--s5); font-size: 15px; color: var(--muted); }

.next {
  display: flex; flex-direction: column; gap: var(--s3);
  padding-top: var(--s7); padding-bottom: clamp(80px, 10vw, 144px);
  border-top: 1px solid var(--line);
}
.wrap.next { max-width: calc(var(--max) - 2 * var(--gutter)); padding-left: 0; padding-right: 0; }
.next-title { display: inline-flex; align-items: center; gap: 0.25em; font-size: clamp(36px, 6vw, 88px); line-height: 1; font-weight: 500; letter-spacing: -0.045em; }
.next-title .i { width: 0.6em; height: 0.6em; transition: transform 250ms var(--ease-out); }
.next:hover .next-title .i { transform: translate(6px, -6px); }

.nf { min-height: 60vh; display: grid; align-content: center; gap: var(--s7); }

/* ---------- Motion ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .cursor-preview {
    display: block; position: fixed; left: 0; top: 0; z-index: 40;
    width: 300px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
    pointer-events: none; opacity: 0;
    background: var(--soft) center / cover no-repeat;
    transform: translate3d(-50%, -50%, 0) scale(0.9);
    transition: opacity 180ms ease, transform 180ms ease;
  }
  .cursor-preview.is-on { opacity: 1; }
}

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

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .awards, .cs-intro { grid-template-columns: 1fr; gap: var(--s6); }
  .xp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
  .xp-place { grid-column: 2; text-align: left; margin-top: calc(-1 * var(--s3)); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .header-inner { height: 64px; }
  .hero-foot { grid-template-columns: 1fr; }
  .clients { flex-direction: column; gap: var(--s3); }
  .wrap.clients, .wrap.next { margin-left: var(--gutter); margin-right: var(--gutter); width: auto; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card--lead .media, .work-card .media { aspect-ratio: 4 / 3; }
  .work-meta { flex-direction: column; }
  .work-meta .pills { justify-content: flex-start; max-width: none; }
  .row { grid-template-columns: 32px minmax(0, 1fr); }
  .row p { grid-column: 2; }
  .stats { grid-template-columns: 1fr 1fr; gap: var(--s5); }
  .awards li { grid-template-columns: 48px minmax(0, 1fr); }
  .awards li span:last-child { grid-column: 2; color: var(--band-muted); }
  .xp-row { grid-template-columns: 1fr; gap: var(--s2); }
  .xp-place { grid-column: auto; margin-top: 0; }
  .facts { grid-template-columns: 1fr; }
  .footer-links { margin-left: 0; }
  .cs-text { grid-template-columns: 1fr; gap: var(--s3); }
  .cs-text-head { position: static; }
  .cs-gallery-grid { grid-template-columns: 1fr; }
  .cs-cover .media { aspect-ratio: 4 / 3; }
}
