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

body {
  background-color: #000;
  color: #fff;
  font-family: 'FuturaCyrillicBook', sans-serif;
  overflow-x: hidden;
}

/* ========== HEADER ========== */
.main-header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 40px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #00000000;
  z-index: 1000;
}

.logo {
  display: block;
  max-width: 180px;
}
.logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* Nav links with smooth fade-in underline */
.nav-links a {
  color: #fff;
  text-decoration: none;
  margin-left: 30px;
  font-family: 'FuturaCyrillicDemi', sans-serif;
  font-size: 14px;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: #fff;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  opacity: 1;
}
.nav-links a:hover,
.nav-links a.active {
  text-decoration: none;
}

/* ========== CAROUSEL ========== */
.carousel {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px; /* space below header */
}

/* Track contains all slides */
.carousel-track {
  display: flex;
  height: 100%;
  gap: var(--gap, 0px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;

  /* IMPORTANT: own the *horizontal* gesture */
  touch-action: pan-x;

  overscroll-behavior-x: contain;   /* stop the page from stealing the drag */
  will-change: transform;
}
.carousel-track:active { cursor: grabbing; }

/* iOS Safari sometimes ignores `pan-x`; let JS fully own the gesture */
@supports (-webkit-touch-callout: none) {
  .carousel-track { touch-action: none; }
}

/* Exactly 3 columns across */
.video-column {
  flex: 0 0 33.3333%;
  padding: 0;
  text-align: center; /* centers inline captions */
}

/* Allow drag without accidental link clicks */
.video-column a { pointer-events: none; }
.video-column a * { pointer-events: auto; }

/* Remove browser default link styles inside slides */
.video-column a,
.video-column a:link,
.video-column a:visited,
.video-column a:hover,
.video-column a:active {
  text-decoration: none;
  color: inherit;
}

/* Videos */
.video-column video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Captions base style */
.caption {
  margin-top: 20px;
  font-size: 14px;
  font-style: italic;
  color: #aaa;
  display: inline-block; /* width fits text only */
}

/* Clickable caption underline effect with smooth fade-in */
.video-column a .caption {
  color: #fff; /* white text */
  text-decoration: none;
  position: relative;
}
.video-column a .caption::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: #fff;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.video-column:hover a .caption::after,
.video-column a:hover .caption::after {
  width: 100%;
  opacity: 1;
}

/* ========== ABOUT PAGE ========== */
.about-wrapper {
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  padding: 120px 60px 60px;
  font-family: 'FuturaCyrillicBook', sans-serif;
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.about-image img {
  max-width: 400px;
  border-radius: 8px;
}

.about-text {
  flex: 1;
  max-width: 600px;
}
.about-text h1 {
  font-size: 32px;
  margin-bottom: 20px;
  font-family: 'FuturaCyrillicDemi', sans-serif;
}
.about-text p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
  text-align: justify;
}

/* ===== Carousel Timer Indicator ===== */
.carousel-timer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 10;
  display: grid;
  place-items: center;
}

.progress-ring {
  position: absolute;
  inset: 0;
  display: block;
  transform: rotate(-90deg);
}
.progress-ring__background { opacity: .3; }
.progress-ring__circle { transition: stroke-dashoffset .1s linear; }

.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  z-index: 1;
  font-family: "Times New Roman", serif;
  font-size: 16px;
  color: #fff;
  pointer-events: none;
}

.carousel-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: auto;
  z-index: 10;
}

