@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   FONTS
   ======================================== */
@font-face {
  font-family: 'HKGroteskWide';
  src: url('assets/fonts/HKGroteskWide-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HKGroteskWide';
  src: url('assets/fonts/HKGroteskWide-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HKGroteskWide';
  src: url('assets/fonts/HKGroteskWide-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HKGroteskWide';
  src: url('assets/fonts/HKGroteskWide-Bold.otf') format('opentype');
  font-weight: 600 700 800 900;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   VARIABLES & RESET
   ======================================== */
:root {
  --font-sans:    'HKGroteskWide', system-ui, -apple-system, sans-serif;
  --bg:           #07070e;
  --bg-2:         #0d0d1b;
  --bg-3:         rgba(14, 14, 27, 0.65);
  --border:       rgba(157, 238, 188, 0.12);
  --border-hover: rgba(157, 238, 188, 0.45);
  --accent:       #9deebc;
  --accent-glow:  rgba(157, 238, 188, 0.2);
  --text:         #e8e8f0;
  --text-2:       rgba(232, 232, 240, 0.55);
  --text-3:       rgba(232, 232, 240, 0.3);
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --header-h:     151px;
  --abt-l:        max(2rem, calc(50vw - 700px));
  --tl-above:     145px;
  --tl-below:     150px;
}

html[lang="uk"] {
  --font-sans: 'Hanken Grotesk', 'HKGroteskWide', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: rgba(157, 238, 188, 0.55); color: #07070e; }

html { overflow-x: hidden; overscroll-behavior-x: none; }
body.page-works, body.page-about, body.page-contacts { overflow-y: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  cursor: none;
}

a { text-decoration: none; color: inherit; cursor: none; }
button, input, textarea, [role="button"] { cursor: none; }

/* cursor-text state: hide custom cursor, show native text cursor */
body.cursor-text,
body.cursor-text * { cursor: text !important; }
body.cursor-text #cursor-ring,
body.cursor-text #cursor-dot { opacity: 0 !important; }

/* ========================================
   CURSOR EFFECT
   ======================================== */
#cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(157, 238, 188, 0.13) 0%,
    rgba(157, 238, 188, 0.05) 35%,
    transparent 68%);
  transform: translate(-50%, -50%);
  filter: blur(8px);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
  opacity: 0;
}

#cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(157, 238, 188, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease),
              border-color 0.35s var(--ease), opacity 0.4s ease;
  opacity: 0;
}

#cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease), opacity 0.4s ease;
  opacity: 0;
}

/* hover state — hide custom cursor, show native pointer */
body.cursor-hover #cursor-ring,
body.cursor-hover #cursor-dot { opacity: 0 !important; }
body.cursor-hover,
body.cursor-hover * { cursor: pointer !important; }

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(157,238,188,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(157,238,188,0.6); }

/* ========================================
   VIDEO BACKGROUND
   ======================================== */
#bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
}

#bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.89);
  z-index: -1;
  pointer-events: none;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  position: fixed;
  top: -10px; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
}

/* Row 1: logo + sound */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 95px;
  padding: 0 max(2rem, calc(50% - 700px));
}

/* Logo */
.logo-kk {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transform: translateY(10px);
  transition: opacity 0.2s var(--ease);
}
.logo-kk:hover { opacity: 0.75; }
.logo-kk img {
  display: block;
  width: 142px;
  height: auto;
}

/* Logo fade-in animation */
.logo--animate .logo-img {
  opacity: 0;
  animation: logo-fade 0.5s ease-out forwards;
}
@keyframes logo-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Header controls (lang + sound grouped) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  transform: translateY(19px);
}

/* Language toggle button */
.lang-btn {
  background: none;
  border: none;
  cursor: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text);
  padding: 0;
  transition: color 0.2s var(--ease);
}
.lang-btn:hover { color: var(--accent); }


/* Divider */
.header-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Nav row */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  height: 55px;
  position: relative;
}

.nav-link {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.25s var(--ease), margin 0.4s var(--ease);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
  transform: translateY(-58px);
}
.nav-link:hover { color: rgba(232,232,240,0.65); }
.nav-link.active { color: var(--accent); }

/* Active dot indicator — separate element that slides */
#nav-indicator {
  position: absolute;
  /*
   * main-nav starts at y = header-top(95px) + divider(1px) = 96px from header.
   * Dot center must be at 95.5px (divider center) = 96 - 0.5px from main-nav top.
   * Dot is 6px tall → top = -0.5 - 3 = -3.5 ≈ -4px
   */
  top: -3.5px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  /* ease-in: starts slow, accelerates */
  transition: transform 0.6s cubic-bezier(0.55, 0, 0.9, 1),
              opacity   0.25s ease;
}
#nav-indicator.visible { opacity: 1; }


/* ========================================
   APP CONTAINER + PAGE TRACK
   ======================================== */
#app {
  padding-top: var(--header-h);
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
}

.page-slot {
  position: relative;
  overflow: hidden;
  transition: filter 0.3s ease;
}

