/* ==========================================================================
   Rovshen Bayramov — Portfolio
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — Archivo (400/500/600/700) + IBM Plex Mono (400/500)
   -------------------------------------------------------------------------- */

/* Archivo — vietnamese */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/archivo-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Archivo — latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Archivo — latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono 400 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plexmono-400-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono 500 */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plexmono-500-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #08090d;
  --surface: #0d0f15;
  --text: #f2f3f5;
  --muted: #9aa1ad;
  --dim: #5b6270;
  --accent: #4da3ff;
  --accent-hover: #6cb4ff;
  --green: #34d17b;
  --green-hover: #5fe09a;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.22);
  --pill-border: rgba(255, 255, 255, 0.14);

  --sans: 'Archivo', 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  /* Layout rhythm — every breakpoint retunes these, so the rules below
     never need to repeat a padding or a gap. */
  --shell: 1200px;
  --pad-x: 32px;
  --nav-h: 64px;
  --sec-top: 110px;
  --sec-bottom: 60px;
  --hero-top: 104px;
  --hero-bottom: 88px;
  --gap-col: 64px;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Anchors land below the sticky bar instead of behind it. */
#top, #company, #work, #about, #contact {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: rgba(77, 163, 255, 0.35); }

img { display: block; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Shared primitives
   -------------------------------------------------------------------------- */
.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* Monospace micro-label */
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.accent { color: var(--accent); }

/* Rounded outline chip */
.pill {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}
.pill--accent {
  color: var(--accent);
  border-color: rgba(77, 163, 255, 0.35);
}
.pill--dim { color: var(--dim); }

/* Section eyebrow: "(01) COMPANY" */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}
.eyebrow__num { color: var(--accent); }
.eyebrow__label { color: var(--dim); }

.section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--sec-top) var(--pad-x) var(--sec-bottom);
}

.section__title {
  margin: 0 0 56px;
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

/* Buttons */
.btn {
  border-radius: 999px;
  font-size: 15px;
  padding: 14px 26px;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-hover); color: var(--bg); }

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 500;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--lg { font-size: 16px; padding: 16px 30px; }

/* Framed photo with a caption strip underneath */
.plate {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.plate__frame {
  overflow: hidden;
  background: var(--surface);
}
.plate__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
  transition: filter 0.5s ease;
}
.plate__img:hover { filter: grayscale(0%) contrast(1); }
.plate__caption {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-soft);
}
/* The blurred bar lives on a pseudo-element, not on .nav. backdrop-filter makes
   an element a containing block for fixed descendants, which would pin the
   mobile menu overlay to the 64px bar instead of the viewport. Bottom inset of
   -1px keeps the blur under the semi-transparent border, as it was before. */