.carousel-arrow {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.carousel-arrow:hover { color: #fff; }

.carousel-text { user-select: none; pointer-events: none; }

/* =========================
   MOBILE POLISH PACK
   ========================= */
:root {
  --safe-bottom: max(env(safe-area-inset-bottom), 16px);
  --safe-top: max(env(safe-area-inset-top), 0px);
}

/* Make the hero/carousel fill the visible height on mobile correctly */
.carousel {
  min-height: 100svh;
  padding-top: 40px;
}

/* One column per slide on small screens */
@media (max-width: 768px) {
  .video-column { flex: 0 0 100%; }
  .video-column video { max-height: 68svh; }
}

/* “Drag to explore” positioned above the browser bar */
.carousel-hint {
  bottom: calc(var(--safe-bottom) + 14px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 2px;
}

/* Timer disk smaller + anchored above the browser bar */
.carousel-timer {
  right: 16px;
  bottom: calc(var(--safe-bottom) + 16px);
  width: 54px;
  height: 54px;
}
@media (max-width: 480px) {
  .carousel-timer { width: 46px; height: 46px; }
  .timer-number { font-size: 14px; }
}

/* Header layout: desktop unchanged, mobile becomes a neat vertical list */
@media (max-width: 768px) {
  .main-header { padding: 24px 16px; }
  .logo { max-width: 150px; }
  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .nav-links a {
    font-size: 14px;
    margin-left: 0;
    align-self: flex-end;
    text-decoration: none;
  }
}

/* Keep captions readable on narrow screens and not too tight to the bottom */
@media (max-width: 768px) {
  .caption { margin-top: 14px; font-size: 13px; }
}

/* ==== Timer SVG centering (bullet-proof) ==== */
.carousel-timer {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 10;
}
.progress-ring { display: block; } /* no rotation here; it's on the <g> */
.timer-number {
  font-family: "Times New Roman", serif;
  font-size: 16px;
  fill: #fff;
  color: #fff;
  pointer-events: none;
}
/* stop rotating the whole SVG (we rotate the ring via <g>) */
.carousel-timer .progress-ring { transform: none !important; }
.carousel-timer .timer-number { transform: none !important; }

/* ===== HOMEPAGE-ONLY: one screen, no vertical scroll (was global before) ===== */
@media (max-width: 768px) {
  body.home,
  body.home html { height: 100%; }
  body.home {
    overflow: hidden;              /* stop vertical scrolling on HOME only */
    padding-bottom: 0 !important;
    overscroll-behavior-y: none;
  }

  /* keep header compact on mobile */
  body.home .main-header {
    padding: 12px 16px;
    height: var(--header-h, 56px);
    display: flex;
    align-items: center;
  }
  body.home .nav-links { flex-direction: row; gap: 16px; }

  /* hero fills the screen exactly on HOME */
  body.home .carousel {
    height: 100svh;
    padding-top: var(--header-h, 56px);
  }
  body.home .video-column video {
    max-height: calc(100svh - var(--header-h, 56px) - 90px);
  }

  /* small tweaks */
  body.home .caption { margin-top: 12px; }
  body.home .carousel-hint { bottom: 16px; }
  body.home .carousel-timer { bottom: 16px; }
}

/* ===== Global header: align logo + nav on the same line ===== */
:root {
  --header-h-desktop: 72px;
  --header-h-mobile: 56px;
}

.main-header {
  height: var(--header-h-desktop);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: block; }
.logo img {
  height: clamp(18px, 4.5vw, 28px);
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}
.nav-links a {
  line-height: 1;
  padding: 8px 0;
  font-size: 14px;
}

@media (max-width: 768px) {
  .main-header { height: var(--header-h-mobile); padding: 0 16px; }
  .logo img { height: 22px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
}

/* === Make the header underline align with "Seven Shapes" distance === */
.main-header .nav-links a {
  position: relative;
  padding: 8px 0;
  line-height: 1;
}
.main-header .nav-links a::after {
  bottom: 4px;  /* was -4px */
  height: 1px;
}
@supports (-webkit-touch-callout: none) {
  .main-header .nav-links a::after { bottom: 5px; }
}

/* Disable auto-hyphenation everywhere */
.work-hero .work-intro,
.about-wrap .about-text p,
#contact-page .contact-wrap p {
  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

/* Subtle gradient below the fixed header */
.top-fade{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0));
  pointer-events: none;
  z-index: 8;
}

/* Ensure header sits above the fade */
.main-header { z-index: 10; }

/* (You already have this) make sure the content clears the fixed header */
#work-page .work-wrap { padding-top: 140px; }

/* Header logo sizing */
.logo img { height: 28px; width: auto; display:block; }

/* Smaller on mobile */
@media (max-width: 700px) {
  .logo img { height: 22px; }
}

/* ===== Unified page titles + top spacing (Work / About / Contact) ===== */
#work-page  .work-wrap,
#about-page .about-wrap,
#contact-page .contact-wrap {
  padding: 140px 60px 80px;   /* desktop */
  color: #fff;
  background: #000;
}

#work-page  .work-hero h1,
#about-page .about-hero h1,
#contact-page .contact-hero h1 {
  font-family: 'FuturaCyrillicDemi', sans-serif;
  font-size: 44px;
  line-height: 1.1;
  text-align: center;
  margin: 0 0 18px;
}