/* Page slide transitions — CSS keyframes run on compositor (reliable on iOS) */
.page-track {
  position: relative;
  z-index: 2; /* sits above #proj-bg (0) and #site-line (1) */
  overflow: hidden; /* clip slots that are translating in/out */
}

/* During animation: stack both slots in the same grid cell so they slide past each other */
.page-track--animating {
  display: grid;
  grid-template-columns: 1fr;
}
.page-track--animating > .page-slot {
  grid-column: 1;
  grid-row: 1;
}

@keyframes page-enter-right {
  from { transform: translate3d(100%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}
@keyframes page-exit-left {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-100%, 0, 0); }
}
@keyframes page-enter-left {
  from { transform: translate3d(-100%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}
@keyframes page-exit-right {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(100%, 0, 0); }
}

/* ease-out: snappy, iOS-native feel */
.page-slot--enter-fwd  { animation: page-enter-right 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.page-slot--exit-fwd   { animation: page-exit-left   380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; pointer-events: none; }
.page-slot--enter-back { animation: page-enter-left  380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.page-slot--exit-back  { animation: page-exit-right  380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; pointer-events: none; }


/* ── Global horizontal line — same vertical position as About timeline ── */
#site-line {
  position: fixed;
  left: 0; right: 0;
  top: calc(50vh + var(--header-h) / 2);
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 1;
  transition: top 0.3s var(--ease);
}
body.page-about #site-line {
  display: none;
}

/* ── About page photo background (body-level — no transform ancestors) ── */
#about-photo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow: hidden;
}
#about-photo-bg.visible { opacity: 0.2; }
#about-photo-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Persistent project gradient background ── */
#proj-bg {
  position: fixed;
  z-index: 0;          /* below page content, above video bg */
  pointer-events: none;
  opacity: 0;
  top: 0; left: 0;     /* initial off — size/position set via JS */
  width: 0; height: 0;
  will-change: left, top, width, height, opacity;
}
body.is-navigating .page-slot {
  filter: blur(10px);
  transition: filter 0.25s ease;
}

/* ========================================
   HERO
   ======================================== */
.hero-page {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4rem max(2rem, calc(50% - 700px));
}

.hero-inner {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.hero-page--with-works .hero {
  flex: none;
  padding-top: calc(2.5rem - 15px + 40px);
  padding-bottom: calc(1.5rem + 40px);
}
.hero-page--with-works .works-list {
  transform-origin: top center;
  will-change: transform;
}
.hero-page--with-works .works-page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  position: relative;
}
.hero-page--with-works .works-list {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 0 6rem;
  box-sizing: border-box;
}

.hero-page--with-works .work-card {
  --work-copy-w: clamp(180px, 15vw, 220px);
  --work-preview-inset-right: 0px;
  grid-template-columns: var(--work-copy-w) minmax(0, 1fr);
  column-gap: 1.5rem;
}

.hero-page--with-works .work-card-info {
  padding-left: 0;
}

.hero-page--with-works .work-card-media {
  width: 100%;
  justify-self: end;
}

.hero-content { max-width: none; }

.header-cv-btn {
  white-space: nowrap;
  color: var(--text);
}

.hero-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-heading {
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(20px, 6.2vw, 96px);
  font-weight: 900;
  overflow-wrap: break-word;
  line-height: 1;
  letter-spacing: 0;
  background: linear-gradient(158deg, #e8e8f0 7%, #9deebc 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
}

.hero-page--with-works .hero-title {
  font-size: clamp(20px, 6.2vw, 96px);
}

.ht-first::after {
  content: '\00A0';
}

.hero-desc {
  font-size: 18px;
  font-weight: 300;
  color: var(--text);
  max-width: 620px;
  line-height: 1.45;
  margin-bottom: 2.5rem;
}

.hero-page--with-works .hero-desc {
  max-width: 860px;
  line-height: 1.45;
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-left: calc(clamp(56px, 6vw, 96px) + 1rem);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700; font-size: 0.8rem;
  letter-spacing: 2px; text-transform: uppercase;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--text);
  font-weight: 700; font-size: 0.8rem;
  letter-spacing: 2px; text-transform: uppercase;
  border: 1px solid var(--border-hover);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}
.btn-outline:hover {
  background: rgba(157,238,188,0.06);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem max(2rem, calc(50% - 700px));
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text);
}
.site-footer a {
  color: inherit;
  transition: color 0.2s var(--ease);
}
.site-footer a:hover { color: var(--accent); }
.site-footer a.footer-behance:hover { color: #0050FF; }

/* ========================================
   PAGE WRAPPER
   ======================================== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.page-header { margin-bottom: 3rem; }

.page-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.page-title span { color: var(--accent); }

.page-desc {
  margin-top: 0.75rem;
  color: var(--text-2);
  max-width: 500px;
}

/* ========================================
   TAGS
   ======================================== */
.tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border: 1px solid #fff;
  color: #fff;
  white-space: nowrap;
}

/* ========================================
   WORKS LIST  (vertical full-width cards)
   ======================================== */
