/* ============================================================
   Vika Levina — Portfolio
   Shared styles
   ============================================================ */

:root {
  --white: #ffffff;
  --ink: #000000;
  --ink-2: #1a1a1a;
  --gray: #8e8e93;
  --gray-2: #595959;
  --gray-3: #727272;
  --gray-4: #aeaeb2;
  --card: #f2f2f7;
  --blue: #1d2e8d;
  --tag-bg: #d7e1f6;
  --tag-border: #d9d9d9;
  --label: #3e384d;
  --btn: #141414;

  --maxw: 1360px;

  --font-head: 'Roboto', -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-num: 'Inter', -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.site-header.scrolled { border-color: rgba(0, 0, 0, 0.06); }

.nav {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 44px;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: opacity 0.3s var(--ease);
}
.logo:hover { opacity: 0.62; }

.menu { display: flex; align-items: center; gap: 12px; }
.pill {
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 1;
  padding: 13px 20px;
  border-radius: 32px;
  color: var(--ink);
  background: transparent;
  position: relative;
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), color 0.45s var(--ease);
}
.pill:hover { background: var(--card); transform: translateY(-1px); }
.pill.active { background: var(--btn); color: var(--white); }
.pill.active:hover { background: #000; }

.nav-close {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: var(--white);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  flex: none;
}
.nav-close:hover { transform: rotate(90deg) scale(1.06); border-color: rgba(0, 0, 0, 0.3); background: var(--card); }
.nav-close svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--btn);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 22px;
  line-height: 28px;
  color: var(--white);
  background: var(--bg);
  padding: 12px 26px;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  will-change: transform;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 160% at 50% 120%, #3a3a3a 0%, var(--btn) 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.btn .btn-label { position: relative; display: inline-block; transition: transform 0.5s var(--ease); }
.btn .btn-arrow {
  width: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: width 0.5s var(--ease), opacity 0.5s var(--ease), transform 0.5s var(--ease);
  display: inline-flex;
  overflow: hidden;
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px -16px rgba(0, 0, 0, 0.55);
}
.btn:hover::before { opacity: 1; }
.btn:hover .btn-arrow { width: 22px; opacity: 1; transform: translateX(0); }
.btn:active { transform: translateY(-1px) scale(0.98); }

/* ---------- Reveal animation ----------
   Elements are VISIBLE by default. They only hide while the <html.anim>
   gate is present (added synchronously in <head>, always removed by a
   failsafe) — so content can never get stuck hidden. */
html.anim .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
html.anim .reveal.in { opacity: 1; transform: none; }
html.anim .reveal.d1 { transition-delay: 0.08s; }
html.anim .reveal.d2 { transition-delay: 0.16s; }
html.anim .reveal.d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Hero ---------- */
.hero { padding-top: 70px; text-align: center; }
.hero .welcome {
  font-family: var(--font-body);
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.38px;
  color: var(--gray);
  margin: 0 0 20px;
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 57px);
  line-height: 1.12;
  letter-spacing: -0.25px;
  margin: 0 auto;
  max-width: 100%;
  color: var(--ink);
}
.hero .role { position: relative; display: inline-block; }
.hero .role .role-word { display: inline-block; }

/* ---------- Project cards ---------- */
.projects {
  margin-top: clamp(80px, 13vw, 200px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 28px;
  padding: 30px 30px 44px;
  overflow: hidden;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  will-change: transform;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 70px -36px rgba(20, 22, 40, 0.45);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta span {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.25px;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.meta span::after {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--blue);
}
.meta span:last-child::after { display: none; }

.tag {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--ink-2);
  background: var(--white);
  border: 1px solid var(--tag-border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

.card-media {
  position: relative;
  margin: 26px 0 30px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 373 / 279;
  background: var(--white);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.9s var(--ease);
  will-change: transform;
}
.card:hover .card-media img { transform: scale(1.045); }
.card-media.contain { background: var(--white); }
.card-media.contain img { object-fit: cover; }

.card-title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.28;
  color: var(--ink-2);
  margin: 0;
  max-width: 22ch;
}
.card-go {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gray-2);
  transition: gap 0.45s var(--ease), color 0.45s var(--ease);
}
.card:hover .card-go { gap: 14px; color: var(--ink); }
.card-go svg { width: 16px; height: 16px; }

/* ---------- Section headings ---------- */
.section { margin-top: clamp(90px, 14vw, 200px); }
.section-title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 57px);
  line-height: 1.08;
  letter-spacing: -0.25px;
  margin: 0 0 30px;
  color: var(--ink);
}
.sub-title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.22;
  margin: 0 0 40px;
  color: var(--ink);
}

/* ---------- About ---------- */
.about-row {
  display: grid;
  grid-template-columns: 439px 1fr;
  gap: 60px;
  align-items: stretch;
}
.about-photo {
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 439 / 458;
  background: var(--card);
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transition: transform 1.1s var(--ease);
}
.about-photo:hover img { transform: scale(1.04); }
.about-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  max-width: 669px;
}
.body-text {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.5vw, 17px);
  line-height: 1.45;
  letter-spacing: -0.2px;
  color: var(--gray);
  margin: 0;
}
.body-text strong { color: var(--gray-2); font-weight: 600; }
.about-note {
  border-top: 1px solid #f2f0ec;
  border-bottom: 1px solid #f2f0ec;
  padding: 14px 0;
  text-align: center;
}