/* Mobile tightening to keep everything aligned */
@media (max-width: 680px) {
  #work-page  .work-wrap,
  #about-page .about-wrap,
  #contact-page .contact-wrap {
    padding: 120px 24px 60px;
  }
  #work-page  .work-hero h1,
  #about-page .about-hero h1,
  #contact-page .contact-hero h1 {
    font-size: 34px;
    margin-bottom: 16px;
  }
}

/* Keep "DRAG TO EXPLORE" centered and single-line */
.carousel-hint{
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
  white-space: nowrap;
}

/* make both arrows the same fixed width so center = true center */
.carousel-arrow{
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
}

/* responsive text that shrinks a bit on small screens */
.carousel-text{
  white-space: nowrap;
  line-height: 1;
  font-size: clamp(10px, 2.6vw, 12px);
  letter-spacing: clamp(0.8px, 0.25vw, 2px);
}
@media (max-width: 400px){
  .carousel-text{ letter-spacing: 1px; }
}

/* Fluid logo scaling (iPhone 14 Pro friendly) */
.logo img { height: clamp(18px, 4.5vw, 28px); }

/* ---- iOS header/logo fixes ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Make header height explicit and consistent */
.main-header { height: var(--header-h-desktop); padding: 0 60px; }
@media (max-width: 768px){
  .main-header { height: var(--header-h-mobile); padding: 0 16px; }
}

/* Scale the logo by WIDTH (safe everywhere) */
.logo { width: clamp(120px, 34vw, 180px); flex: 0 0 auto; }
.logo img { width: 100%; height: auto; display: block; }

/* Keep the carousel from hiding under the fixed header */
.carousel { padding-top: var(--header-h-desktop); }
@media (max-width: 768px){
  .carousel { padding-top: var(--header-h-mobile); }
}

/* Tiny phones: slightly smaller nav text and gaps */
@media (max-width: 390px){
  .nav-links a { font-size: 13px; margin-left: 20px; }
}

/* ---- iOS logo + header fix (wins over earlier rules) ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.main-header .logo { width: clamp(120px, 34vw, 180px); flex: 0 0 auto; }
.main-header .logo img { width: 100%; height: auto !important; display: block; }

/* ==== Global header normalizer ==== */
:root{
  --header-h-desktop: 72px;
  --header-h-mobile: 56px;
  --header-pad-desktop: 60px;
  --header-pad-mobile: 16px;
}
body > .main-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h-desktop);
  padding: 0 var(--header-pad-desktop);
}
@media (max-width: 768px){
  body > .main-header{
    height: var(--header-h-mobile);
    padding: 0 var(--header-pad-mobile);
  }
}
body > .main-header .logo{ width: clamp(120px, 34vw, 180px); flex: 0 0 auto; }
body > .main-header .logo img{ width: 100%; height: auto !important; display: block; }
.nav-links a{ line-height: 1; }