.works-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.work-card {
  --work-copy-w: clamp(220px, 24vw, 300px);
  --work-preview-inset-top: 25px;
  --work-preview-inset-right: 50px;
  --work-preview-inset-bottom: 25px;
  --work-preview-inset-left: 100px;
  position: relative;
  display: grid;
  grid-template-columns: var(--work-copy-w) minmax(0, 1fr);
  align-items: stretch;
  column-gap: 1.75rem;
  color: inherit;
  height: 500px;
  overflow: visible;
  border: none;
  opacity: 0;
  animation: fadeUp 0.45s var(--ease) forwards;
  transition: scale 0.4s var(--ease);
}
.work-card:hover { scale: 0.95; }

.work-card-media {
  position: relative;
  grid-column: 2;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  justify-self: end;
  width: 100%;
}

/* gradient background fills the full card */
.work-card-bg {
  position: absolute;
  top: var(--work-preview-inset-top);
  right: var(--work-preview-inset-right);
  bottom: var(--work-preview-inset-bottom);
  left: var(--work-preview-inset-left);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.7s var(--ease);
  transform-origin: center center;
}
.work-card:hover .work-card-bg { transform: none; }

.work-card-num {
  font-size: 9rem;
  font-weight: 900;
  opacity: 0.1;
  color: #fff;
  line-height: 1;
  user-select: none;
  letter-spacing: -5px;
}

.work-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.08) 55%, transparent 100%);
  box-shadow: inset 0 0 80px 20px rgba(0,0,0,0.55);
}

/* карточки с реальным скриншотом */
.work-card-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center right;
}
.work-card-left-fade {
  position: absolute; inset: 0;
}
.work-card-icon {
  position: absolute; top: 1.5rem; left: 1.5rem;
  height: 42px; width: auto;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* info block pinned to bottom-left */
.work-card-info {
  position: relative;
  grid-column: 1;
  align-self: end;
  width: auto;
  padding: 0 0 2rem;
  z-index: 1;
}

.work-card-tags  { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.work-card-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; letter-spacing: -0.02em; }
.work-card-subtitle { font-size: 0.875rem; color: var(--text-2); }

.work-card-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--text);
  transition: all 0.25s var(--ease);
}
.work-card:hover .work-card-arrow { gap: 0.75rem; opacity: 0.65; }

.work-card-arrow-icon {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  color: inherit;
  transition: color 0.25s var(--ease);
}
.work-card:hover .work-card-arrow-icon { color: var(--accent); }
.work-card:hover .work-arrow-g {
  animation: fwd-arrow-slide 0.5s linear infinite;
}
@keyframes fwd-arrow-slide {
  from { transform: translateX(-20px); }
  to   { transform: translateX(20px); }
}

/* work-card instant-appear when returning from zoom (no fadeUp) */
.work-card.no-anim { animation: none; opacity: 1; }

/* ========================================
   PROJECT DETAIL
   ======================================== */
.project-detail {
  min-height: calc(100dvh - var(--header-h));
}

.project-header {
  position: relative;
  padding: 5rem 5rem 4rem;
  overflow: hidden;
}
.project-detail--text-first .project-header {
  padding-bottom: 2rem;
}
.project-header-bg { position: absolute; inset: 0; opacity: 0; } /* bg handled by #proj-bg */
.project-header-glow {
  position: absolute; top: -150px; left: -150px;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.1;
}
.project-header-content {
  position: relative; z-index: 1;
  max-width: 1300px; margin: 0 auto;
}

.back-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: color 0.25s var(--ease);
  margin-bottom: 2.5rem;
  text-decoration: none;
}
.back-btn:hover { color: rgba(232,232,240,0.65); }

.back-btn-arrow {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--text);
  transition: color 0.25s var(--ease);
}
.back-btn:hover .back-btn-arrow { color: var(--accent); }
.back-btn:hover .back-btn-arrow-g {
  animation: back-arrow-slide 0.5s linear infinite;
}
@keyframes back-arrow-slide {
  from { transform: translateX(20px); }
  to   { transform: translateX(-20px); }
}

.project-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.project-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.project-subtitle { font-size: 1.1rem; font-weight: 300; color: var(--text-2); margin-bottom: 1.5rem; }
.project-desc-text { font-size: 1rem; font-weight: 300; color: var(--text-2); max-width: 600px; line-height: 1.75; }
.proj-sections-row { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem; }
.proj-sections-row--stack { flex-direction: column; }
.proj-sections-row--stack .proj-section-block { flex: none; width: 100%; max-width: 840px; margin: 0 auto; }
.proj-section-block { flex: 1; min-width: 180px; }
.proj-section-heading { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; }
.proj-section-text { font-size: 1rem; font-weight: 300; color: var(--text-2); line-height: 1.75; margin: 0; }
.proj-bullet-list { margin: 0.4rem 0 0.4rem 1.2rem; padding: 0; }
.proj-bullet-list li { margin-bottom: 0.2rem; }
.proj-bullet-list li::marker { color: var(--accent); }
.proj-text-block { max-width: 1300px; margin: 0 auto; width: 100%; }
.proj-text-block-heading { font-size: 1rem; font-weight: 500; color: var(--text); margin: 0 0 0.5rem; }
.proj-text-block-body {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.75;
  margin: 0;
}
.proj-text-block-body--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.proj-text-block-col {
  min-width: 0;
}
.proj-text-block-col .proj-bullet-list,
.proj-text-block-col .proj-bullet-list li {
  break-inside: avoid;
}

