/* ============================================================
   Aleksandra Slahova — Portfolio
   Light editorial system · Inter caps + serif accents · >< motif
   ============================================================ */

:root {
  --bg: #0e0d12;
  --bg-2: #15131b;
  --ink: #edeaf2;
  --muted: #8d8798;
  --line: rgba(237, 234, 242, 0.14);
  --accent: #c4b0ff;
  --accent-ink: #14101f;
  --glow: 0.35;
  --display: "Inter", sans-serif;
  --serif: "Instrument Serif", serif;
  --mono: "IBM Plex Mono", monospace;
  --body: "Inter", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 200;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}
body[data-grain="off"] .grain { display: none; }
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.5%); }
  50% { transform: translate(1.5%, -2%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 3.5vw, 56px);
  mix-blend-mode: normal;
}
.nav::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(14, 13, 18, 0.92), rgba(14, 13, 18, 0));
  pointer-events: none;
}
.nav > * { position: relative; }
.nav-logo {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-logo img {
  width: 28px; height: 28px;
  display: block;
}
.nav-logo sup { font-size: 0.5em; color: var(--accent); }
.nav-links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex; gap: clamp(16px, 2.5vw, 36px);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: lowercase;
}
.nav-links a {
  color: var(--muted);
  transition: color 160ms ease;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links a[aria-current="page"]::before { content: "> "; }
.nav-links a[aria-current="page"]::after { content: " <"; }
.nav-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--line);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav.open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (max-width: 860px) {
  .nav-meta { display: none; }
  .nav-burger { display: flex; }
  .nav-links {
    position: absolute;
    left: 0; right: 0; top: 100%;
    transform: none;
    flex-direction: column;
    gap: 0;
    padding: 6px 0 10px;
    background: var(--menu-bg, #131017);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a {
    padding: 14px clamp(20px, 3.5vw, 56px);
    font-size: 15px;
  }
}

/* ---------- type voices ---------- */
.label {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: lowercase;
}
.label .acc { color: var(--accent); }
.serif-note {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}
.display {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-transform: uppercase;
}
.nav-logo, .project-num, .project-title, .footer-mail, .fact h3 { font-weight: 900; }
.project-title, .fact h3 { text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.9; }

/* ---------- section scaffold ---------- */
.section {
  padding: clamp(72px, 10vw, 140px) clamp(20px, 3.5vw, 56px);
  position: relative;
}
.section-head {
  display: flex; align-items: baseline; gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: clamp(40px, 6vw, 88px);
}
.section-head .display { font-size: clamp(44px, 7vw, 104px); }
.section-head .serif-note { font-size: clamp(22px, 2.6vw, 40px); color: var(--accent); }
.section-head .label { margin-left: auto; text-align: right; }

/* ---------- reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-reveal].in { opacity: 1; transform: none; }
body[data-motion="off"] [data-reveal] { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 14px 0;
  background: var(--bg);
}
.marquee-track {
  display: flex; gap: 0;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 12px;
}
.marquee-track span i {
  font-style: normal;
  color: var(--accent);
  padding-right: 12px;
}
@keyframes marquee { to { transform: translateX(-50%); } }
body[data-motion="off"] .marquee-track,
.marquee-track:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- project cards ---------- */
.project {
  display: grid;
  grid-template-columns: minmax(150px, 0.2fr) 1fr minmax(360px, 0.52fr);
  gap: clamp(32px, 4.5vw, 88px);
  align-items: start;
  border-top: 1px solid var(--line);
  padding: clamp(48px, 6vw, 96px) 0;
  position: relative;
}
.project-num {
  font-family: var(--display);
  font-size: clamp(56px, 7vw, 130px);
  line-height: 0.8;
  color: var(--bg);
  -webkit-text-stroke: 1.5px var(--muted);
  paint-order: stroke fill;
  transition: color 300ms ease, -webkit-text-stroke-color 300ms ease;
  user-select: none;
  align-self: start;
}
.project:hover .project-num { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.project-body { display: grid; gap: clamp(20px, 2vw, 30px); }
.project-top {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
}
.project-title {
  font-family: var(--display);
  font-size: clamp(30px, 4.2vw, 62px);
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-transform: uppercase;
}
.project-title .serif-note { display: block; font-size: 0.52em; color: var(--accent); margin-top: 12px; letter-spacing: 0; line-height: 1; text-transform: none; }
.project-tags { margin-left: 0; display: flex; flex-wrap: wrap; gap: 12px 18px; }
.project-desc { max-width: 52ch; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.project-media {
  display: flex; gap: clamp(12px, 1.6vw, 24px);
  align-items: stretch;
}

/* single side-image per project */
.project-visual { width: 100%; }
.project-visual image-slot { width: 100%; height: auto; display: block; }
.v-app { aspect-ratio: 4 / 3; }
.v-wide { aspect-ratio: 4 / 3; }
.v-stack { aspect-ratio: 4 / 3; }
.v-square { aspect-ratio: 4 / 3; }
.project-link {
  position: absolute; inset: 0; z-index: 2;
}
.project .go {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  display: inline-flex; gap: 8px;
  margin-top: 6px;
  transition: color 200ms ease, transform 200ms ease;
}
.project:hover .go { color: var(--accent); transform: translateX(6px); }

image-slot { background: var(--bg-2); }

@media (max-width: 860px) {
  .project { grid-template-columns: auto 1fr; }
  .project-num { font-size: 56px; }
  .project-media { flex-wrap: wrap; }
  .project-visual { grid-column: 1 / -1; }
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(56px, 8vw, 110px) clamp(20px, 3.5vw, 56px) 36px;
  display: grid;
  gap: clamp(40px, 6vw, 80px);
}
.footer-mail {
  font-family: var(--display);
  font-size: clamp(22px, 4.2vw, 64px);
  letter-spacing: -0.02em;
  text-transform: lowercase;
  line-height: 1;
  word-break: break-all;
  display: inline-block;
  transition: color 200ms ease;
}
.footer-mail:hover { color: var(--accent); }
.footer-mail .serif-note { color: var(--accent); font-size: 0.85em; }
.soc-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.soc {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px;
  text-transform: lowercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 11px 18px;
  transition: color 200ms ease, border-color 200ms ease;
}
.soc:hover { color: var(--accent); border-color: var(--accent); }
.soc-glyph {
  width: 18px; height: 18px;
  border: 1.5px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; line-height: 1;
  box-sizing: border-box;
}
.soc svg { width: 18px; height: 18px; display: block; }
.footer-row {
  display: flex; flex-wrap: wrap; gap: 16px 36px;
  justify-content: space-between;
  align-items: baseline;
}
.footer-row a:hover { color: var(--accent); }

/* ---------- fact table (about / work) ---------- */
.facts { display: grid; gap: 0; }
.fact {
  display: grid;
  grid-template-columns: minmax(90px, 0.22fr) 1fr auto;
  gap: 16px 28px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact h3 {
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-weight: 400;
}
.fact p { color: var(--muted); font-size: 14.5px; max-width: 62ch; }
@media (max-width: 720px) {
  .fact { grid-template-columns: 1fr; gap: 8px; }
}

/* ============================================================
   CASE STUDY PAGES  ·  shared 12-section system
   ============================================================ */

/* image-slot defaults a fixed 160px height via :host — override so our
   aspect-ratio classes drive height (selector beats :host specificity) */
.cs image-slot, .cs-hero image-slot { height: auto; }

/* breadcrumb back-bar */
.cs-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px;
  padding: 12px clamp(20px, 3.5vw, 56px);
  background: rgba(14, 13, 18, 0.78);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.cs-bar a { transition: color 160ms ease; white-space: nowrap; }
.cs-bar a:hover { color: var(--accent); }
.cs-bar .cs-bar-mid { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .cs-bar .cs-bar-mid { display: none; } }

/* ---------- 01 · hero ---------- */
.cs-hero {
  padding: 130px clamp(20px, 3.5vw, 56px) clamp(40px, 5vw, 72px);
}
.cs-hero-top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px; margin-bottom: clamp(24px, 4vw, 48px);
}
.cs-hero-top .acc { color: var(--accent); }
.cs-hero-top .cs-hero-back { margin-left: auto; transition: color 160ms ease; }
.cs-hero-top .cs-hero-back:hover { color: var(--accent); }
.cs-hero-title {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(56px, 12vw, 200px);
  letter-spacing: -0.05em; line-height: 0.86;
  text-transform: uppercase;
  color: var(--accent);
}
.cs-hero-sub {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(24px, 3.4vw, 56px);
  color: var(--ink);
  margin-top: 6px;
}
.cs-hero-lede {
  max-width: 60ch; color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
  margin-top: clamp(20px, 3vw, 36px);
  text-wrap: pretty;
}
.cs-hero-img {
  margin-top: clamp(32px, 5vw, 72px);
  width: 100%;
  aspect-ratio: 16 / 8.2;
}

/* ---------- section scaffold ---------- */
.cs {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 104px) clamp(20px, 3.5vw, 56px);
}
.cs-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px;
  margin-bottom: clamp(28px, 4vw, 52px);
}
.cs-num {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.04em;
}
.cs-kicker {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(30px, 4.6vw, 76px);
  letter-spacing: -0.05em; line-height: 0.9;
  text-transform: uppercase;
}
.cs-tag { margin-left: auto; }

/* body layouts */
.cs-lede {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(26px, 4vw, 58px);
  line-height: 1.12; letter-spacing: -0.01em;
  max-width: 22ch; text-wrap: pretty;
}
.cs-lede em { color: var(--accent); }
.cs-cols {
  display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 72px); align-items: start;
}
.cs-prose { color: var(--muted); font-size: 16.5px; max-width: 62ch; text-wrap: pretty; }
.cs-prose + .cs-prose { margin-top: 1em; }
.cs-prose strong { color: var(--ink); font-weight: 600; }

