/* =========================================================================
   Ekaterina Mironova — Portfolio
   Light, warm minimalism. Editorial serif display + clean grotesque sans.
   ========================================================================= */

:root {
  /* Warm neutral palette */
  --bg:        #FBFAF8;
  --bg-soft:   #F4F2ED;
  --bg-card:   #FFFFFF;
  --ink:       #1A1815;
  --ink-2:     #57534B;
  --ink-3:     #908A7F;
  --line:      #E6E2D9;
  --line-2:    #EFEBE3;
  --accent:    #1A1815;          /* default accent = ink (max calm) */
  --accent-soft: rgba(26,24,21,0.06);

  /* Type */
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-family: var(--font-display);
  --display-weight: 300;
  --display-tracking: -0.02em;

  /* Rhythm */
  --maxw: 1280px;
  --gut: clamp(20px, 5vw, 64px);
  --section-pad: clamp(96px, 14vh, 200px);
  --air: 1;            /* intra-section breathing multiplier (Rhythm tweak) */
  --img-filter: none;  /* imagery richness (Imagery tweak) */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-dist: 26px;
}

/* ---- Dark theme (tweak) -------------------------------------------------- */
[data-theme="dark"] {
  --bg:        #100F0D;
  --bg-soft:   #18161300;
  --bg-soft:   #1A1815;
  --bg-card:   #1C1A17;
  --ink:       #F4F1EA;
  --ink-2:     #B3ADA1;
  --ink-3:     #7C766B;
  --line:      #2C2925;
  --line-2:    #262420;
  --accent:    #F4F1EA;
  --accent-soft: rgba(244,241,234,0.07);
}