/* Intro block */
.proj-intro { max-width: 1300px; margin: 0 auto; width: 100%; }
.proj-intro-label { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 16px; line-height: 1.6; }
.proj-intro-large { font-size: 1.75rem; font-weight: 400; line-height: 1.2; color: var(--text); }

/* Two-column text block */
.proj-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; max-width: 1300px; margin: 0 auto; width: 100%; }
.proj-col-heading { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 12px; line-height: 1.6; }
.proj-col-body { font-size: 1rem; font-weight: 300; line-height: 1.75; color: var(--text-2); }
.proj-col-body-large { font-size: 1.75rem; font-weight: 400; line-height: 1.2; color: var(--text); margin-bottom: 16px; }
.proj-col-media-wrap { margin-top: 28px; }

.project-desc-text strong,
.proj-section-text strong,
.proj-text-block-body strong {
  font-weight: 500;
  color: inherit;
}

.project-body {
  max-width: 1880px; margin: 0 auto;
  padding: 3rem 40px 8rem;
}
.project-detail--text-first .project-body {
  padding-top: 1rem;
}
.proj-sections-row, .project-desc-text, .screenshots-section-title {
  max-width: 1300px;
}

@media (max-width: 980px) {
  .proj-text-block-body--split {
    grid-template-columns: 1fr;
  }
  .proj-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.screenshots-section-title {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-3);
  letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 1.5rem;
}

.screenshot {
  border: 1px solid var(--border);
  aspect-ratio: 16/10;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--bg-3);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s var(--ease), transform 0.3s var(--ease);
}
.screenshot:hover { border-color: var(--border-hover); transform: scale(1.015); }

/* ── Project: image-based layout (matches Figma proportions) ── */
.proj-shots-large {
  display: flex;
  flex-direction: column;
}
.proj-shot-lg { width: 100%; }
.proj-shot-lg img { width: auto; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.proj-shot-lg--crop img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.proj-shot-lg video { width: 100%; max-width: 1300px; height: auto; display: block; margin: 0 auto; }
.proj-shot--shadow img, .proj-shot--shadow video { box-shadow: 0 0 10px 5px rgba(0,0,0,0.45); }
.proj-shot--shadow .proj-embed-wrap { box-shadow: 0 0 10px 5px rgba(0,0,0,0.45); }

/* Embed (iframe) media */
.proj-embed-wrap {
  position: relative;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding-bottom: min(56.25%, calc(1300px * 9 / 16)); /* 16:9 fallback for old iOS */
  border-radius: 0;
  overflow: hidden;
}
@supports (aspect-ratio: 1) {
  .proj-embed-wrap {
    padding-bottom: 0;
    aspect-ratio: 16 / 9;
  }
}
.proj-embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: none;
}

/* 12-column grid so each thumb spans 3 cols (4 per row).
   Last row (3 items) starts at col 3 — matches Figma's 173px offset
   in a 1136px content area (≈ 191px in grid, ~18px diff, imperceptible). */