.cs-points { display: grid; gap: 14px; list-style: none; margin-top: 4px; }
.cs-points li {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px;
  color: var(--muted); font-size: 15.5px; max-width: 62ch;
}
.cs-points li::before { content: "→"; color: var(--accent); font-family: var(--mono); }

/* fact rows for role & scope */
.cs-facts { display: grid; gap: 0; align-content: start; }
.cs-fact {
  display: grid; grid-template-columns: minmax(96px, 0.2fr) 1fr; gap: 14px 24px;
  border-top: 1px solid var(--line);
  padding: 16px 0; font-size: 15px;
}
.cs-fact:last-child { border-bottom: 1px solid var(--line); }
.cs-fact dt { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: lowercase; }
.cs-fact dd { color: var(--ink); }

/* process steps */
.cs-steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(20px, 2.6vw, 40px);
}
.cs-step { border-top: 1px solid var(--line); padding-top: 18px; }
.cs-step .n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cs-step h4 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -0.04em;
  text-transform: uppercase; line-height: 0.95;
  margin: 10px 0 8px;
}
.cs-step p { color: var(--muted); font-size: 14.5px; }

/* galleries */
.cs-gal { display: grid; gap: clamp(12px, 1.6vw, 22px); }
.cs-gal-row { display: flex; gap: clamp(12px, 1.6vw, 22px); }
.cs-gal-row > * { flex: 1; min-width: 0; }
.cs-phone { aspect-ratio: 9 / 19; flex: 0 0 auto; width: clamp(150px, 17vw, 250px); }
.cs-wide { aspect-ratio: 16 / 9; }
.cs-half { aspect-ratio: 4 / 3; }
.cs-tall { aspect-ratio: 3 / 4; }
.cs-screens {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(12px, 1.6vw, 22px);
}
.cs-screens image-slot { aspect-ratio: 9 / 19; }
.cs-square-slot { aspect-ratio: 1 / 1; }

