/* ==========================================================================
   ANDYARCHIVES - MINIMAL & CLEAN STYLESHEET
   Brutalist portfolio: pinned viewport chrome, carousel, slideshow, about
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography & Custom Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Courier Prime";
  font-weight: 400;
  font-style: normal;
  src: url("../fonts/Courier Prime.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "N Type82 Mono";
  font-weight: 400;
  font-style: normal;
  src: url("../fonts/NType82Mono-Regular.woff2") format("woff2");
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Design Tokens & Global Reset
   -------------------------------------------------------------------------- */
:root {
  /* Inset of the pinned corner navigation from the viewport edge */
  --nav-inset: 11px;
  --bg: #ffffff;
  --text: #000000;
  --font-mono: "N Type82 Mono", "Courier New", monospace;
  --font-caption: "Courier Prime", monospace;

  /* ------------------------------------------------------------------------
     NAV BOTTOM BUTTONS SHADOW CONTROLS (ABOUT & CONTACT)
     Easily adjust the white drop shadow / mask behind ABOUT & CONTACT here:
     ------------------------------------------------------------------------ */
  --nav-btn-shadow-color: rgba(255, 255, 255, 1); /* Shadow color & opacity (0.0 to 1.0) */
  --nav-btn-halo-pad-x: 5px;                       /* How far the opaque pad extends horizontally past the text */
  --nav-btn-halo-pad-y: 3px;                       /* ...and vertically */
  --nav-btn-shadow-blur: 3px;                      /* Shadow spread / radius (e.g. 4px, 8px, 16px) */

  /* ------------------------------------------------------------------------
     MEDIA SIZING CONTROLS
     Easily adjust the displayed size of images & videos here:
     ------------------------------------------------------------------------ */
  --media-max-height: 76vh;          /* Desktop max height (scaled with width) */
  --media-max-width: 92vw;           /* Desktop max width */

  /* Carousel Sizing Variables */
  --carousel-base-height: 12vh;      /* Desktop base height for widest landscape */
  --carousel-max-scale: 2.05;        /* Tallest tier scale (prevents vertical clipping) */

  /* Mobile sizing (< 768px) */
  --media-mobile-max-height: 65vh;   /* Mobile normal media max height */
  --media-mobile-max-width: 101.2vw; /* Mobile media max width (may bleed past the viewport) */

  /* Mobile 90° rotated media sizing */
  --media-rotated-max-width: 65vh;   /* Visual height of rotated media on screen */
  --media-rotated-max-height: 101.2vw; /* Visual width of rotated media on screen (may bleed past the viewport) */
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-x: none; /* no two-finger swipe back/forward while scrolling the carousel */
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

/* --------------------------------------------------------------------------
   3. Pinned Viewport Frame (mix-blend-mode: difference)
   -------------------------------------------------------------------------- */
.nav-frame {
  position: fixed;
  z-index: 999;
  mix-blend-mode: difference;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  left: var(--nav-inset);
  right: var(--nav-inset);
  color: #ffffff;
}

.nav-frame a,
.nav-frame span {
  color: #ffffff !important;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
}

.nav-frame a:active {
  opacity: 0.7;
}

/* Very thin hover underline on INSTAGRAM, ABOUT, and CONTACT */
.nav-top a.nav-corner:hover,
.nav-bottom a.nav-corner:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
}

