/* =====================================================
   Karim El Yaagoubi  Portfolio
   Theme: Red + Black, engineering aesthetic
   ===================================================== */

:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --surface: #15151a;
  --surface-2: #1c1c22;
  --border: #25252d;
  --border-strong: #34343f;

  --text: #f4f4f5;
  --text-dim: #b1b1b8;
  --text-mute: #7c7c85;

  --red: #e10600;
  --red-bright: #ff2a2a;
  --red-soft: rgba(225, 6, 0, 0.12);
  --red-glow: rgba(225, 6, 0, 0.35);

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1180px;

  --font-sans: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-red: 0 8px 30px -8px var(--red-glow);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; padding: 0; margin: 0; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

::selection { background: var(--red); color: #fff; }

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ==== Background layers ==== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000 30%, transparent 75%);
}

.bg-glow {
  position: fixed;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at center, var(--red-glow) 0%, transparent 60%);
  filter: blur(40px);
  opacity: 0.55;
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-red);
}
.btn--primary:hover {
  background: var(--red-bright);
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn--ghost:hover {
  border-color: var(--red);
  color: var(--red-bright);
  transform: translateY(-2px);
}

/* ==== Navigation ==== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 10, 11, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.85);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-red);
}
.brand__name { font-size: 1rem; letter-spacing: 0.01em; }
.brand__dot { color: var(--red); margin: 0 0.15rem; }

.nav__links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.95rem;
}
.nav__links a {
  color: var(--text-dim);
  position: relative;
  transition: color 0.2s ease;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.25s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ==== Hero ==== */
.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 6rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(225, 6, 0, 0.06);
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.eyebrow__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 6, 0, 0.2);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(225, 6, 0, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(225, 6, 0, 0); }
}

.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}

.grad {
  background: linear-gradient(120deg, var(--red) 0%, var(--red-bright) 50%, #ff7a7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  max-width: 56ch;
  margin: 0 0 2rem;
}
.hero__lead strong { color: var(--text); font-weight: 600; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.8rem;
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 480px;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.hero__meta li {
  display: flex; flex-direction: column;
}
.hero__meta strong {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--red-bright);
  letter-spacing: -0.02em;
}
.hero__meta span {
  font-size: 0.82rem;
  color: var(--text-mute);
  margin-top: 0.2rem;
}

/* ==== Code window ==== */
.window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(225, 6, 0, 0.06) inset;
  transform: rotate(0.4deg);
  transition: transform 0.4s ease;
}
.window:hover { transform: rotate(0deg) translateY(-4px); }

.window__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}
.dot--red { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.window__title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
}

.code {
  margin: 0;
  padding: 1.4rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.c-key { color: #ff5757; }
.c-cls { color: #fbbf77; }
.c-str { color: #7ee787; }

.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 38px;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.hero__scroll span {
  width: 3px; height: 7px;
  background: var(--red);
  border-radius: 2px;
  animation: scrolly 1.6s ease-in-out infinite;
}
@keyframes scrolly {
  0% { transform: translateY(-6px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

/* ==== Sections ==== */
.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section__num {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}
.section__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border) 0%, transparent 100%);
  max-width: 320px;
}

/* ==== About ==== */
.about {
  display: grid;
  gap: 1.2rem;
  max-width: 780px;
  font-size: 1.05rem;
  color: var(--text-dim);
}
.about p strong { color: var(--text); font-weight: 600; }

.about__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface);
}

/* ==== Projects ==== */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(450px circle at var(--mx, 50%) var(--my, 0%), rgba(225, 6, 0, 0.10), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: rgba(225, 6, 0, 0.45);
    box-shadow: var(--shadow-soft), 0 0 0 1px rgba(225, 6, 0, 0.18);
  }
  .card:hover::before { opacity: 1; }
}

.card--featured {
  border-color: rgba(225, 6, 0, 0.35);
  background:
    linear-gradient(180deg, rgba(225, 6, 0, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
}

.card__top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red-bright);
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 6, 0, 0.2);
}
.card__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.03em;
}
.badge {
  margin-left: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  letter-spacing: 0.04em;
}
.badge--alt {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.card__title {
  font-size: 1.2rem;
  margin: 0 0 0.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 1.1rem;
  flex: 1;
}
.card__highlight {
  color: var(--text);
  font-size: 0.9rem;
  margin: 0 0 1.1rem;
  padding: 0.7rem 0.9rem;
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  border-radius: 6px;
}
.card__highlight strong { color: var(--red-bright); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  text-transform: lowercase;
}

/* ==== Skills ==== */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.skill {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill:hover {
  border-color: var(--red);
  transform: translateY(-3px);
}
.skill h3 {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
  font-family: var(--font-mono);
  font-weight: 500;
}
.skill ul {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.skill li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.93rem;
}
.skill li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* ==== Timeline ==== */
.timeline {
  position: relative;
  padding-left: 1.75rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 820px;
}
.timeline__item {
  position: relative;
}
.timeline__dot {
  position: absolute;
  left: -2.07rem;
  top: 0.4rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(225, 6, 0, 0.15);
}
.timeline__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.timeline__top h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.timeline__top span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mute);
}
.timeline__body p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ==== Contact ==== */
.section--contact {
  padding-bottom: clamp(5rem, 10vw, 8rem);
}
.contact {
  max-width: 880px;
}
.contact__lead {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0 0 2rem;
  max-width: 640px;
}
.contact__lead strong { color: var(--text); font-weight: 600; }

