/* ============================================
   INFINARA
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d0c0b;
  --bg-elevated: #131210;
  --text: #e8e4dc;
  --text-muted: #6b6560;
  --accent: #c4a882;
  --border: #1e1b18;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Abril Fatface', Georgia, serif;
  --max-width: 1400px;
  --nav-height: 72px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p {
  max-width: 640px;
  color: var(--text-muted);
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  background: rgba(13, 12, 11, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  z-index: 101;
  transition: background 0.5s ease, border-color 0.5s ease, backdrop-filter 0.5s ease;
}

/* Logo fades in only after scrolling past the hero — JS toggles .logo-visible */
.nav-logo {
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.nav-logo.logo-visible {
  opacity: 1;
  pointer-events: auto;
}

nav.scrolled {
  background: rgba(13, 12, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* --- Main Content --- */
main {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* Hero page: nav overlaps the hero image */
main:has(.hero) {
  margin-top: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

/* --- Hero (Home page) --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.38);
  transform: scale(1.08);
  transition: transform 14s ease;
  will-change: transform;
}

.hero.loaded .hero-bg {
  transform: scale(1);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
  transform: translateY(-12vh);
}

.hero h1 {
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(3rem, 19vw, 26rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-indent: 0.04em;
  text-transform: uppercase;
  color: #e8150a;
  margin-bottom: 0;
  line-height: 1;
  width: 100%;
  text-align: center;
}

.hero p {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(232, 228, 223, 0.45);
  max-width: none;
  margin: 0;
}

/* Gradient buffer — fades hero into the dark gallery below */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35vh;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: block;
  width: 1px;
  height: 56px;
  overflow: hidden;
}

.scroll-indicator span {
  display: block;
  width: 1px;
  height: 100%;
  background: rgba(201, 185, 154, 0.45);
  animation: scrollDrop 2.4s ease infinite;
}

@keyframes scrollDrop {
  0%   { transform: translateY(-100%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* --- Gallery Meta --- */
.gallery-meta {
  padding: 3rem 0 0.75rem;
  text-align: right;
}

.gallery-meta span {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Gallery Grid --- */
.gallery-grid {
  columns: 3;
  column-gap: 0.6rem;
  padding: 0.75rem 0 4rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.6rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease,
              transform 0.7s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s cubic-bezier(0.25, 0, 0.25, 1),
              filter 0.6s ease;
  filter: brightness(0.88);
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(1);
}

.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.2rem 1.2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.overlay .location {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: var(--text);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  transition: color 0.2s;
}

.lightbox-nav:hover {
  color: var(--text);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(122, 117, 111, 0.8);
  white-space: nowrap;
}

/* --- Page Header --- */
.page-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

/* --- Shop --- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.shop-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.shop-item:hover {
  border-color: #2a2a2a;
}

.shop-item img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.shop-item-info {
  padding: 1.2rem 1.5rem;
}

.shop-item-info h3 {
  margin-bottom: 0.3rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
}

.shop-item-info .price {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--text-muted);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-body);
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent);
  color: var(--bg);
}

/* --- Licensing --- */
.licensing-section {
  max-width: 680px;
  padding: 2rem 0 4rem;
}

.licensing-section h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.licensing-section p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.licensing-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tier-card {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.tier-card h3 {
  font-family: var(--font-body);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.tier-card .price {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.tier-card p {
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Journal / Blog --- */
.journal-list {
  padding: 2rem 0 4rem;
  max-width: 760px;
}

.journal-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.journal-entry:first-child {
  padding-top: 0;
}

.journal-entry .date {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.journal-entry h2 {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.journal-entry h2 a {
  transition: color 0.2s;
}

.journal-entry h2 a:hover {
  color: var(--accent);
}

.journal-entry .excerpt {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.journal-entry .read-more {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- Blog Post --- */
.post-content {
  max-width: 700px;
  padding: 2rem 0 4rem;
}

.post-content .post-date {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-content h1 {
  margin-bottom: 2rem;
  font-size: 2rem;
}

.post-content p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: none;
}

.post-content img {
  margin: 2rem 0;
  width: 100%;
}

.post-back {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- About --- */
.about-content {
  max-width: 600px;
  padding: 2rem 0 4rem;
}

.about-content p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: none;
}

.about-content .signature {
  margin-top: 2rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* --- Contact --- */
.contact-content {
  max-width: 520px;
  padding: 2rem 0 4rem;
}

.contact-content p {
  margin-bottom: 2rem;
  color: var(--text);
  max-width: none;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner span {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
}

.footer-social a {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (max-width: 640px) {

  /* Persistent gradient from top — taller than the nav, always present */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, rgba(13,12,11,0.82) 0%, rgba(13,12,11,0) 100%);
    pointer-events: none;
    z-index: 100;
  }

  /* Nav expands to fill screen when menu is open */
  nav {
    height: var(--nav-height);
    overflow: hidden;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom-color: transparent !important;
    transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  }

  nav.menu-open {
    height: 100vh;
    height: 100svh;
    background: rgba(13, 12, 11, 0.65) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border-bottom-color: transparent !important;
  }

  /* Links sit inside the expanded nav, centered in remaining space */
  .nav-links {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - var(--nav-height));
    height: calc(100svh - var(--nav-height));
    gap: 3rem;
    opacity: 0;
    transition: opacity 0.25s ease 0.2s;
    pointer-events: none;
  }

  nav.menu-open .nav-links {
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    font-size: 1.05rem;
    letter-spacing: 0.22em;
    color: var(--text);
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--accent);
  }

  /* Hamburger → X */
  .nav-toggle {
    display: block;
  }

  .nav-toggle span {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4.5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4.5px, -5px);
  }

  .gallery-grid {
    columns: 1;
  }

  .gallery-grid.view-timeline .gallery-item {
    inset: 0;
    height: auto;
  }

  .gallery-grid.view-timeline .gallery-item img {
    max-width: 84vw;
    max-height: 70vh;
  }

  .item-location { left: 0.6rem; transform: translateY(-50%) rotate(180deg); }
  .item-date     { right: 0.6rem; transform: translateY(-50%); }

  h1 { font-size: 1.8rem; }

  .hero {
    min-height: 100vh;
    padding: 3rem 1.5rem;
  }

  .hero-content {
    transform: translateY(0);
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .lightbox-nav {
    font-size: 1.5rem;
  }
}

/* ============================================
   LIGHT MODE
   ============================================ */

html.light {
  --bg: #f7f5f2;
  --bg-elevated: #edeae6;
  --text: #1a1815;
  --text-muted: #8a847e;
  --accent: #9a7852;
  --border: #d8d4cf;
}

html.light nav.scrolled {
  background: rgba(247, 245, 242, 0.93);
}

html.light .gallery-item img {
  filter: brightness(0.92);
}

html.light .gallery-item:hover img {
  filter: brightness(1);
}

html.light .lightbox {
  background: rgba(250, 248, 245, 0.98);
}

html.light .lightbox-close,
html.light .lightbox-nav {
  color: var(--text-muted);
}

/* Mobile gradient in light mode */
@media (max-width: 640px) {
  html.light body::before {
    background: linear-gradient(to bottom, rgba(247,245,242,0.85) 0%, rgba(247,245,242,0) 100%);
  }
  html.light nav.menu-open {
    background: rgba(247, 245, 242, 0.92) !important;
  }
}

/* ============================================
   THEME TOGGLE  (LIGHT | DARK in nav)
   ============================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.2s;
}

.theme-toggle .t-sep {
  opacity: 0.35;
}

.theme-toggle span[data-mode] {
  transition: color 0.2s;
  color: var(--text-muted);
}

.theme-toggle span[data-mode].active {
  color: var(--text);
}

/* ============================================
   VIEW CONTROLS  (LIST / GRID / TIMELINE)
   ============================================ */

.view-controls {
  position: fixed;
  bottom: max(1.6rem, var(--btn-safe-bottom, 0px));
  left: clamp(1.5rem, 4vw, 3rem);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.view-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s;
  line-height: 1;
}

.view-btn:hover,
.view-btn.active {
  color: var(--text);
}

/* ============================================
   GALLERY — EXHIBITION VIEW (vertical, default)
   ============================================ */

#gallery.timeline-active {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

#gallery.timeline-active .container {
  position: relative;
  height: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
}

#gallery.timeline-active .gallery-meta {
  display: none;
}

/* Deck stack — all items sit at the same position, JS transforms each individually */
.gallery-grid.view-timeline {
  columns: unset;
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  gap: 0;
  padding: 0;
  cursor: default;
  user-select: none;
}

.gallery-grid.view-timeline .gallery-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  break-inside: unset;
  margin-bottom: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  transform-style: flat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  visibility: hidden; /* JS sets visibility per-item */
}

.gallery-grid.view-timeline .gallery-item img {
  max-height: 68vh;
  width: auto;
  max-width: 56vw;
  height: auto;
  object-fit: contain;
  filter: brightness(0.9);
  transition: filter 0.4s ease;
  pointer-events: none;
}

.gallery-grid.view-timeline .gallery-item:hover img {
  filter: brightness(1);
}

/* Hide the hover overlay in wheel mode — metadata is on the sides */
.gallery-grid.view-timeline .overlay {
  display: none;
}

/* Side metadata — location (left) and date (right) */
.item-location,
.item-date {
  position: absolute;
  top: 50%;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.gallery-item.visible .item-location,
.gallery-item.visible .item-date {
  opacity: 1;
}

.item-location {
  left: clamp(1rem, calc(50% - 29vw - 2rem), 8rem);
  transform: translateY(-50%) rotate(180deg);
}

.item-date {
  right: clamp(1rem, calc(50% - 29vw - 2rem), 8rem);
  transform: translateY(-50%);
}

/* Hide side labels in grid mode */
.gallery-grid.view-grid .item-location,
.gallery-grid.view-grid .item-date {
  display: none;
}

/* ============================================
   GALLERY — GRID VIEW
   ============================================ */

.gallery-grid.view-grid {
  columns: unset;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  height: auto;
  overflow: visible;
  cursor: default;
}

.gallery-grid.view-grid .gallery-item {
  margin-bottom: 0;
  break-inside: unset;
  height: auto;
  width: 100%;
}

.gallery-grid.view-grid .gallery-item img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .gallery-grid.view-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery-grid.view-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   GALLERY — TIMELINE BAR (bottom fixed)
   ============================================ */

.timeline-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 49;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 1.1rem;
}

.timeline-bar.active {
  opacity: 1;
}

.timeline-bar-track {
  width: calc(100% - 4rem);
  margin: 0 2rem 8px;
  height: 1px;
  background: var(--border);
}

.timeline-bar-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
}

.timeline-bar-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s ease;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.timeline-bar-label.has-text {
  opacity: 1;
}

.timeline-bar-label.current {
  color: var(--text);
}

/* Back to top button — shown in timeline mode */
/* Back to landing page */
.gallery-back-btn {
  position: fixed;
  bottom: max(1.4rem, var(--btn-safe-bottom, 0px));
  right: 1.6rem;
  z-index: 50;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}

.gallery-back-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.gallery-back-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Back to first photo in the deck */
.deck-top-btn {
  position: fixed;
  bottom: max(4rem, calc(var(--btn-safe-bottom, 0px) + 2.2rem));
  right: 1.6rem;
  z-index: 50;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}

.deck-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.deck-top-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Mobile gallery exit button */
.gallery-exit-btn {
  position: fixed;
  top: calc(var(--nav-height) + 0.8rem);
  right: 1rem;
  z-index: 200;
  background: rgba(13, 12, 11, 0.75);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gallery-exit-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile gallery tap hint */
.gallery-tap-hint {
  position: fixed;
  top: calc(var(--nav-height) + 1.2rem);
  right: clamp(1.5rem, 4vw, 3rem);
  z-index: 50;
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.gallery-tap-hint.visible {
  opacity: 1;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

/* ============================================
   GALLERY — PREV/NEXT PREVIEWS
   ============================================ */

/* ============================================
   GALLERY — IMAGE COUNT
   ============================================ */

.gallery-count {
  position: fixed;
  top: calc(var(--nav-height) + 1.2rem);
  left: clamp(1.5rem, 4vw, 3rem);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 50;
}

.gallery-count.visible {
  opacity: 1;
}

/* ============================================
   JOURNAL — POSTCARD CARD GRID
   ============================================ */

.journal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 2rem 0 5rem;
}

.journal-card {
  border: 1px solid var(--border);
  padding: 1.6rem 1.8rem;
  cursor: pointer;
  position: relative;
  aspect-ratio: 7 / 4.6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.journal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.30) 0%,
    rgba(0, 0, 0, 0.52) 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.journal-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

.journal-card:hover::after {
  opacity: 0.65;
}

.jcard-year {
  position: relative;
  z-index: 1;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.jcard-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

.jcard-location {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

@media (max-width: 900px) {
  .journal-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .journal-cards { grid-template-columns: 1fr; }
  .journal-card  { aspect-ratio: unset; min-height: 140px; }
}

/* ============================================
   JOURNAL — POST MODAL
   ============================================ */

.journal-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.journal-modal.active {
  opacity: 1;
  visibility: visible;
}

.jmodal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.jmodal-box {
  position: relative;
  z-index: 1;
  background: var(--bg);
  width: min(92vw, 920px);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Hero image */
.jmodal-hero {
  position: relative;
  height: 40vh;
  flex-shrink: 0;
  overflow: hidden;
}

.jmodal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.68);
  display: block;
}

.jmodal-hero-meta {
  position: absolute;
  bottom: 1.4rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.jmodal-hero-year,
.jmodal-hero-location {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.55);
}

/* Close button — sits over hero image top-right */
.jmodal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 12, 11, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(232, 228, 220, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.jmodal-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(13, 12, 11, 0.85);
}

/* Body: journal text (left) + postcard design (right) */
.jmodal-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.jmodal-article {
  position: relative;
  padding: 2.4rem 2.8rem 3rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.jmodal-article .post-date {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.jmodal-article h1 {
  font-size: 1.5rem;
  margin-bottom: 1.8rem;
  line-height: 1.2;
}

.jmodal-article p {
  font-size: 0.93rem;
  line-height: 1.85;
  color: var(--text);
  max-width: none;
  margin-bottom: 1.1rem;
}

.jmodal-article p:last-child { margin-bottom: 0; }

.jmodal-post-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}

.jmodal-post-link:hover { color: var(--text); }

/* INFINARA brand label — left edge of article (message side of postcard) */
.jmodal-brand-label {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-size: 0.42rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

/* Postcard back — right column: POST CARD, stamp, address lines */
.jmodal-postcard-back {
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 2.4rem;
  overflow: hidden;
}

.pcback-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.pcback-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  letter-spacing: 0.02em;
}

.pcback-stamp-box {
  border: 1px solid var(--border);
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 72px;
  min-height: 72px;
  flex-shrink: 0;
}

.pcback-stamp-box span {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.6;
}

.pcback-subtitle {
  font-size: 0.38rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  opacity: 0.7;
}

.pcback-lines {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.pcback-lines span {
  display: block;
  height: 1px;
  background: var(--border);
}

@media (max-width: 700px) {
  .jmodal-box              { width: 96vw; max-height: 92vh; }
  .jmodal-hero             { height: 26vh; }
  .jmodal-body             { grid-template-columns: 1fr; }
  .jmodal-postcard-back    { display: none; }
  .jmodal-article          { padding: 1.8rem 1.4rem 2.4rem; }
}
