/* ISO STUDIO — shared styles across all pages */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: #0a0a0a; color: #ececea; }

:root {
  --bg: #ececea;
  --bg-dark: #0a0a0a;
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --muted: #8a8a86;
  --accent: #e8133a;
  --line: rgba(10,10,10,0.18);
  --line-dark: rgba(255,255,255,0.18);
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
html { scroll-behavior: auto; }
body { cursor: none; }

a, button, [data-edit], .dropzone { cursor: none; }

img, video { display: block; max-width: 100%; }

/* Smooth scroll wrapper */
#smooth-wrap {
  position: fixed; inset: 0;
  overflow: hidden;
  width: 100%; height: 100vh;
}
#smooth-content {
  width: 100%;
  will-change: transform;
  padding-bottom: 2px;
}

/* Mobile: use native scrolling for better reliability */
@media (max-width: 900px) {
  #smooth-wrap {
    position: relative;
    overflow: visible;
    height: auto;
  }
  #smooth-content {
    transform: none !important;
    will-change: auto;
  }
}

/* -------- Media containers -------- */
.dropzone { position: relative; overflow: hidden; }
.dropzone .user-media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* -------- Custom cursor -------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 32px;
  border: 1px solid #0a0a0a;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate3d(-100px, -100px, 0);
  mix-blend-mode: difference;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  border-color: #fff;
}
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1001;
  mix-blend-mode: difference;
  transform: translate3d(-100px, -100px, 0);
}
.cursor.active {
  width: 64px; height: 64px;
  background: #fff;
  border-color: #fff;
}
.cursor.text { width: 14px; height: 14px; background: #fff; }
.cursor.hidden { opacity: 0; }

@media (hover: none), (max-width: 800px) {
  html, body, a, button, [data-edit], .dropzone { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}

/* -------- Persistent UI chrome -------- */
.chrome {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #fff;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.chrome.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }
.chrome-tl, .chrome-tr, .chrome-bl, .chrome-br {
  position: absolute;
  display: flex; align-items: center;
  gap: 18px; padding: 22px 28px;
}
.chrome-tl { top: 0; left: 0; }
.hero-vimeo {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-vimeo iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw;
  min-height: 100vh; min-width: 177.78vh;
  transform: translate(-50%, -50%);
  border: 0;
}
.chrome-tr {
  top: 0; right: 0;
  align-items: center;
  gap: 0;
}
.menu-collapsed {
  display: none;
  align-items: center; gap: 12px;
  cursor: none;
  font-family: var(--mono);
  font-size: 14px; letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 0;
  transition: opacity 0.4s ease;
}
.menu-expanded {
  display: flex; align-items: center; gap: 22px;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 15px; letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.menu-expanded a { transition: opacity 0.2s ease; }
/* Mobile: collapse to hamburger */
@media (max-width: 900px) {
  .menu-collapsed {
    display: flex;
    cursor: pointer;
    pointer-events: auto;
    padding: 16px;
    min-height: 56px;
    min-width: 120px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    mix-blend-mode: normal !important;
    color: #fff !important;
  }
  .chrome-tr:hover .menu-collapsed { opacity: 1; }
  .menu-expanded {
    position: fixed !important;
    top: 0; right: 0;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    padding: 80px 40px;
    width: 100%;
    height: 100vh;
    background: #000000 !important;
    mix-blend-mode: normal !important;
    filter: none !important;
    color: #ffffff !important;
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 9999;
  }
  .menu-expanded.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
  .menu-expanded a {
    font-size: 24px;
    letter-spacing: 0.12em;
    padding: 16px 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    color: #ffffff !important;
  }
  .menu-collapsed .plus {
    transition: transform 0.3s ease;
  }
  .menu-expanded.is-open ~ .menu-collapsed .plus {
    transform: rotate(135deg);
  }
  /* Close button for mobile menu - larger touch target */
  .menu-close {
    display: block;
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    color: #ffffff !important;
    mix-blend-mode: normal !important;
    filter: none !important;
  }
  .menu-close::before,
  .menu-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 2px;
    background: #ffffff !important;
  }
  .menu-close::before { transform: rotate(45deg); }
  .menu-close::after { transform: rotate(-45deg); }
}
.chrome-tr .plus {
  display: inline-block; width: 14px; height: 14px; position: relative;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}
@media (max-width: 900px) {
  .chrome-tr:hover .plus { transform: rotate(135deg); }
}
.chrome-bl { bottom: 0; left: 0; gap: 28px; }
.chrome-bl.social-links {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.chrome-bl.social-links.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.chrome-br { bottom: 0; right: 0; gap: 10px; }

.chrome-tl .num { display: inline-block; min-width: 28px; }
.chrome-tl .dash {
  display: inline-block; width: 56px; height: 1px; background: currentColor;
}
.chrome-tr .plus {
  display: inline-block; width: 12px; height: 12px; position: relative;
}
.chrome-tr .plus::before, .chrome-tr .plus::after {
  content: ''; position: absolute; background: currentColor;
}
.chrome-tr .plus::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.chrome-tr .plus::after  { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.menu-expanded a { color: inherit; text-decoration: none; }
.menu-expanded a:hover { opacity: 0.55 !important; }

.chrome-bl a, .chrome-br a, .chrome-tr a {
  color: inherit; text-decoration: none;
  transition: opacity 0.2s;
}
.chrome-bl a:hover, .chrome-br a:hover, .chrome-tr a:hover { opacity: 0.55; }

.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

/* corner brackets */
.bracket {
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid currentColor;
  pointer-events: none;
}
.bracket.tl { top: 28px; left: 28px; border-right: 0; border-bottom: 0; }
.bracket.tr { top: 28px; right: 28px; border-left: 0; border-bottom: 0; }
.bracket.bl { bottom: 28px; left: 28px; border-right: 0; border-top: 0; }
.bracket.br { bottom: 28px; right: 28px; border-left: 0; border-top: 0; }

/* -------- Loader -------- */
.loader {
  position: fixed; inset: 0;
  background: var(--bg-dark);
  color: #f4f2ec;
  z-index: 200;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader-logo { width: clamp(180px, 22vw, 320px); height: auto; margin-bottom: 28px; }
.loader-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(60px, 10vw, 140px);
  letter-spacing: -0.04em;
  line-height: 1; margin-bottom: 28px;
}
.loader-bar {
  width: 200px; height: 1px;
  background: rgba(255,255,255,0.18);
  position: relative; overflow: hidden;
}
.loader-bar::after {
  content: '';
  position: absolute; inset: 0;
  background: #f4f2ec;
  transform: translateX(-100%);
  animation: loaderFill 1.4s ease forwards;
}
@keyframes loaderFill { to { transform: translateX(0); } }
.loader.done { opacity: 0; visibility: hidden; }

/* -------- Edit tip -------- */
.edit-tip {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  padding: 10px 18px;
  background: rgba(10,10,10,0.92);
  color: #f4f2ec;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
  display: flex; align-items: center; gap: 14px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.4s;
}
.edit-tip.show { opacity: 1; }
.edit-tip button {
  background: transparent;
  color: #f4f2ec;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font: inherit;
  letter-spacing: 0.14em;
  cursor: none;
}
.edit-tip button:hover { background: #f4f2ec; color: #0a0a0a; }

/* -------- Page transition overlay -------- */
.page-curtain {
  position: fixed; inset: 0;
  background: var(--bg-dark);
  z-index: 300;
  transform: translateY(-100%);
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.3, 1);
  pointer-events: none;
}
.page-curtain.in { transform: translateY(0); }
.page-curtain.out { transform: translateY(100%); transition-duration: 0.45s; }

/* -------- Common section header -------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 80px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.section-head .label, .section-head .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.section-title {
  font-weight: 800;
  font-size: clamp(80px, 12vw, 200px);
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: 80px;
}

/* -------- Mobile -------- */
@media (max-width: 900px) {
  .chrome-tl, .chrome-tr, .chrome-bl, .chrome-br { padding: 14px; gap: 14px; }
  .bracket { width: 16px; height: 16px; }

  /* Touch target size optimizations (minimum 44x44px) */
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  /* Archive rows - larger touch targets */
  .archive-row {
    min-height: 48px;
    padding: 16px 0;
  }

  /* Buttons */
  .btn, button[type="submit"] {
    min-height: 44px;
    padding: 12px 24px;
  }

  /* Reduce animation complexity on mobile */
  .cursor, .cursor-dot {
    display: none !important;
  }

  /* Pause heavy animations on mobile */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Performance: content-visibility for off-screen content */
  section {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
  }

  /* Optimize image rendering on mobile */
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}