/* Accent override targets (links/marks) become colored only when accent != ink */
[data-accent="clay"]   { --accent: #9A5B3F; --accent-soft: rgba(154,91,63,0.10); }
[data-accent="forest"] { --accent: #3C5A4C; --accent-soft: rgba(60,90,76,0.10); }
[data-accent="ink"]    { --accent: var(--ink); }

/* ---- Type character (Tweak): editorial serif / modern grotesk / high-contrast serif ---- */
[data-type="editorial"] { --display-family: var(--font-display); --display-weight: 300; --display-tracking: -0.02em; }
[data-type="grotesk"]   { --display-family: var(--font-sans);    --display-weight: 600; --display-tracking: -0.03em; }
[data-type="contrast"]  { --display-family: "Playfair Display", Georgia, serif; --display-weight: 500; --display-tracking: -0.012em; }

/* ---- Rhythm (Tweak): spaciousness ---- */
[data-space="compact"]   { --section-pad: clamp(56px, 8vh, 112px);  --gut: clamp(16px, 4vw, 48px);  --air: 0.78; }
[data-space="expansive"] { --section-pad: clamp(150px, 21vh, 320px); --gut: clamp(28px, 7vw, 108px); --air: 1.22; }

/* ---- Imagery presence (Tweak): calm vs cinematic ---- */
[data-imagery="cinematic"] { --img-filter: contrast(1.08) saturate(1.07) brightness(0.97); }

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01";
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
  overflow-x: hidden;
}

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

/* ---- Layout primitives -------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.section { padding-block: var(--section-pad); }

/* ---- Type --------------------------------------------------------------- */
h1, h2, h3, .display {
  font-family: var(--display-family);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.lead {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  font-weight: 350;
  text-wrap: pretty;
}

a { color: inherit; text-decoration: none; }

/* ---- Reveal animation --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(var(--reveal-dist)); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* failsafe: commit visible end-state with no transition (covers frozen-clock capture contexts) */
.reveal.shown { opacity: 1 !important; transform: none !important; transition: none !important; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

[data-motion="off"] .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ========================================================================
   NAV
   ======================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gut);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding-block: 16px;
}
.nav-name { font-family: var(--display-family); font-size: 19px; letter-spacing: -0.02em; font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav-links a { font-size: 14.5px; color: var(--ink-2); transition: color 0.25s; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-menu { display: flex; gap: clamp(18px, 3vw, 40px); }
@media (max-width: 720px) { .nav-menu { display: none; } }

.lang {
  display: inline-flex; align-items: center; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; font-size: 12.5px; font-weight: 500;
  background: var(--bg-card);
}
.lang button {
  appearance: none; border: 0; background: transparent; color: var(--ink-3);
  padding: 6px 12px; cursor: pointer; letter-spacing: 0.04em; transition: color 0.2s, background 0.2s;
  font-family: inherit;
}
.lang button.active { color: var(--bg); background: var(--ink); }

.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--ink-2);
  cursor: pointer; transition: color 0.25s, border-color 0.25s, transform 0.4s var(--ease);
  padding: 0;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-btn:active { transform: scale(0.92); }
.theme-btn .ico-sun { display: none; }
[data-theme="dark"] .theme-btn .ico-sun { display: block; }
[data-theme="dark"] .theme-btn .ico-moon { display: none; }

/* ========================================================================
   HERO
   ======================================================================== */
.hero { min-height: 100svh; display: flex; align-items: flex-end; position: relative; padding-bottom: clamp(48px, 8vh, 96px); }
.hero-photo {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
}
.hero-photo image-slot { width: 100%; height: 100%; display: block; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(135% 105% at 6% 112%, var(--bg) 4%, color-mix(in srgb, var(--bg) 52%, transparent) 28%, transparent 60%),
    linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--bg) 68%, transparent) 100%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero h1 { font-size: clamp(52px, 9.5vw, 148px); line-height: 0.98; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; align-items: baseline; }
.hero-role { font-size: clamp(18px, 2.2vw, 26px); color: var(--ink-2); letter-spacing: -0.01em; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 13.5px; color: var(--ink-2); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-card) 60%, transparent);
  backdrop-filter: blur(4px); white-space: nowrap;
  padding: 7px 15px; border-radius: 999px; letter-spacing: 0.01em;
}
.scroll-cue { margin-top: clamp(40px, 7vh, 80px); display: inline-flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.scroll-cue .line { width: 46px; height: 1px; background: var(--ink-3); position: relative; overflow: hidden; }
.scroll-cue .line::after { content:""; position:absolute; inset:0; background: var(--ink); transform: translateX(-100%); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%{transform:translateX(-100%);} 50%{transform:translateX(0);} 100%{transform:translateX(100%);} }

/* ========================================================================
   MANIFEST
   ======================================================================== */
.manifest h2 { font-size: clamp(34px, 5.6vw, 84px); max-width: 18ch; }
.manifest .pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px,2vw,28px); margin-top: calc(clamp(48px, 7vh, 96px) * var(--air)); }
.pillar { border-top: 1px solid var(--line); padding-top: 20px; }
.pillar .n { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.1em; }
.pillar .t { font-family: var(--display-family); font-size: clamp(22px, 2.4vw, 30px); margin-top: 10px; letter-spacing: -0.02em; }
.pillar .d { font-size: 15px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }
@media (max-width: 860px) { .manifest .pillars { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .manifest .pillars { grid-template-columns: 1fr; } }

/* ========================================================================
   PROCESS
   ======================================================================== */
.process { background: var(--bg-soft); transition: background 0.6s var(--ease); }
.process .head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; }
.process h2 { font-size: clamp(32px, 4.6vw, 64px); }
.steps { margin-top: calc(clamp(48px, 7vh, 88px) * var(--air)); }
.step {
  display: grid; grid-template-columns: 88px 1fr auto; gap: clamp(16px,4vw,56px);
  align-items: baseline; padding: clamp(24px,3.4vh,40px) 0; border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step .idx { font-family: var(--display-family); font-size: clamp(26px,3vw,40px); color: var(--ink-3); }
.step .body .t { font-family: var(--display-family); font-size: clamp(26px, 3.4vw, 46px); letter-spacing: -0.02em; transition: color 0.3s; }
.step .body .d { font-size: 16px; color: var(--ink-2); margin-top: 10px; max-width: 56ch; }
.step .meta { font-size: 13px; color: var(--ink-3); letter-spacing: 0.04em; white-space: nowrap; }
.step:hover .body .t { color: var(--accent); }
@media (max-width: 720px) { .step { grid-template-columns: 48px 1fr; } .step .meta { display:none; } }

/* ========================================================================
   PROJECTS / CASES
   ======================================================================== */
.cases .section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; margin-bottom: calc(clamp(40px,6vh,72px) * var(--air)); }
.cases h2 { font-size: clamp(32px, 4.6vw, 64px); }