.proj-shots-thumbs {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-top: 44px;
}
.proj-shot-sm-wrap { grid-column: span 3; }
.proj-shot-sm-wrap--last { grid-column-start: 3; }
.proj-shot-sm {
  aspect-ratio: 272 / 325;
  overflow: hidden;
}
.proj-shot-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-shot-sm video { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-media-caption { font-size: 1rem; color: var(--text-2); margin: 20px 0 0; line-height: 1.75; text-align: center; max-width: 840px; }
.proj-shots-half-row { display: flex; justify-content: center; gap: 12px; align-items: start; }

/* Stack-bottom: big image on top, two half images below */
.proj-mosaic-bottom-stack { display: flex; flex-direction: column; gap: 12px; max-width: 1300px; margin: 0 auto; width: 100%; }
.proj-mosaic-bottom-lead { width: 100%; }
.proj-mosaic-bottom-lead .proj-shot-half { width: 100%; }
.proj-mosaic-bottom-lead .proj-shot-half img,
.proj-mosaic-bottom-lead .proj-shot-half video { width: 100%; height: auto; display: block; }
.proj-shot-half { min-width: 0; }
.proj-shot-half img, .proj-shot-half video { width: auto; max-width: 100%; height: auto; display: block; }
.proj-mosaic-right-stack {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}
.proj-mosaic-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
}
.proj-mosaic-stack-col {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--mosaic-stack-item-height) var(--mosaic-stack-item-height);
  gap: 30px;
  height: var(--mosaic-lead-height);
  align-content: start;
  overflow: hidden;
}
.proj-mosaic-stack-col .proj-mosaic-cell {
  min-height: 0;
  height: var(--mosaic-stack-item-height);
}
.proj-mosaic-cell .proj-shot-half {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.proj-mosaic-cell--lead .proj-shot-half {
  height: auto;
  overflow: visible;
}
.proj-mosaic-cell--lead .proj-shot-half img,
.proj-mosaic-cell--lead .proj-shot-half video {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.proj-mosaic-stack-col .proj-mosaic-cell .proj-shot-half {
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-mosaic-stack-col .proj-mosaic-cell .proj-shot-half img,
.proj-mosaic-stack-col .proj-mosaic-cell .proj-shot-half video {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 900px) {
  .proj-shots-thumbs { grid-template-columns: repeat(4, 1fr); }
  .proj-shot-sm-wrap       { grid-column: span 1; }
  .proj-shot-sm-wrap--last { grid-column-start: 2; }
  .proj-mosaic-right-stack { grid-template-columns: 1fr; }
  .proj-mosaic-stack-col { height: auto; }
}

.screenshot-num {
  font-size: 4rem; font-weight: 900;
  opacity: 0.1; color: #fff;
  user-select: none;
  letter-spacing: -3px;
}
.screenshot-label {
  position: absolute; bottom: 1rem; left: 1.1rem;
  font-size: 0.68rem; color: rgba(255,255,255,0.3);
  letter-spacing: 2px; text-transform: uppercase;
}


/* ========================================
   ABOUT  (horizontal timeline)
   ======================================== */
.about-page {
  min-height: calc(100dvh - var(--header-h));
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 50px;
}
.about-page .site-footer {
  position: static;
  margin-top: 120px;
}

.contacts-page .site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

/* (about-photo-bg is now a body-level element — see #about-photo-bg below) */

/* Left column — bio + CV button stacked */
.about-left-col {
  position: relative;
  margin-left: var(--abt-l);
  width: min(1380px, calc(100vw - (2 * var(--abt-l)) - 24px));
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

/* Paragraph bio */
.about-para {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text);
}

.about-bio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.about-bio-card {
  min-height: 182px;
  padding: 0 18px 0 0;
}

.about-bio-index {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.5;
}

.about-bio-card .about-para {
  font-size: 15px;
  line-height: 1.65;
}

.about-bio-card:first-child .about-para {
  font-size: 1.64rem;
  line-height: 1.45;
}

.about-bio-card:nth-child(6) {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(900px, 100%);
  padding-right: 0;
}

.about-bio-card:nth-child(6) .about-para {
  font-size: 1.64rem;
  line-height: 1.45;
  text-align: center;
}

.about-bio-card:nth-child(2),
.about-bio-card:nth-child(3) {
  margin-top: 200px;
}

.about-bio-card:nth-child(n + 4) {
  margin-top: 100px;
}

.about-bio-card .about-para strong {
  font-weight: 500;
  color: var(--accent);
}

.about-bio-card:first-child .about-para strong {
  color: var(--text);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 24px;
}

.about-tag {
  border: 2px solid rgba(232, 232, 240, 0.55);
  border-radius: 24px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  white-space: nowrap;
}

.about-cv-btn-solid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 536px;
  max-width: 100%;
  height: 45px;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

.about-cv-btn-solid:hover { opacity: 0.85; }

.about-bio-card .about-para br {
  display: none;
}

/* Left info panel */
.about-info {
  pointer-events: auto;
  padding-bottom: 20px;
  align-self: center;
  text-align: center;
}

.about-info-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  line-height: 29.4px;
  white-space: nowrap;
  margin-bottom: 0.5rem;
}

.about-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.about-cv-btn:hover { color: var(--accent); }

/* ── Timeline custom arrow cursor ───────────────────────── */
.about-tl-outer,
.about-tl-outer * { cursor: none; }

/* Скрываем сайтовый курсор (ring/dot/glow) над таймлайном */
body.tl-cursor-active #cursor-glow,
body.tl-cursor-active #cursor-ring,
body.tl-cursor-active #cursor-dot { opacity: 0 !important; }

.tl-cursor {
  position: fixed;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tl-cursor.visible { opacity: 1; }
body:not(.tl-cursor-active) .tl-cursor { opacity: 0 !important; }

.tl-cursor-r,
.tl-cursor-l {
  position: absolute;
  inset: 0;
}
.tl-cursor-r svg,
.tl-cursor-l svg {
  width: 100%;
  height: 100%;
}

/* Download CV icon */
.cv-icon-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.cv-icon-svg {
  display: block;
  overflow: hidden;
}

/* On hover: arrow continuously falls top → bottom, stops at tray (looped) */
.about-cv-btn:hover .cv-dl-arrow {
  animation: cv-arrow-fall 1.5s linear infinite;
}

@keyframes cv-arrow-fall {
  from { transform: translateY(-8px); }
  to   { transform: translateY(20px); }
}

/* Outer wrapper for the timeline — vertically centred */
.about-tl-outer {
  position: relative;
  left: auto; right: auto;
  top: auto;
  transform: none;
  height: calc(var(--tl-above) + 1px + var(--tl-below));
  overflow: hidden;
  max-width: 100vw;
  margin-top: 120px;
  -webkit-mask-image: linear-gradient(to right, transparent 0px, transparent max(0px, calc(var(--abt-l) - 130px)), black var(--abt-l), black calc(100% - 600px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0px, transparent max(0px, calc(var(--abt-l) - 130px)), black var(--abt-l), black calc(100% - 600px), transparent 100%);
  transition: -webkit-mask-image 0.4s ease, mask-image 0.4s ease;
}
.about-tl-outer.at-end {
  -webkit-mask-image: linear-gradient(to right, transparent 0px, transparent max(0px, calc(var(--abt-l) - 250px)), black calc(var(--abt-l) - 100px));
  mask-image: linear-gradient(to right, transparent 0px, transparent max(0px, calc(var(--abt-l) - 250px)), black calc(var(--abt-l) - 100px));
}

/* Horizontal rule */
.about-tl-line {
  position: absolute;
  left: 0; right: 0;
  top: var(--tl-above);
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 1;
}

/* Green dot — direct child of about-tl-outer, sits on the line */
.about-tl-dot {
  position: absolute;
  left: var(--abt-l);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(157, 238, 188, 0.55);
  z-index: 5;
}

/* Horizontal scroll container */
.about-tl-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain; /* prevent scroll chaining to body when at timeline edge */
  scrollbar-width: none;
  height: 100%;
  padding-left: var(--abt-l);
  transition: filter 0.25s ease;
}
.about-tl-scroll::-webkit-scrollbar { display: none; }

/* Flex row of entries */
.about-tl-track {
  display: inline-flex;
  align-items: flex-start;
  height: 100%;
}

/* Single entry — two entries fill the available width so 3rd starts at right edge */
.about-tl-entry {
  display: flex;
  flex-direction: column;
  min-width: calc((100vw - var(--abt-l)) / 2.75); /* state1: 2013 ~75% visible; state2: scrollMax shows 2006 flush */
  padding-right: 80px;
  transition: opacity 0.25s ease, filter 0.25s ease;
  transition: opacity 0.25s ease;
}

.about-tl-entry.is-current {
  padding-right: 140px; /* wider gap after 2026 */
}

/* Section above the line */
.about-tl-above {
  height: var(--tl-above);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 2px;
  gap: 3px;
}

.about-tl-company {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.about-tl-role {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 175px;
}
.about-tl-period {
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-top: 1px;
}

/* Section below the line — years bottom-aligned so all bottoms sit at the same level */
.about-tl-below {
  height: var(--tl-below);
  display: flex;
  align-items: flex-end;
}
.about-tl-year {
  font-size: clamp(2.5rem, 3.1vw, 3.75rem); /* ~60px at 1920px */
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  opacity: 0.85;
}

/* Current/latest entry — 1.5× bigger year (90px vs 60px in Figma) */
.about-tl-entry.is-current .about-tl-year {
  font-size: clamp(3.75rem, 4.7vw, 5.625rem); /* ~90px at 1920px */
  opacity: 1;
}

/* ========================================
   CONTACTS
   ======================================== */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contacts-list { display: flex; flex-direction: column; gap: 1rem; }

.contact-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease);
}
.contact-card:hover {
  border-color: var(--border-hover);
  background: rgba(157,238,188,0.04);
  transform: translateX(4px);
}
.contact-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-info-label { font-size: 0.68rem; color: var(--text-3); margin-bottom: 0.2rem; letter-spacing: 1.5px; text-transform: uppercase; }
.contact-info-value { font-weight: 600; }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.72rem; color: var(--text-2); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.form-input,
.form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s var(--ease);
  outline: none;
  resize: none;
  backdrop-filter: blur(4px);
}
.form-input:focus,
.form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }
.form-textarea { height: 140px; }

