/* ============================================================
   Portfolio — portfolio.ai-nextstep.eu
   Design DNA: 05 Locomotive (scroll narrative, dark cinematic)
   × Origin Financial tokens (obsidian canvas, serif display 300,
   three-voice typography, white-on-black primary action)
   ============================================================ */

:root {
  /* Surfaces (Origin Financial) */
  --obsidian: #0f1011;
  --abyss: #090a0b;
  --graphite: #17181b;
  --graphite-hover: #1d1e22;
  --silver: #cacaca;

  /* Text */
  --pure: #ffffff;
  --cloud: #f5f5f7;
  --ash: #9f9fa0;
  --fog: #8b8c8d;

  /* Accent — used sparingly (Locomotive: strategic glowing accents) */
  --iris: #847dff;
  --pale-iris: #d1c9ff;

  /* Lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --container: 1200px;
  --section-gap: clamp(96px, 12vw, 160px);
  --nav-h: 72px;
}

/* ---------- Reset & base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  background: var(--obsidian);
  color: var(--pure);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(132, 125, 255, 0.35); color: #fff; }

a:focus,
.btn:focus {
  outline: 2px solid var(--iris);
  outline-offset: 3px;
  border-radius: 2px;
}

:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--pure);
  color: #000;
  font-size: 14px;
  border-radius: 8px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

/* ---------- Typography voices ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--cloud);
}

.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--pure);
}

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

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--pure);
  color: #000;
}
.btn-primary:hover { background: var(--pale-iris); }
.btn-primary .btn-arrow { transition: transform 0.2s ease; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--pure);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.6); }

.btn-sm { padding: 10px 16px; font-size: 14px; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: rgba(15, 16, 17, 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: rgba(15, 16, 17, 0.86);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--nav-h);
}

.logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--pure);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--iris);
  box-shadow: 0 0 10px rgba(132, 125, 255, 0.8);
}

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ash);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--pure); }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px circle at 50% 12%, rgba(132, 125, 255, 0.13), transparent 68%),
    radial-gradient(900px circle at 85% 90%, rgba(132, 125, 255, 0.05), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: 100%;
  padding-block: 64px;
}

.eyebrow { color: var(--pale-iris); }

.hero-title {
  margin-top: 24px;
  font-size: clamp(46px, 8.4vw, 96px);
  max-width: 15ch;
}

.hero-sub {
  margin-top: 28px;
  max-width: 560px;
  font-size: 18px;
  color: var(--ash);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fog);
}

/* ---------- Marquee ---------- */

.marquee {
  border-block: 1px solid var(--line-soft);
  padding-block: 18px;
  overflow: hidden;
  background: var(--abyss);
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog);
  animation: marquee 36s linear infinite;
}

.marquee-set {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}
.marquee-track span { color: var(--ash); }
.marquee-track i { font-style: normal; color: var(--iris); }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section-gap); }

.section-alt { background: var(--abyss); }

.section-label { color: var(--fog); }

.section-title {
  margin-top: 20px;
  font-size: clamp(34px, 4.6vw, 56px);
  max-width: 20ch;
}

/* ---------- About ---------- */

.about-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
}

.about-lead {
  font-size: 21px;
  line-height: 1.55;
  color: var(--cloud);
  font-weight: 300;
}

.about-text { color: var(--ash); }

.stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  background: var(--graphite);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-invert {
  background: var(--silver);
  border-color: var(--silver);
  color: #000;
}
.stat-invert .stat-num { color: #000; }
.stat-invert .stat-label { color: rgba(0, 0, 0, 0.66); }

.stat-num {
  font-size: clamp(40px, 4.6vw, 56px);
  color: var(--pure);
}

.stat-label {
  font-size: 14px;
  color: var(--ash);
  max-width: 22ch;
}

/* ---------- Works ---------- */

.works-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--graphite);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: rgba(132, 125, 255, 0.45);
  background: var(--graphite-hover);
  transform: translateY(-4px);
}

.card-num { color: var(--iris); }

.card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--cloud);
}

.card-text { color: var(--ash); font-size: 15px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
}

.card-link {
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  color: var(--pale-iris);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-link span { transition: transform 0.2s ease; }
.card-link:hover span { transform: translateX(4px); }
.card-link:hover { color: var(--pure); }

.works-note { margin-top: 32px; color: var(--fog); letter-spacing: 0.08em; text-transform: none; font-size: 11px; }

/* ---------- Contacts ---------- */

.contacts-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contacts-inner .section-title { max-width: 16ch; }

.contacts-sub {
  margin-top: 24px;
  max-width: 480px;
  color: var(--ash);
  font-size: 18px;
}

.contacts-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

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

.footer {
  border-top: 1px solid var(--line-soft);
  background: var(--abyss);
  padding-block: 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner .mono-label { color: var(--fog); letter-spacing: 0.12em; }

.to-top { color: var(--ash); transition: color 0.2s ease; }
.to-top:hover { color: var(--pure); }

/* ---------- Reveal motion (Locomotive: typography emerging from darkness) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.js [data-reveal][data-delay="1"] { transition-delay: 0.12s; }
.js [data-reveal][data-delay="2"] { transition-delay: 0.24s; }
.js [data-reveal][data-delay="3"] { transition-delay: 0.36s; }
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .marquee-track { animation: none; }
  .btn, .card, .card-link span, .btn-arrow { transition: none; }
  a:focus, .btn:focus { outline: none; }
}

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

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .works-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 24px; }
  .stat-num { font-size: 40px; }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .hero-title { font-size: clamp(38px, 11vw, 52px); }
  .hero-sub { font-size: 16px; }
  .section-title { font-size: clamp(30px, 8vw, 40px); }
  .card { padding: 24px; }
  .card-title { font-size: 24px; }
  .contacts-actions { flex-direction: column; align-items: stretch; }
  .contacts-actions .btn { justify-content: center; }
  .footer-inner { justify-content: center; text-align: center; }
  .hero-scroll { display: none; }
}