.case { padding-block: calc(clamp(56px, 9vh, 120px) * var(--air)); border-top: 1px solid var(--line); }
.case:first-of-type { border-top: 0; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 72px); align-items: stretch; }
.case:nth-of-type(even) .case-media { order: 2; }
.case-media { min-height: 460px; }
.case-media image-slot { width: 100%; height: 100%; display:block; }
.case-kicker { display:flex; align-items:center; gap: 14px; font-size: 13px; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }
.case-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.case h3 { font-size: clamp(28px, 3.4vw, 50px); margin-top: 18px; letter-spacing: -0.02em; max-width: 18ch; }
.case-role { font-size: 15px; color: var(--ink-2); margin-top: 16px; }
.case-tar { margin-top: 28px; display: grid; gap: 18px; }
.tar { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: start; }
.tar .lbl { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.tar .val { font-size: 16px; color: var(--ink); line-height: 1.55; }
.tar .val.muted { color: var(--ink-2); }
.metrics { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 56px); margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.metric .num { font-family: var(--display-family); font-size: clamp(34px, 4vw, 56px); letter-spacing: -0.03em; line-height: 1; }
.metric .cap { font-size: 13px; color: var(--ink-2); margin-top: 8px; max-width: 22ch; }
@media (max-width: 820px) {
  .case-grid { grid-template-columns: 1fr; gap: 28px; }
  .case:nth-of-type(even) .case-media { order: 0; }
  .case-media { min-height: 0; aspect-ratio: 3/4; }
  .tar { grid-template-columns: 80px 1fr; }
}

/* ========================================================================
   GALLERY
   ======================================================================== */
.gallery .section-head { margin-bottom: clamp(36px,5vh,56px); }
.gallery h2 { font-size: clamp(32px, 4.6vw, 64px); }
.gal-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(116px, 13.5vw, 188px);
  gap: clamp(10px, 1vw, 16px);
  grid-template-areas:
    "a a b b b c"
    "a a b b b c"
    "a a d d e e"
    "f f d d e e"
    "f f g g g g"
    "f f g g g g";
}
.gal-grid image-slot { display:block; width:100%; height:100%; }
.g { overflow: hidden; }
.g1 { grid-area: a; }   /* big portrait */
.g2 { grid-area: b; }   /* landscape band */
.g3 { grid-area: c; }   /* tall sliver */
.g4 { grid-area: d; }   /* square */
.g6 { grid-area: e; }   /* square */
.g5 { grid-area: f; }   /* big portrait */
.g7 { grid-area: g; }   /* wide band */
@media (max-width: 720px) {
  .gal-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas: none;
    grid-auto-rows: clamp(150px, 38vw, 230px);
    grid-auto-flow: dense;
  }
  .g1,.g2,.g3,.g4,.g5,.g6,.g7 { grid-area: auto; }
  .g1, .g5 { grid-row: span 2; }
  .g2, .g7 { grid-column: 1 / -1; }
}

/* ========================================================================
   TIMELINE
   ======================================================================== */