.nav::before {
  content: '';
  position: absolute;
  inset: 0 0 -1px;
  background: rgba(8, 9, 13, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav__inner {
  position: relative;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Burger — hidden until the mobile breakpoint */
.nav__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}
.nav__toggle-bar {
  position: absolute;
  width: 20px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav__toggle-bar:nth-child(1) { transform: translateY(-4px); }
.nav__toggle-bar:nth-child(2) { transform: translateY(4px); }
[data-menu-open] .nav__toggle-bar:nth-child(1) { transform: rotate(45deg); }
[data-menu-open] .nav__toggle-bar:nth-child(2) { transform: rotate(-45deg); }

/* Only rendered inside the mobile menu */
.nav__mail { display: none; }
.nav__logo {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.nav__link { color: var(--muted); }
.nav__link:hover { color: var(--text); }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(52, 209, 123, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--green);
  font-size: 11px;
  white-space: nowrap;
}
.status:hover { border-color: rgba(52, 209, 123, 0.7); color: var(--green); }
.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--hero-top) var(--pad-x) var(--hero-bottom);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: var(--gap-col);
  align-items: center;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero__kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.hero__title {
  margin: 0;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}
.hero__lede {
  margin: 0;
  max-width: 540px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero__meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.hero__plate .plate__frame { aspect-ratio: 4 / 4.6; }

/* Underlined link inside body copy — stays white on hover, by design */
.link-underline {
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.link-underline:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */
.marquee {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  padding: 16px 0;
}
.marquee__track {
  display: inline-flex;
  width: max-content;
  white-space: nowrap;
  animation: marquee 32s linear infinite;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dim);
}
.marquee__track > span { padding-right: 48px; }

/* --------------------------------------------------------------------------
   Company
   -------------------------------------------------------------------------- */
.company__list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.company-card {
  display: grid;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s ease;
}
.company-card:hover { border-color: var(--line-strong); }
.company-card--media-right { grid-template-columns: minmax(0, 1.05fr) minmax(280px, 1fr); }
.company-card--media-left { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.05fr); }

.company-card__body {
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  justify-content: center;
}
.company-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.company-card__logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}
.company-card__ids {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.company-card__name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.company-card__role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.company-card__role--green { color: var(--green); }
.company-card__text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.company-card__media {
  position: relative;
  overflow: hidden;
  min-height: 300px;
}
.company-card--media-right .company-card__media { border-left: 1px solid var(--line); }
.company-card--media-left .company-card__media { border-right: 1px solid var(--line); }
.company-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.company-card__links {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 14.5px;
  flex-wrap: wrap;
}

/* Stat row */
.stats { display: flex; gap: 36px; }
.stats__value { font-size: 26px; font-weight: 600; }
.stats__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-top: 4px;
}

/* Contextual link colours */
.link-accent { color: var(--accent); font-weight: 500; }
.link-accent:hover { color: var(--accent); }
.link-green { color: var(--green); font-weight: 500; }
.link-green:hover { color: var(--green-hover); }
.link-muted { color: var(--muted); }
.link-muted:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Work
   -------------------------------------------------------------------------- */
.work__grid {
  display: grid;
  /* min() keeps the 3-up desktop layout but lets a card shrink below 340px
     instead of forcing the page to scroll sideways. */
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 28px;
}
.work-card {
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.work-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}
.work-card__frame {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
}
.work-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-card__body {
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.work-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.work-card__name { font-size: 20px; font-weight: 600; }
.work-card__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr);
  gap: var(--gap-col);
  align-items: start;
}
.about__plate .plate__frame { aspect-ratio: 3 / 4; }
.about__copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.about__title {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}
.about__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 7px 14px;
}
.tag--accent {
  color: var(--accent);
  border-color: rgba(77, 163, 255, 0.35);
}
.callout {
  border: 1px solid rgba(77, 163, 255, 0.3);
  background: rgba(77, 163, 255, 0.05);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.callout__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.callout__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact { padding-bottom: 100px; }
.contact__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: flex-start;
}
.contact__title {
  margin: 0;
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-wrap: balance;
}
.contact__text {
  margin: 0;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.contact__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line-soft); }
.footer__inner {
  padding: 28px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.footer__links {
  display: flex;
  gap: 20px;
}
.footer__link { color: var(--dim); }
.footer__link:hover { color: var(--text); }


/* ==========================================================================
   RESPONSIVE
   Breakpoints, largest first. Each one retunes the rhythm tokens in :root and
   only overrides the handful of rules that need to change shape.
   ========================================================================== */

/* ---- ≤1199px — laptop: the shell stops growing, so tighten the frame ----- */
@media (max-width: 1199px) {
  :root {
    --pad-x: 28px;
    --sec-top: 96px;
    --sec-bottom: 56px;
    --hero-top: 88px;
    --hero-bottom: 76px;
    --gap-col: 48px;
  }
  .company-card__body { padding: 36px; }
}

/* ---- ≤1023px — tablet landscape ----------------------------------------- */
@media (max-width: 1023px) {
  :root {
    --sec-top: 88px;
    --hero-top: 76px;
    --hero-bottom: 64px;
    --gap-col: 40px;
  }
  .hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr); }
  /* Pinned to 2 rather than left to auto-fit: the 300px min needed to keep
     tablets 2-up would otherwise fit *three* cramped cards just under 1024. */
  .work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section__title { margin-bottom: 44px; }
  .company-card__body { padding: 30px; gap: 18px; }
  .company-card__media { min-height: 260px; }
  .stats { gap: 24px; }
}