/* ========================================
   CONTACTS PAGE (Figma design)
   ======================================== */
.contacts-page {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 60px;
}

.contacts-hero {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 40px clamp(24px, 5vw, 80px);
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  min-height: calc(100dvh - var(--header-h) - 60px);
}

/* ── Left column ── */
.contacts-hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  overflow: hidden;
  min-width: 0;
}

.contacts-hero-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  width: fit-content;
}

.contacts-hero-tag span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.contacts-hero-tz {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25) !important;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 10px;
}

.contacts-hero-title {
  font-size: clamp(56px, 7vw, 120px);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  line-height: 0.9;
  margin: 0;
  word-break: break-word;
}

.contacts-hero-socials {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── Right column ── */
.contacts-hero-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: clamp(40px, 6vw, 100px);
  border-left: 1px solid rgba(255,255,255,0.08);
  gap: 0;
}

.contacts-hero-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 0;
  width: 100%;
}

.contacts-hero-divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.contacts-hero-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
}

.contacts-hero-link {
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
  line-height: 1.1;
}

.contacts-hero-link:hover {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(6,182,212,0.4);
}

@media (max-width: 768px) {
  .contacts-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }
  .contacts-hero-right {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 40px;
    width: 100%;
  }
}

/* ── Contacts info block (above form, same width as form) ── */
.cfm-wrap {
  display: flex;
  flex-direction: column;
  gap: 42px;
  width: 536px;
  max-width: 100%;
}