/* Corner Links: INSTAGRAM, ©2026, ABOUT, CONTACT, #parisTime (letter-spacing 18% lower: 0.06em * 0.82 = 0.0492em) */
.nav-corner {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.0492em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Top-center dynamic Paris date, time, and city */
.nav-frame .nav-paris-time {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  cursor: default;
}

/* Cancel out trailing letter-spacing on rightmost corner items so glyphs touch 11px margin */
.nav-top .nav-corner:last-child,
.nav-bottom .nav-corner:last-child {
  margin-right: -0.0492em;
}

/* Spaced Brand & Indicator: ANDYARCHIVES, SELECTED WORK, Project Titles */
.nav-brand,
.nav-indicator {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 1em;
  text-transform: uppercase;
  line-height: 1.2;
}

.nav-indicator {
  text-align: right;
  /* Cancel out trailing 1em advance so the last visible glyph aligns flush to 11px margin */
  margin-right: -1em;
}

.nav-top {
  top: var(--nav-inset);
}

.nav-middle {
  top: 50%;
  transform: translateY(-50%);
}

.nav-bottom {
  bottom: var(--nav-inset);
  mix-blend-mode: normal;
}

/* Solid white pad behind ABOUT and CONTACT, softened by a blur: fully opaque under the text,
   feathered edges. Hides the graduation ticks behind the labels. */
.nav-bottom .nav-corner {
  position: relative;
  color: #000000 !important;
}

.nav-bottom .nav-corner::before {
  content: "";
  position: absolute;
  inset: calc(var(--nav-btn-halo-pad-y) * -1) calc(var(--nav-btn-halo-pad-x) * -1);
  background: var(--nav-btn-shadow-color);
  filter: blur(var(--nav-btn-shadow-blur));
  z-index: -1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. View Container & Shared View Styles
   -------------------------------------------------------------------------- */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: excludes the collapsing address bar */
  overflow: hidden;
}

/* Keyboard focus visibility for nav links */
.nav-frame a:focus-visible {
  outline: 1px solid #ffffff;
  outline-offset: 3px;
}

/* About text/email should be selectable */
.about-content {
  user-select: text;
  -webkit-user-select: text;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), visibility 0.3s;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.view.is-transitioning-out {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: visible !important;
}

.view.is-transitioning-in {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* --------------------------------------------------------------------------
   5. View 1: Landing / Home (#intro)
   -------------------------------------------------------------------------- */
.view[id="view-intro"] {
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Media Carousel (#intro only) */
.media-carousel {
  position: absolute;
  top: var(--nav-inset);
  left: 0;
  width: 100vw;
  height: calc(var(--carousel-base-height) * var(--carousel-max-scale, 2.05));
  overflow: hidden;
  z-index: 2;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.media-carousel.fading-out {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  height: 100%;
  gap: 6px;
  width: max-content;
  will-change: transform;
}

.carousel-set {
  display: flex;
  align-items: flex-start;
  height: 100%;
  gap: 6px;
  flex-shrink: 0;
}

.carousel-item {
  height: calc(var(--carousel-base-height) * var(--tier-scale, 1));
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  cursor: pointer;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Tier scale classes */
.carousel-item.tier-0 { --tier-scale: 1.00; }
.carousel-item.tier-1 { --tier-scale: 1.20; }
.carousel-item.tier-2 { --tier-scale: 1.45; }
.carousel-item.tier-3 { --tier-scale: 1.75; }
.carousel-item.tier-4 { --tier-scale: 2.05; }

/* Staggered appearance animation occurring at loading */
.media-carousel.is-appearing .carousel-item {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.media-carousel.is-appearing .carousel-item.revealed {
  opacity: 1;
}

/* Instant hover interaction: no transition / instant appearing and disappearing */
.media-carousel.has-hovered-item .carousel-item {
  opacity: 0 !important;
  transition: none !important;
}

.media-carousel.has-hovered-item .carousel-item.is-hovered {
  opacity: 1 !important;
  transition: none !important;
}

/* Caption shown when hovering a media item in #intro (52px above the bottom edge) */
.intro-hover-caption {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-caption);
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  color: rgba(0, 0, 0, 0.85);
  letter-spacing: 0;
  width: max-content;
  max-width: 75vw;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.intro-hover-caption.active {
  opacity: 1;
}

.home-logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 81vw;
  cursor: pointer;
  padding: 0;
}

/* Svg logo sized 10% smaller on desktop: 81vw */
.home-logo-svg {
  display: block;
  width: 81vw;
  max-width: 81vw;
  height: auto;
}

/* Character/letter/glyph hover interaction:
   Instant disappear and instant reappear on hover (no transition).
   Hover detection activates via the rectangle bounding box around each glyph.
*/
.logo-glyph {
  cursor: pointer;
  pointer-events: auto;
}

.logo-glyph path {
  opacity: 1;
  transition: none !important;
}

.glyph-hitbox {
  pointer-events: all !important;
  cursor: pointer;
}

@media (hover: hover) and (min-width: 769px) {
  .logo-glyph:hover path {
    opacity: 0 !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   6. View 2: Projects Slideshow (#projects)
   -------------------------------------------------------------------------- */
.view[id="view-projects"] {
  overflow: hidden;
}

/* Left / Right 50% Navigation Cursor Zones */
.click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 10;
}

.click-zone-prev {
  left: 0;
  cursor: w-resize;
}

.click-zone-next {
  right: 0;
  cursor: e-resize;
}

/* 
   Slideshow Stage:
   The media container is mathematically centered vertically and horizontally
   at (50vw, 50vh).
   The caption is sticky/in place near the bottom of the viewport so it never
   moves when media changes, while spacing between caption and media varies.
*/
.slideshow-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.slideshow-stage.fading-in {
  animation: fadeInMedia 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadeInMedia {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.media-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: var(--media-max-height);
  max-width: var(--media-max-width);
}

.slideshow-media {
  max-height: var(--media-max-height);
  max-width: var(--media-max-width);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 
   Caption: Sticky/in place on all devices (near bottom viewport edge).
   Never moves when media changes. Positioned 52px from bottom viewport edge
   (52px above the bottom edge).
*/
.slide-caption {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-caption);
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  color: rgba(0, 0, 0, 0.85);
  letter-spacing: 0;
  width: max-content;
  max-width: 75vw;
  pointer-events: none;
  z-index: 6;
}

/* --------------------------------------------------------------------------
   6b. Media Graduation Bar (#intro & #projects)
   -------------------------------------------------------------------------- */
.media-graduation {
  display: block;
  position: fixed;
  bottom: var(--nav-inset);
  left: 0;
  width: 100vw;
  height: 16px;
  overflow: hidden;
  z-index: 20;
  pointer-events: auto;
  user-select: none;
  mix-blend-mode: difference;
  padding-left: var(--nav-inset);
  box-sizing: border-box;
}

.media-graduation-track {
  display: flex;
  align-items: center;
  column-gap: 10px;
  width: max-content;
  height: 100%;
  will-change: transform;
}

.grad-set {
  display: flex;
  align-items: center;
  column-gap: 10px;
  height: 100%;
  padding: 0;
  margin: 0;
  width: max-content;
  box-sizing: border-box;
  flex-shrink: 0;
}

.grad-tick {
  position: relative;
  width: 1px;
  height: 16px;
  background-color: #ffffff;
  opacity: 0.4; /* 40% opacity by default */
  flex-shrink: 0;
  cursor: pointer;
  transition: width 0.12s ease, opacity 0.12s ease;
}

/* Stagger reveal animation for media-graduation starting from center outward */
.media-graduation.is-appearing .grad-tick {
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.2, 0, 0.2, 1);
}

.media-graduation.is-appearing .grad-tick.revealed {
  opacity: 0.4;
}

/* Touch hit area for mobile tap targets */
.grad-tick::after {
  content: "";
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: -5px;
  right: -5px;
}

/* Only selected or hovered rectangle is 100% opacity and expands to 2px */
.grad-tick.active,
.grad-tick.is-hovered,
.grad-tick:hover {
  width: 2px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   7. View 3: About View (#about)
   -------------------------------------------------------------------------- */
.view[id="view-about"] {
  background-color: #ffffff;
  overflow: hidden;
}

/* Extremely quick and short fade transition for the about page content */
.view[id="view-about"] .about-content,
.view[id="view-about"] .about-photo-wrapper {
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.view[id="view-about"].active .about-content,
.view[id="view-about"].active .about-photo-wrapper {
  opacity: 1;
}

.about-photo-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

/* Background profile picture */
.about-photo-img {
  display: block;
  max-height: 44vh;
  max-width: 38vw;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.5;
}

/* About text: N Type 82 Mono, 13.5px line-height */
.about-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: grid;
  grid-template-columns: 21vw 21vw;
  column-gap: 4.5vw;
  color: #ffffff;
  mix-blend-mode: difference;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 13.5px;
  letter-spacing: 0.02em;
}

.about-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.about-name {
  margin-bottom: 0.8rem;
}

.about-bio {
  margin-bottom: 0.8rem;
}

.about-content a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.about-content a:hover {
  text-decoration: none;
}

/* Links block: slightly tighter line-height */
.about-links {
  line-height: 14px;
}

.about-clients {
  margin-top: auto;
  line-height: 13.5px;
}

/* --------------------------------------------------------------------------
   8. Responsive Design (< 768px Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --nav-inset: 11px;
  }

  /* Seamless responsive header: hide top corners, move middle bar to top */
  .nav-top {
    display: none !important;
  }

  .nav-middle {
    top: var(--nav-inset) !important;
    transform: none !important;
  }

  /* Slightly larger text on mobile */
  .nav-brand,
  .nav-indicator,
  .nav-corner {
    font-size: 13px;
  }

  .nav-brand,
  .nav-indicator {
    letter-spacing: 0.06em;
  }

  .nav-corner {
    letter-spacing: 0.0492em;
  }

  .nav-indicator {
    margin-right: -0.06em;
  }

  /* Media Carousel on mobile: base height 18vh, scaled by tier */
  :root {
    --carousel-base-height: 18vh;
  }

  .media-carousel {
    top: var(--nav-inset);
    height: calc(var(--carousel-base-height) * var(--carousel-max-scale, 2.05));
  }

  .carousel-item {
    height: calc(var(--carousel-base-height) * var(--tier-scale, 1));
  }

  /* Ensure carousel items on mobile are instantly visible without blank delay */
  .media-carousel.is-appearing .carousel-item {
    opacity: 1 !important;
    transition: none !important;
  }

  .intro-hover-caption {
    display: none !important;
  }

  /* Logo on mobile: wider to fit the side margins */
  .home-logo-link {
    width: calc(100vw - 2 * var(--nav-inset)) !important;
  }

  .home-logo-svg {
    width: calc(100vw - 2 * var(--nav-inset)) !important;
    max-width: calc(100vw - 2 * var(--nav-inset)) !important;
  }

  /* Media sizing on mobile (may bleed past the viewport width) */
  .media-container,
  .slideshow-media {
    max-height: var(--media-mobile-max-height);
    max-width: var(--media-mobile-max-width);
  }

  /* Automatically rotated wide media on mobile (> 4:3 ratio) */
  .slideshow-media.rotated-mobile {
    transform: rotate(90deg);
    max-width: var(--media-rotated-max-width) !important;
    max-height: var(--media-rotated-max-height) !important;
  }

  /* Sticky in-place caption on mobile (70px above the bottom edge) */
  .slide-caption {
    bottom: 70px;
    font-size: 13px;
    max-width: calc(100vw - 140px);
  }

  /* About layout on mobile: smaller background photo, tighter line-height */
  .about-photo-img {
    max-height: 41vh;
    max-width: 68vw;
  }

  .about-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    grid-template-columns: none;
    width: 85vw;
    font-size: 13px;
    line-height: 12px;
  }

  .about-col {
    display: contents;
  }

  .about-name { order: 1; margin-bottom: 0; }
  .about-links { order: 2; }
  .about-bio { order: 3; margin-bottom: 0; }
  .about-more { order: 4; }
  .about-clients { order: 5; margin-top: 0.5rem; }
}