/* design system tokens */
.cs-swatches { display: flex; flex-wrap: wrap; gap: 16px; }
.cs-swatch { display: grid; gap: 8px; }
.cs-chip {
  width: clamp(72px, 9vw, 120px); aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
}
.cs-swatch .label { font-size: 11.5px; }
.cs-type-spec {
  font-family: var(--display); font-weight: 900;
  letter-spacing: -0.04em; text-transform: uppercase; line-height: 0.9;
}

/* outcome stats */
.cs-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(20px, 3vw, 48px);
}
.cs-stat { border-top: 1px solid var(--line); padding-top: 18px; }
.cs-stat .big {
  display: block;
  font-family: var(--display); font-weight: 900;
  font-size: clamp(48px, 6vw, 96px);
  letter-spacing: -0.05em; line-height: 0.86;
  color: var(--accent);
}
.cs-stat .cap { color: var(--muted); font-size: 14px; margin-top: 8px; display: block; }

/* next project */
.cs-next {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 104px) clamp(20px, 3.5vw, 56px);
  display: block;
}
.cs-next .label { display: block; margin-bottom: 14px; }
.cs-next-title {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(48px, 10vw, 170px);
  letter-spacing: -0.05em; line-height: 0.86; text-transform: uppercase;
  color: var(--bg); -webkit-text-stroke: 1.5px var(--muted);
  paint-order: stroke fill;
  transition: color 300ms ease, -webkit-text-stroke-color 300ms ease;
  display: inline-block;
}
.cs-next:hover .cs-next-title { color: var(--accent); -webkit-text-stroke-color: var(--accent); }

/* keep footer clear of the fixed bottom bar */
body:has(.cs-bar) .footer { padding-bottom: 84px; }

@media (max-width: 860px) {
  .cs-cols { grid-template-columns: 1fr; }
  .cs-gal-row { flex-wrap: wrap; }
  .cs-gal-row > * { flex-basis: 100%; }
  .cs-phone { width: 46%; flex: 0 0 auto; }
}