/* ---- ≤900px — the two-column blocks stack ------------------------------- */
@media (max-width: 900px) {
  .hero__grid,
  .about__grid { grid-template-columns: 1fr; }
  .hero__grid { gap: 44px; }
  .about__grid { gap: 40px; }

  /* Stop the plates ballooning to full tablet width — they read as prints.
     Centred, so they sit on the column's axis rather than hugging one edge. */
  .hero__plate,
  .about__plate {
    max-width: 420px;
    width: 100%;
    margin-inline: auto;
  }

  .company-card--media-right,
  .company-card--media-left { grid-template-columns: 1fr; }
  /* Image first in both cards, whatever the desktop DOM order says. */
  .company-card--media-right .company-card__media { order: -1; }
  .company-card--media-right .company-card__media,
  .company-card--media-left .company-card__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* ---- ≤860px — nav collapses into a full-screen menu --------------------- */
@media (max-width: 860px) {
  .nav__toggle { display: flex; }

  .nav__links {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--nav-h) + 1px);
    height: calc(100vh - var(--nav-h) - 1px);
    height: calc(100dvh - var(--nav-h) - 1px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 0 var(--pad-x) 10vh;
    background: rgba(8, 9, 13, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
  }
  [data-menu-open] .nav__links { opacity: 1; visibility: visible; }

  .nav__link {
    display: flex;
    align-items: baseline;
    gap: 16px;
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--sans);
    font-size: clamp(28px, 8vw, 40px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* Mirrors the (01)–(04) numbering the sections already use. */
  .nav__link::before {
    content: attr(data-index);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--accent);
  }

  .status,
  .nav__mail {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .status { margin-top: 32px; font-size: 12px; padding: 9px 16px; }
  .nav__mail {
    display: block;
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--muted);
  }
  .nav__mail:hover { color: var(--text); }

  /* Staggered entrance — items settle in reading order */
  [data-menu-open] .nav__link,
  [data-menu-open] .status,
  [data-menu-open] .nav__mail { opacity: 1; transform: none; }
  [data-menu-open] .nav__links > :nth-child(1) { transition-delay: 0.05s; }
  [data-menu-open] .nav__links > :nth-child(2) { transition-delay: 0.10s; }
  [data-menu-open] .nav__links > :nth-child(3) { transition-delay: 0.15s; }
  [data-menu-open] .nav__links > :nth-child(4) { transition-delay: 0.20s; }
  [data-menu-open] .nav__links > :nth-child(5) { transition-delay: 0.26s; }
  [data-menu-open] .nav__links > :nth-child(6) { transition-delay: 0.31s; }
}

/* Scroll lock while the menu is open */
html[data-menu-open] { overflow: hidden; }

/* ---- ≤767px — phone ----------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --nav-h: 56px;
    --pad-x: 20px;
    --sec-top: 72px;
    --sec-bottom: 44px;
    --hero-top: 56px;
    --hero-bottom: 56px;
  }

  .hero__title { font-size: clamp(40px, 11vw, 62px); }
  .section__title { font-size: clamp(30px, 7.5vw, 40px); margin-bottom: 32px; }
  .about__title { font-size: clamp(28px, 7vw, 38px); }
  .contact__title { font-size: clamp(38px, 11vw, 56px); }
  .hero__lede,
  .contact__text { font-size: 16px; }
  .hero__kicker,
  .hero__meta { font-size: 11px; }

  .hero__grid { gap: 36px; }
  .about__grid { gap: 32px; }
  .company__list { gap: 20px; }
  .work__grid { grid-template-columns: 1fr; gap: 20px; }

  .company-card__body { padding: 26px 22px 28px; gap: 18px; }
  .work-card__body { padding: 22px 22px 26px; }
  .callout { padding: 22px 20px; }
  .company-card__links { gap: 12px 20px; }

  /* Even thirds instead of a fixed 36px gap, so the labels can wrap in place */
  .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
  }
  .stats__value { font-size: 23px; }
  .stats__label { font-size: 9.5px; letter-spacing: 0.07em; }

  .plate__caption { padding: 11px 13px; font-size: 10px; }
  .marquee { padding: 13px 0; }
  .contact { padding-bottom: 72px; }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ---- ≤520px — CTAs go full width ---------------------------------------- */
@media (max-width: 520px) {
  .hero__actions,
  .contact__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .btn { text-align: center; }
}

/* ---- ≤400px — small phones ---------------------------------------------- */
@media (max-width: 400px) {
  :root { --pad-x: 16px; }
  .hero__title { font-size: clamp(34px, 10.5vw, 44px); }
  .company-card__name { font-size: 20px; }
  .stats { gap: 12px; }
  .stats__value { font-size: 21px; }
  .plate__caption { font-size: 9.5px; letter-spacing: 0.06em; }
  .pill { font-size: 10px; padding: 5px 9px; }
}

/* ---- Landscape phones — reclaim vertical space -------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --hero-top: 44px;
    --hero-bottom: 40px;
    --sec-top: 56px;
    --sec-bottom: 36px;
  }
  .nav__links {
    justify-content: flex-start;
    padding-top: 28px;
    padding-bottom: 28px;
  }
  .nav__link { font-size: 22px; padding: 10px 0; }
  .status { margin-top: 20px; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track,
  .status__dot { animation: none; }
  .nav__link,
  .nav__mail,
  .status,
  .nav__toggle-bar,
  .plate__img,
  .company-card,
  .work-card { transition-duration: 0.01ms; }
}