.contacts-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.contacts-info-location {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.contacts-info-contact {
  display: flex;
  flex-direction: column;
  padding-top: 23px;
}

.contacts-flag {
  display: flex;
  flex-direction: column;
  width: 20px;
}

.contacts-flag-blue  { height: 8px; background: #0054b1; }
.contacts-flag-yellow { height: 8px; background: #f7d000; }

.contacts-info-line {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  line-height: 29.4px;
  white-space: nowrap;
}

.contacts-info-line--meta {
  color: #fff;
  line-height: 29.4px;
  transform: translateY(-7px);
}

a.contacts-info-line:hover { color: var(--accent); }
a.contacts-info-line,
.nav-link,
.site-footer a { user-select: text; -webkit-user-drag: none; }

.contacts-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem max(2rem, calc(50% - 700px));
}

.contacts-left {
  position: absolute;
  left: max(2rem, calc(50% - 700px));
  top: 3rem;
}

.contacts-right {
  width: 536px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contacts-title {
  font-size: clamp(32px, 5.6vw, 60px);
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0;
  text-align: center;
  background-image: linear-gradient(142deg, #e8e8f0 7%, #9deebc 70%);
}

/* ── Minimal form ── */
.cfm {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.cfm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfm-field--grow { flex: 1; }

.cfm-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.3px;
}

.cfm-input,
.cfm-textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 0;
  outline: none;
  width: 100%;
  caret-color: var(--accent);
  transition: border-color 0.2s var(--ease);
}

.cfm-textarea {
  resize: none;
  height: 110px;
}

.cfm-input::placeholder,
.cfm-textarea::placeholder { color: var(--text-3); }

.cfm-input:focus,
.cfm-textarea:focus { border-bottom-color: rgba(157,238,188,0.8); }

.cfm-field--error .cfm-input,
.cfm-field--error .cfm-textarea {
  border-bottom-color: rgba(255, 80, 80, 0.7);
}

.cfm-error {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: rgba(255, 90, 90, 0.85);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s var(--ease), max-height 0.2s var(--ease);
}

.cfm-field--error .cfm-error {
  opacity: 1;
  max-height: 20px;
}

.cfm-action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
}

.cfm-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: none;
  width: 100%;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.cfm-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.cfm-label-opt {
  opacity: 0.45;
  font-weight: 400;
}

.cfm-field--file input[type="file"] {
  display: none;
}

.cfm-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.cfm-file-btn:hover {
  color: rgba(255,255,255,0.85);
}

.cfm-file-attached {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cfm-file-attached--visible {
  display: flex;
}

.cfm-file-name {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfm-file-remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s;
}

.cfm-file-remove:hover {
  color: rgba(255, 80, 80, 0.8);
}

.cfm-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 1.25rem;
}

.cfm-contact-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.cfm-contact-link:hover { color: var(--text); }

/* ── Social icons ── */
.contacts-socials {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-shrink: 0;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  background: transparent;
  transition: all 0.25s var(--ease);
}

.social-btn:hover {
  border-color: var(--accent);
  background: rgba(157,238,188,0.08);
  transform: translateY(-2px);
}
.social-btn--linkedin:hover {
  border-color: #0A66C2;
  background: rgba(10,102,194,0.08);
  color: #0A66C2;
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.55s cubic-bezier(0.55, 0, 0.9, 1) forwards; }

.work-card:nth-child(1) { animation-delay: 0.00s; }
.work-card:nth-child(2) { animation-delay: 0.09s; }
.work-card:nth-child(3) { animation-delay: 0.18s; }
.work-card:nth-child(4) { animation-delay: 0.27s; }
.work-card:nth-child(5) { animation-delay: 0.36s; }
.work-card:nth-child(6) { animation-delay: 0.45s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (hover: none) {
  body, a, button, input, textarea, [role="button"] { cursor: auto; }
  #cursor-glow, #cursor-ring, #cursor-dot { display: none; }
}
@media (max-width: 1024px) {
  #cursor-glow, #cursor-ring, #cursor-dot { display: none !important; }
}

@media (max-width: 1000px) {
  .contacts-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .project-header { padding: 4rem 2rem 3rem; }
  .project-body { padding: 2rem 2rem 6rem; }
  .contacts-body { justify-content: flex-start; }
  .contacts-left { position: static; }
  .contacts-right { width: 100%; }
  .contacts-title { text-align: left; }
  .cfm-wrap { width: 100%; }
  /* About timeline: no min-width override — calc(50vw - 150px) handles it */
}

/* About timeline switches to flow layout before padding-left:750px clips content */
@media (max-width: 900px) {
  .about-page { padding-top: 200px; }
  #site-line { display: none; }
  .about-tl-line { background: rgba(255, 255, 255, 0.1); }
  .about-left-col { position: static; padding: 2rem 1.5rem 0; width: 100%; max-width: 100%; }
  .about-bio-grid { grid-template-columns: 1fr; gap: 14px; }
  .about-bio-card { min-height: auto; }
  .about-para { padding: 0; }
  .about-info { padding: 0; }
  .about-tl-outer { position: relative; transform: none; margin-top: 2rem; -webkit-mask-image: linear-gradient(to right, transparent 0px, black calc(1.5rem + 48px)); mask-image: linear-gradient(to right, transparent 0px, black calc(1.5rem + 48px)); }
  .about-tl-scroll { padding-left: 1.5rem; }
  .about-tl-dot { left: calc(1.5rem + 48px); }
  .about-tl-below { margin-top: -60px; }
  .about-tl-above { padding-top: 30px; }
}


/* Desktop: content fades into transparency under the fixed header. */
html:not(.is-touch) .hero-page,
html:not(.is-touch) .works-page,
html:not(.is-touch) .project-detail,
html:not(.is-touch) .about-page,
html:not(.is-touch) .contacts-page {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Touch keeps content unmasked; header backdrop handles the fade. */
html.is-touch .page-slot {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* Mobile side arrows */
.mobile-side-arrow {
  display: none;
}

/* Touch: header backdrop + gradient tail replace the mask-image fade.
   Low-opacity background so backdrop-filter picks up the page colour. */
html.is-touch .site-header {
  background: var(--proj-header-bg, linear-gradient(to bottom, var(--bg) 0%, transparent 100%));
}
/* Gradient tail below the header — extends the fade without pushing content down */
html.is-touch .site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: calc(100% + 90px);
  background: inherit;
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
html.is-touch body.page-project .project-header {
  padding-top: calc(4rem + 24px);
}

@media (max-width: 768px) {
  .mobile-side-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    /* svh = small viewport height — constant value (as if browser URL bar
       is visible). Doesn't change when mobile chrome shows/hides on scroll,
       so arrows don't jump. Fallback to 50% for older browsers. */
    top: 50%;
    top: 50svh;
    transform: translateY(-50%);
    z-index: 99;
    opacity: 0.7;
    transition: opacity 0.2s;
  }
  .mobile-side-arrow:active { opacity: 1; }
  .mobile-side-arrow--left  { left: 10px; }
  .mobile-side-arrow--right { right: 10px; }
}

@media (max-width: 700px) {
  :root { --header-h: 160px; }
  .about-page { padding-top: 220px; }
  .about-para { max-width: 90%; }
  .about-tl-above { padding-top: 42px; }
  .about-tl-period { white-space: nowrap; }
  .about-tl-below { margin-top: -50px; }

  /* Header: logo left, controls right, nav below */
  .header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 10px 16px;
  }
  .header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .header-divider { margin-top: 30px; }
  .main-nav {
    gap: 20px;
    height: 40px;
    margin-top: 0;
  }
  .nav-link { font-size: 13px; letter-spacing: 2px; transform: none; }
  .header-cv-btn { font-size: 13px; letter-spacing: 2px; }
  .lang-btn { font-size: 13px; letter-spacing: 2px; }

  /* Works page */
  .works-page { padding: 4rem 1rem 4rem; }
  .work-card {
    --work-copy-w: 0px;
    --work-preview-inset-top: 0px;
    --work-preview-inset-right: 0px;
    --work-preview-inset-bottom: 0px;
    --work-preview-inset-left: 0px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    column-gap: 0;
    overflow: visible;
  }
  .work-card-media { grid-column: 1; order: 1; height: 220px; overflow: hidden; }
  .work-card-info {
    order: 2;
    position: static;
    padding: 0.75rem 0 0.5rem;
    background: none;
  }
  .work-card-num { font-size: 6rem; }
  .hero { padding: 3rem 1.5rem; }
  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .hero-desc, .hero-actions { padding-left: 0; }
  .site-footer { padding: 1.25rem 1.5rem; }
  .hero-title { font-size: clamp(36px, 10vw, 96px); }
  .ht-first { display: block; }
  .ht-first::after { content: none; }
  .contacts-info { flex-direction: column; }
  .contacts-info-right { padding-top: 0; }

  /* Homepage with works — mobile overrides */
  .hero-page--with-works .hero-title { font-size: clamp(36px, 10vw, 96px); }
  .hero-page--with-works .hero { padding-bottom: 1.5rem; }
  .hero-page--with-works .work-card {
    --work-copy-w: 0px;
    --work-preview-inset-top: 0px;
    --work-preview-inset-right: 0px;
    --work-preview-inset-bottom: 0px;
    --work-preview-inset-left: 0px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    column-gap: 0;
    overflow: visible;
  }
  .hero-page--with-works .work-card-media {
    order: 1;
    grid-column: 1;
    width: 100%;
    height: 220px;
    overflow: hidden;
  }
  .hero-page--with-works .work-card-info {
    order: 2;
    position: static;
    padding: 0.75rem 0 0.5rem;
    background: none;
  }
  .hero-page--with-works .works-list {
    transform: none !important;
    padding: 0 1rem 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .work-card { transform: none !important; scale: 1 !important; }
  .work-card-bg { transform: none !important; }
  .works-list { transform: none !important; }
  .hero-content { transform: none !important; }
  .hero-grid-canvas { display: none; }
}