/* ---------- List rows (What I bring / Approach) ---------- */
.rows { display: flex; flex-direction: column; }
.row-item {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid #ededed;
  align-items: start;
}
.row-item:last-child { border-bottom: 1px solid #ededed; }
.row-key {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.33;
  color: var(--gray);
  margin: 0;
  transition: color 0.5s var(--ease), transform 0.5s var(--ease);
}
.row-item:hover .row-key { color: var(--ink); transform: translateX(4px); }
.row-val { max-width: 664px; }

.pull {
  margin: clamp(40px, 7vw, 80px) 0;
  max-width: 552px;
  margin-left: auto;
  margin-right: 0;
  padding-right: clamp(0px, 9vw, 120px);
}
.pull p {
  font-family: var(--font-body);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.22;
  letter-spacing: 0.38px;
  color: var(--ink);
  margin: 0;
}

/* ---------- Closing CTA ---------- */
.closing {
  margin: clamp(110px, 16vw, 200px) 0 40px;
  text-align: center;
}
.closing h2 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.2px;
  margin: 0 auto 40px;
  max-width: 100%;
  color: var(--ink-2);
}
.closing.big h2 { font-size: clamp(32px, 5vw, 57px); max-width: 100%; }
.cta-buttons {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Case study pages
   ============================================================ */
.case-hero { padding-top: 80px; max-width: 1015px; }
.case-hero h1 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 57px);
  line-height: 1.12;
  letter-spacing: -0.25px;
  margin: 0 0 40px;
  color: var(--ink);
}
.case-hero p {
  font-family: var(--font-body);
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.21;
  letter-spacing: 0.2px;
  color: var(--gray);
  margin: 0 0 14px;
  white-space: pre-line;
}

.showcase {
  margin-top: clamp(60px, 9vw, 150px);
  border-radius: 28px;
  overflow: hidden;
  background: var(--card);
}
.showcase.tall { aspect-ratio: 1360 / 775; }
.showcase img { width: 100%; height: 100%; object-fit: cover; }

/* narrow centered text column on case pages */
.col {
  max-width: 668px;
  margin: 0 auto;
}
.col.wide { max-width: 700px; }

.goal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.goal h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.33;
  color: var(--gray-2);
  margin: 0;
}

.step { margin-bottom: 8px; }
.step .num, .pstep .pnum {
  font-family: var(--font-num);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: normal;
  color: #f2f2f7;
  -webkit-text-stroke: 0;
  display: block;
  margin-bottom: 6px;
}
.step .step-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1px;
  color: var(--label);
  display: block;
  margin-bottom: 14px;
}

/* Big-number process step (design process) */
.pstep { margin-bottom: 52px; }
.pstep:last-child { margin-bottom: 0; }
.pstep .pnum {
  display: block;
  margin-bottom: 8px;
}
.pstep .ptitle {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.33;
  color: #0088ff;
  margin: 0 0 14px;
}
.pstep .body-text + .body-text { margin-top: 12px; }

.gallery {
  margin-top: clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 670 / 775;
  display: grid;
  place-items: center;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.frame.wide { grid-column: 1 / -1; aspect-ratio: 1360 / 775; }
.frame.flow { aspect-ratio: 1360 / 900; }
.frame.flow-tall { grid-column: 1 / -1; aspect-ratio: 1360 / 1144; }
.frame:hover { transform: translateY(-6px); box-shadow: 0 36px 60px -38px rgba(20, 22, 40, 0.4); }
.frame .chip {
  position: absolute;
  top: 28px; left: 28px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: -0.08px;
  color: var(--ink-2);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 4px;
  padding: 3px 10px;
  z-index: 2;
}
.frame .chip.center { left: 50%; transform: translateX(-50%); }
.frame-pad {
  width: 100%; height: 100%;
  padding: clamp(24px, 5%, 64px);
  display: grid;
  place-items: center;
}
.frame-pad img, .frame-fill img { border-radius: 6px; }
.frame-fill { width: 100%; height: 100%; }
.frame-fill img { width: 100%; height: 100%; object-fit: cover; }
.frame img { transition: transform 0.9s var(--ease); }
.frame:hover img { transform: scale(1.03); }
.frame .img-contain { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }

.link-note {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--gray-4);
  margin: 18px 0 0;
}
.link-note a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

.dark-frame {
  background: linear-gradient(180deg, #54595f 0%, #121418 100%);
}
.dark-frame img { width: 100%; object-fit: cover; }

/* spacing between case blocks */
.case-block { margin-top: clamp(60px, 9vw, 150px); }
.case-block.tight { margin-top: clamp(40px, 6vw, 80px); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .nav { height: 72px; }
  .projects { grid-template-columns: 1fr; gap: 22px; }
  .about-row { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { aspect-ratio: 16 / 12; max-height: 460px; }
  .row-item { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .row-item:hover .row-key { transform: none; }
  .pull { margin-left: 0; padding-right: 0; max-width: 100%; }
  .gallery { grid-template-columns: 1fr; }
  .frame, .frame.wide { aspect-ratio: 4 / 3; }
  .frame.flow, .frame.flow-tall { aspect-ratio: 4 / 3; }
  .pill { font-size: 16px; padding: 11px 16px; }
  .btn { font-size: 19px; padding: 12px 22px; }
  .nav-close { width: 42px; height: 42px; }
}

@media (max-width: 560px) {
  .cta-buttons { gap: 14px; }
  .btn { width: 100%; }
  .card { padding: 22px 22px 32px; }
  .menu { gap: 8px; }
}