.timeline { background: var(--bg-soft); transition: background 0.6s var(--ease); }
.timeline h2 { font-size: clamp(32px, 4.6vw, 64px); }
.tl { margin-top: calc(clamp(44px,6vh,80px) * var(--air)); }
.tl-row {
  display: grid; grid-template-columns: 140px 1fr; gap: clamp(20px,4vw,64px);
  padding: calc(clamp(24px,3.2vh,38px) * var(--air)) 0; border-top: 1px solid var(--line);
}
.tl-row:last-child { border-bottom: 1px solid var(--line); }
.tl-year { font-family: var(--display-family); font-size: clamp(20px,2vw,26px); color: var(--ink-2); }
.tl-role { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.01em; font-weight: 500; }
.tl-org { font-size: 15px; color: var(--ink-3); margin-top: 4px; }
.tl-desc { font-size: 15.5px; color: var(--ink-2); margin-top: 14px; max-width: 64ch; line-height: 1.55; }
.tl-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.tl-chip { font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px; }
@media (max-width: 640px) { .tl-row { grid-template-columns: 1fr; gap: 8px; } }

/* ========================================================================
   CONTACT
   ======================================================================== */
.contact { position: relative; min-height: 92svh; display:flex; align-items: center; overflow: hidden; }
.contact-photo { position:absolute; inset:0; z-index:0; }
.contact-photo image-slot { width:100%; height:100%; display:block; }
.contact-scrim { position:absolute; inset:0; z-index:1; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 42%, rgba(0,0,0,0) 80%); }
.contact-inner { position: relative; z-index: 2; width: 100%; }
.contact h2 { font-size: clamp(40px, 7vw, 112px); line-height: 1.0; max-width: 14ch; }
.contact .lead { margin-top: 24px; max-width: 44ch; }
.btn {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 40px;
  background: var(--ink); color: var(--bg); padding: 18px 30px; border-radius: 999px;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.3s var(--ease), background 0.3s, gap 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); gap: 20px; }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 40px; }
.contact-links a { font-size: 15.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: color 0.25s, border-color 0.25s; }
.contact-links a:hover { color: var(--ink); border-color: var(--ink); }

/* ---- Footer ------------------------------------------------------------- */
.footer { padding: 40px var(--gut); display:flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }

/* image-slot base look (placeholder) */
image-slot { background: var(--bg-soft); }
[data-theme="dark"] image-slot { background: #211F1B; }

/* Filled photo slots: native cover with a face-favoring crop. The component
   centers by default, which clips faces (upper third) on wide frames. */
image-slot::part(image) {
  width: 100% !important; height: 100% !important;
  left: 0 !important; top: 0 !important; transform: none !important;
  object-fit: cover !important; object-position: 50% 24% !important;
  filter: var(--img-filter) !important;
  transition: filter 0.5s var(--ease);
}
/* the floor / headphones shot sits at the bottom of its frame */
image-slot#g2::part(image) { object-position: 50% 82% !important; }
/* fluted-glass shot: subject sits on the right — bias the tall sliver toward her */
image-slot#g3::part(image) { object-position: 70% 22% !important; }
/* sitting side profile in the wide band — centre on her upper body */
image-slot#g7::part(image) { object-position: 50% 38% !important; }

/* ---- Imagery presence: cinematic intensifies photos, scrims and framing ---- */
[data-imagery="cinematic"] .hero h1 { font-size: clamp(58px, 11vw, 172px); }
[data-imagery="cinematic"] .hero-scrim {
  background:
    radial-gradient(135% 105% at 6% 112%, var(--bg) 8%, color-mix(in srgb, var(--bg) 58%, transparent) 30%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent) 0%, transparent 26%, transparent 52%, color-mix(in srgb, var(--bg) 80%, transparent) 100%);
}
[data-imagery="cinematic"] .contact-scrim {
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 46%, color-mix(in srgb, var(--bg) 12%, transparent) 82%, transparent 100%);
}
[data-imagery="cinematic"] .case-grid { grid-template-columns: 1.18fr 1fr; }
[data-imagery="cinematic"] .gal-grid { gap: clamp(6px, 0.9vw, 12px); }
@media (max-width: 820px) {
  [data-imagery="cinematic"] .case-grid { grid-template-columns: 1fr; }
}