.contact__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.contact__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact__card:hover {
  transform: translateY(-3px);
  border-color: var(--red);
  box-shadow: var(--shadow-red);
}
.contact__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}
.contact__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}
.contact__value {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

/* ==== Footer ==== */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 0.85rem;
  color: var(--text-mute);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer__top {
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.footer__top:hover { color: var(--red); }

/* ==== Reveal animation ==== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   Responsive — mobile-first refinements
   Breakpoints: 1024 / 768 / 560 / 400
   ===================================================== */

/* ? 1024px — tablets / small laptops */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__panel { order: -1; max-width: 560px; margin-inline: auto; width: 100%; }
  .hero__content { text-align: left; }
  .nav__cta { display: none; }
}

/* ? 768px — phones / small tablets */
@media (max-width: 768px) {
  .container {
    width: min(100% - 2rem, var(--container));
  }

  /* Mobile nav drawer */
  .nav__inner { padding: 0.85rem 0; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 11, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.5rem 2rem;
    gap: 1.4rem;
    font-size: 1.05rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.25s ease;
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__links a { padding: 0.4rem 0; }
  .nav__links a::after { display: none; }
  .nav__toggle { display: flex; }

  /* Hamburger ? X animation */
  .nav__toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .nav__toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav__toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Brand: keep compact */
  .brand__name { font-size: 0.95rem; }

  /* Hero */
  .hero { padding: 2rem 0 4rem; }
  .hero__title { font-size: clamp(2rem, 8.5vw, 2.9rem); }
  .hero__lead { font-size: 1rem; margin-bottom: 1.75rem; }
  .hero__cta { gap: 0.7rem; margin-bottom: 2.25rem; }
  .btn { padding: 0.8rem 1.2rem; font-size: 0.92rem; min-height: 44px; }

  .hero__meta {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    padding-top: 1.25rem;
  }
  .hero__meta strong { font-size: 1.35rem; }
  .hero__meta span { font-size: 0.75rem; }

  .hero__scroll { display: none; }

  /* Code window — flatten and shrink */
  .window { transform: none; }
  .window:hover { transform: none; }
  .code { font-size: 0.78rem; padding: 1.1rem 1.2rem; line-height: 1.65; }
  .window__bar { padding: 0.6rem 0.85rem; }

  /* Sections */
  .section { padding: 3.5rem 0; }
  .section__line { display: none; }
  .section__head { gap: 0.75rem; margin-bottom: 2rem; }

  /* Cards */
  .card { padding: 1.4rem; }
  .card__title { font-size: 1.1rem; }
  .card__desc { font-size: 0.92rem; }
  .badge { font-size: 0.65rem; padding: 0.25rem 0.55rem; }

  /* Skills */
  .skills { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
  .skill { padding: 1.2rem; }
  .skill h3 { font-size: 0.72rem; margin-bottom: 0.75rem; }
  .skill li { font-size: 0.88rem; }

  /* Timeline */
  .timeline { padding-left: 1.4rem; gap: 1.6rem; }
  .timeline__dot { left: -1.72rem; width: 12px; height: 12px; }
  .timeline__top h3 { font-size: 1rem; }
  .timeline__top span { font-size: 0.78rem; }

  /* Contact */
  .contact__lead { font-size: 1rem; }
  .contact__cards { gap: 0.75rem; }
  .contact__card { padding: 1rem 1.1rem; gap: 0.85rem; }
  .contact__icon { width: 40px; height: 40px; }
  .contact__value { font-size: 0.9rem; }

  .footer { padding: 1.25rem 0; }
  .footer__inner { justify-content: center; text-align: center; font-size: 0.8rem; }

  /* Touch-friendly tap targets */
  .nav__links a,
  .footer__top,
  .contact__card { min-height: 44px; }
}

/* ? 560px — most phones in portrait */
@media (max-width: 560px) {
  .hero__title { font-size: clamp(1.85rem, 9vw, 2.5rem); line-height: 1.1; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }

  .eyebrow { font-size: 0.7rem; padding: 0.4rem 0.75rem; margin-bottom: 1.25rem; }

  .hero__meta { grid-template-columns: 1fr 1fr; gap: 1rem 0.85rem; max-width: 100%; }
  .hero__meta li:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
  }
  .hero__meta strong { font-size: 1.25rem; }

  .skills { grid-template-columns: 1fr; }
  .projects { gap: 1rem; }

  .section__head {
    flex-wrap: wrap;
  }
  .section__title { font-size: 1.45rem; }

  .card__top { flex-wrap: wrap; row-gap: 0.5rem; }
  .badge { margin-left: 0; }

  .timeline__top { flex-direction: column; gap: 0.15rem; }
}

/* ? 400px — very small phones */
@media (max-width: 400px) {
  .container { width: min(100% - 1.5rem, var(--container)); }
  .brand__name { display: none; }
  .nav__inner { gap: 0.75rem; }
  .hero__title { font-size: 1.7rem; }
  .code { font-size: 0.72rem; padding: 1rem; }
  .card { padding: 1.2rem; }
  .section__num { font-size: 0.78rem; }
}

/* Landscape phones — keep hero from feeling cramped */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { padding: 2.5rem 0 3rem; }
  .hero__scroll { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
