/* ==========================================================================
   Luis Otterbeck CV — V6
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #0a0a0a;
  --white: #F7F7F7;
  --font-body: 'Montserrat', sans-serif;
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --fs-body: 12px;
  --fs-heading: 32px;
  --header-h: 56px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --max-w: 1100px;
}

/* Lenis */
html.lenis, html.lenis body {
  height: auto;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.4;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
  cursor: default;
}

::selection {
  background: var(--black);
  color: var(--white);
}

a { color: inherit; text-decoration: none; cursor: default; }
ul { list-style: none; }

/* ==========================================================================
   Preloader — letter fade in, hold, zoom through O
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.preloader.is-zooming {
  pointer-events: none;
}

.preloader__content {
  text-align: center;
  position: relative;
}

.preloader__name {
  font-family: var(--font-heading);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--black);
  white-space: nowrap;
}

.preloader__name .pl-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.preloader__name .pl-letter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.preloader__name .pl-space {
  display: inline-block;
  width: 0.25em;
}

/* Zoom through O */
.preloader.is-zooming .preloader__content {
  animation: zoomThroughO 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.preloader.is-zooming {
  animation: preloaderFadeOut 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes zoomThroughO {
  0% { transform: scale(1); opacity: 1; }
  40% { opacity: 1; }
  75% { opacity: 0.3; }
  100% { transform: scale(120); opacity: 0; }
}

@keyframes preloaderFadeOut {
  0% { background: var(--white); }
  60% { background: var(--white); }
  85% { background: rgba(250, 250, 250, 0.5); }
  100% { background: transparent; visibility: hidden; }
}

/* ==========================================================================
   Buttons — Glass, no border
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 3px 12px;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--black);
  cursor: pointer;
  transition: background 0.4s var(--ease-smooth);
  white-space: nowrap;
}

.btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.btn--glass-white {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.btn--glass-white:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn--large {
  padding: 6px 20px;
  font-size: 13px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  mix-blend-mode: difference;
}

.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 40px;
}

.header__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header__name {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--white);
  cursor: pointer;
}

.header .btn {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 10px;
  padding: 3px 12px;
}

.header .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 110;
  mix-blend-mode: difference;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--white);
  transition: transform 0.4s var(--ease-smooth), opacity 0.4s var(--ease-smooth);
}

.mobile-toggle.is-open span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.mobile-toggle.is-open span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 105;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-smooth);
}

.mobile-nav.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav .btn {
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--black);
}

.mobile-nav .btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--header-h) 40px 80px;
  text-align: center;
}

.hero__content {
  max-width: 1200px;
}

.hero__image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 40px;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(18px, 4.6vw, 68px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  color: var(--black);
  white-space: nowrap;
}

.hero__tagline {
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--black);
}

.hero__location {
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-top: 2px;
  color: var(--black);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 140px 40px;
}

.section__inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section__label {
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--black);
  padding-top: 10px;
  position: sticky;
  top: calc(var(--header-h) + 40px);
  align-self: start;
}

.section__subnote {
  margin: 1px 0 0;
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.section__content {
  max-width: 720px;
}

#portfolio .section__inner {
  grid-template-columns: 220px minmax(0, 1fr);
  max-width: none;
  margin: 0;
}

#portfolio .section__label {
  white-space: nowrap;
}

#portfolio .section__content {
  max-width: 860px;
}

/* ==========================================================================
   Bio
   ========================================================================== */

.bio-text {
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.04em;
  color: var(--black);
  max-width: 640px;
}

/* ==========================================================================
   Entries — no lines between entries
   ========================================================================== */

.entry {
  padding: 56px 0;
}

.entry__company {
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
  color: var(--black);
}

.entry__role {
  font-size: var(--fs-body);
  font-weight: 400;
  margin-bottom: 2px;
  color: var(--black);
}

.entry__period {
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--black);
  margin-bottom: 18px;
}

.entry__note {
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--black);
  margin-top: 8px;
}

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

.entry__details li {
  font-size: var(--fs-body);
  color: var(--black);
  padding-left: 12px;
  position: relative;
}

.entry__details li::before {
  content: '\00B7';
  position: absolute;
  left: 0;
  font-weight: 400;
  color: var(--black);
}

/* ==========================================================================
   Stagger Reveal — children fade in one by one
   ========================================================================== */

.stagger-child {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.stagger-reveal.is-visible .stagger-child {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Tools — lines stay here under category titles
   ========================================================================== */

.tools-category {
  margin-bottom: 56px;
}

.tools-category:last-child {
  margin-bottom: 0;
}

.tools-category__title {
  font-size: var(--fs-body);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--black);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--black);
}

.tools-category__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 60px;
  align-items: start;
}

.tools-category__grid span {
  font-family: var(--font-heading);
  font-size: var(--fs-heading);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.04em;
  color: var(--black);
  font-variant-numeric: lining-nums;
  font-feature-settings: 'lnum' 1;
}

/* ==========================================================================
   Video CTA
   ========================================================================== */

.video-cta {
  position: relative;
  height: 50vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-cta__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-cta__overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.42));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.video-cta__main {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-cta__text {
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--white);
  margin-bottom: 32px;
}

.video-cta__buttons {
  display: flex;
  gap: 12px;
}

.video-cta__footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-body);
  color: rgba(255, 255, 255, 0.5);
  padding-top: 16px;
}

/* ==========================================================================
   Word Reveal Animation
   ========================================================================== */

.word-reveal .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.word-reveal.is-visible .word,
.stagger-reveal.is-visible .word-reveal .word {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s var(--ease-smooth),
    transform 0.9s var(--ease-smooth);
  transition-delay: calc(var(--delay, 0) * 60ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--hero {
  transform: translateY(30px);
  transition-duration: 1.1s;
  transition-delay: calc(var(--delay, 0) * 150ms + 200ms);
}

/* ==========================================================================
   Custom Cursor Dot
   ========================================================================== */

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  background: var(--white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: difference;
  will-change: transform;
}

@media (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --header-h: 48px;
    --fs-heading: 24px;
  }

  .header__left,
  .header__right {
    display: none;
  }

  .header__center {
    position: static;
    transform: none;
  }

  .header__nav {
    justify-content: center;
    padding: 0 20px;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .hero {
    padding: var(--header-h) 20px 60px;
  }

  .hero__image {
    width: 100px;
    height: 100px;
    margin-bottom: 28px;
  }

  .section {
    padding: 80px 20px;
  }

  .section__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  #portfolio .section__inner {
    grid-template-columns: 1fr;
  }

  .section__label {
    position: static;
    padding-top: 0;
  }

  .tools-category__grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .entry {
    padding: 36px 0;
  }

  .video-cta__buttons {
    flex-direction: column;
    align-items: center;
  }

  .video-cta__overlay {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-heading: 22px;
  }

  .hero__name {
    font-size: 18px;
  }

  .video-cta__text {
    font-size: 24px;
  }
}

/* ==========================================================================
   Portfolio
   ========================================================================== */

.portfolio-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portfolio-item {
  border: 1px solid var(--black);
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}

.portfolio-item:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.05);
}

.portfolio-item:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.portfolio-item video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: auto;
  object-fit: contain;
  background: #000;
  border-radius: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: rgba(10, 10, 10, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-smooth);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__inner {
  width: min(1200px, 100%);
  max-height: calc(100vh - 120px);
}

.lightbox__inner video {
  width: 100%;
  max-height: calc(100vh - 120px);
  display: block;
  background: #000;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    padding: 56px 10px 10px;
  }

  .lightbox__inner video {
    max-height: calc(100vh - 74px);
  }
}

@media (max-width: 480px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}