/* kill page-specific header padding overrides if any remain */
#work-page .main-header,
#about-page .main-header,
#contact-page .main-header{
  padding: 0 var(--header-pad-desktop) !important;
}
@media (max-width:768px){
  #work-page .main-header,
  #about-page .main-header,
  #contact-page .main-header{
    padding: 0 var(--header-pad-mobile) !important;
  }
}

/* ---------- iPhone 14 Pro header-fit hotfixes ---------- */
html { overflow-x: hidden; }

body > .main-header .nav-links{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:22px;
  white-space:nowrap;
  min-width:0;
  flex:1 1 auto;
}
@media (max-width: 430px){
  body > .main-header{ padding: 0 14px !important; }
  body > .main-header .logo{
    width: clamp(110px, 28vw, 150px);
  }
  body > .main-header .nav-links{
    gap: clamp(8px, 2.8vw, 18px);
  }
  body > .main-header .nav-links a{
    margin-left: 0;
    font-size: clamp(12px, 3.2vw, 14px);
  }
}
@media (max-width: 375px){
  body > .main-header .nav-links a{ font-size: 12px; }
  body > .main-header .nav-links{ gap: 10px; }
}

/* ===== Responsive timer wheel (keeps numeral centered) ===== */
:root{
  --timer-size: clamp(44px, 9.5vw, 60px);
  --timer-stroke: calc(var(--timer-size) * 0.035);
  --timer-font:   calc(var(--timer-size) * 0.34);
}
.carousel-timer{
  position: fixed;
  width: var(--timer-size);
  height: var(--timer-size);
  right: clamp(10px, 4vw, 30px);
  bottom: calc(max(env(safe-area-inset-bottom), 12px) + 12px);
  pointer-events: none;
  z-index: 10;
}
.progress-ring{ width: 100%; height: 100%; }
.progress-ring__background,
.progress-ring__circle{ stroke-width: var(--timer-stroke); }
.timer-number{
  font-family: "Times New Roman", serif;
  font-size: var(--timer-font);
  line-height: 1;
  fill: #fff;
  color: #fff;
  pointer-events: none;
}
@media (max-width: 430px){
  .carousel-hint{
    bottom: calc(max(env(safe-area-inset-bottom), 12px) + 70px);
  }
}
@media (max-width: 360px){
  :root{ --timer-size: 40px; }
}

/* --- Keep caption above, hint below (mobile only) --- */
@media (max-width: 768px) {
  .carousel-hint { bottom: max(env(safe-area-inset-bottom), 8px) !important; }
  .caption { margin-bottom: 14px; }
}

/* ===== Ensure non-home pages can scroll on mobile ===== */
#work-page,
#about-page,
#contact-page {
  overflow-y: auto !important;
  height: auto !important;
}

/* ===== iOS/phone header hotfix (place at END of style.css) ===== */

/* Never stack the nav vertically on small screens */
@media (max-width: 768px) {
  body > .main-header .nav-links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;   /* keep on one line */
    gap: 16px !important;
    min-width: 0 !important;        /* allow shrink instead of overflow */
  }
  body > .main-header .nav-links a {
    margin-left: 0 !important;
    padding: 8px 0;
  }
}

/* iPhone 14/15 Pro width: make sure all three fit */
@media (max-width: 430px) {
  body > .main-header { padding: 0 14px !important; }
  body > .main-header .logo { width: clamp(110px, 28vw, 150px) !important; }
  body > .main-header .nav-links {
    gap: 12px !important;
  }
  body > .main-header .nav-links a {
    font-size: 13px !important;
    letter-spacing: 0.02em !important;
  }
}

/* Extra tiny widths: last resort downscale so nothing slips off-screen */
@media (max-width: 375px) {
  body > .main-header .nav-links a { font-size: 12px !important; }
  body > .main-header .nav-links { gap: 10px !important; }
}

/* Make sure header sits above everything and the fade never hides links */
body > .main-header { z-index: 1000 !important; }
.top-fade         { z-index: 900  !important; }
