/* ============================================================
   TRISTAN LE PORT — shared stylesheet
   Fonts: stretched Times New Roman (logo/name) + IBM Plex Mono (everything else)
   ============================================================ */

:root {
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-serif: 'Times New Roman', Times, serif;

  --c-gallery: #FF392B;
  --c-books: #FFE124;
  --c-thought: #1E00EF;
  --c-rest: #FFFFFF;

  --header-h: 88px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  color: #111;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: var(--font-mono);
  cursor: pointer;
}

/* ---------- Logo / stretched Times New Roman ----------
   Approximation of the "stretched" condensed serif look using
   a horizontal scale transform. If you'd rather use a real logo
   image/webfont, swap the markup for <img class="logo" src="...">
   and drop this class. */
.logo-font {
  font-family: var(--font-serif);
  font-weight: 400;
  display: inline-block;
  transform: scaleX(0.6);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ============================================================
   HEADER (present on every page)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #000;
}

.site-header.transparent {
  position: absolute;
  left: 0;
  right: 0;
  background: transparent;
  z-index: 50;
}

.site-header .logo {
  color: #fff;
  font-size: 34px;
  transform-origin: left center;
}

.site-header.transparent .logo {
  visibility: hidden; /* landing page shows the big hero name instead */
}

/* Hamburger */
.hamburger {
  width: 34px;
  height: 26px;
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 11px; }
.hamburger span:nth-child(3) { top: 22px; }

.hamburger.is-open span:nth-child(1) {
  top: 11px;
  transform: rotate(45deg);
}
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) {
  top: 11px;
  transform: rotate(-45deg);
}

/* ============================================================
   SIDEBAR — white vertical panel, slides in from the right
   ============================================================ */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 45;
}

.sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #fff;
  z-index: 46;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 24px) 0 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar.is-open { transform: translateX(0); }

.sidebar a {
  padding: 16px 32px;
  font-size: 17px;
  color: #111;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar a.nav-gallery:hover { color: var(--c-gallery); }
.sidebar a.nav-books:hover { color: var(--c-books); }
.sidebar a.nav-thought:hover { color: var(--c-thought); }
/* white-on-white would be invisible on the sidebar's white panel, so this
   one keeps a thin dark outline on the text while still "switching" to white */
.sidebar a.nav-rest:hover { color: var(--c-rest); -webkit-text-stroke: 1px #111; }
.sidebar a.nav-home:hover { color: #888; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
body.landing-page { background: #000; }

.landing-hero {
  min-height: 100vh;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  position: relative;
}

/* If you don't have a background image yet, this gradient stands in for it. */
.landing-hero.no-image {
  background-image: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 8vw;
  max-width: 720px;
}

.hero-name {
  color: #fff;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 1;
  margin: 0;
  transform-origin: left center;
}

.hero-email {
  color: #fff;
  font-size: 13px;
  margin: 10px 0 28px;
  opacity: 0.9;
}

.hero-email a:hover { text-decoration: underline; }

.landing-menu {
  display: inline-flex;
  flex-direction: column;
  background: rgba(120, 120, 120, 0.55);
  backdrop-filter: blur(1px);
  min-width: 280px;
}

.landing-menu a {
  padding: 16px 24px;
  color: #111;
  font-size: 16px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.landing-menu a.nav-gallery:hover { color: var(--c-gallery); }
.landing-menu a.nav-books:hover { color: var(--c-books); }
.landing-menu a.nav-thought:hover { color: var(--c-thought); }
.landing-menu a.nav-rest:hover { color: var(--c-rest); }

/* ============================================================
   PAGE SHELL (gallery / books / thought machine / the rest)
   ============================================================ */
.page-label {
  font-size: 15px;
  padding: 28px 0 8px 60px;
  color: inherit;
}

.page-main {
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 24px 16px 0;
}

.gallery-item { max-width: 700px; width: 100%; text-align: left; }

.gallery-item figure { margin: 0; }

.gallery-item img,
.gallery-item .video-frame {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  background: #777;
}

.gallery-item .video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.gallery-item .video-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.gallery-item .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
  border-left: 38px solid #000;
  pointer-events: none;
}

figcaption {
  margin-top: 8px;
  font-size: 13px;
}

/* ============================================================
   LIGHTBOX (full-screen artwork / video view)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.is-open { display: flex; }

.lightbox-back {
  position: absolute;
  top: 24px;
  left: 28px;
  font-family: var(--font-mono);
  background: #fff;
  border: 1px solid #111;
  padding: 6px 14px;
  font-size: 13px;
}

.lightbox-back:hover { background: #111; color: #fff; }

.lightbox-body {
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-body img {
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
}

.lightbox-body .video-frame {
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  position: relative;
}

.lightbox-body .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-caption { font-size: 13px; }

/* ============================================================
   BOOKS
   ============================================================ */
.books-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 24px 16px 0;
}

.book-item { max-width: 340px; width: 100%; }

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #000;
  background-size: cover;
  background-position: center;
}

.book-meta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.book-title { flex: 1; }

.book-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-outline {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #fff;
  border: 1px solid #111;
  padding: 3px 10px;
  color: #111;
}

.btn-outline:hover { background: #111; color: #fff; }

/* ============================================================
   READER (flipbook) — same white background / bordered mono
   "back" button treatment as the gallery lightbox.
   ============================================================ */
html:has(body.reader-page),
body.reader-page {
  height: 100%;
  overflow: hidden; /* the whole reader always fits one screen, no scroll/zoom needed */
  background: #fff;
}

.reader-back {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 10;
}

.reader-title {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 13px;
  text-align: center;
  z-index: 5;
}

.reader-main {
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 74px 16px 12px;
}

.flipbook-stage {
  flex: 1 1 auto;
  min-height: 0; /* let this shrink instead of pushing the nav off-screen */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flipbook-container {
  display: flex;
  justify-content: center;
}

.reader-status {
  font-size: 13px;
  margin-top: 16px;
}

.reader-nav {
  flex: 0 0 auto;
  margin-top: 10px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.reader-pagecount { min-width: 64px; text-align: center; }

/* ============================================================
   THOUGHT MACHINE
   ============================================================ */
body.thought-page {
  background: #000;
  color: #fff;
  min-height: 100vh;
}
body.thought-page .site-header { background: #000; }

.thought-main { padding: 24px 16px 100px; }

.thought-button-wrap { display: flex; justify-content: center; margin: 24px 0 40px; }

.thought-quote-wrap {
  max-width: 620px;
  margin: 0 auto;
  text-align: center; /* block is centered on the page */
}

.thought-quote {
  text-align: left; /* text within the block is left-justified */
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.thought-quote.is-visible { opacity: 1; }

body.thought-page .btn-outline {
  background: #000;
  color: #fff;
  border-color: #fff;
}

body.thought-page .btn-outline:hover { background: #fff; color: #000; }

/* ============================================================
   THE REST
   ============================================================ */
.rest-sections { padding-top: 24px; }

.rest-section { margin-bottom: 56px; }
.rest-section:last-child { margin-bottom: 0; }

.rest-section-title {
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  margin: 0 0 20px;
}

.rest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 20px;
  padding: 0 40px;
}

.rest-item figure { margin: 0; }

.rest-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  cursor: pointer;
  background: transparent;
  position: relative;
  display: block;
}

.rest-item .video-frame {
  aspect-ratio: 4 / 3;
  background: transparent;
}

@media (max-width: 900px) {
  .rest-grid { grid-template-columns: repeat(2, 1fr); padding: 0 24px; }
}

@media (max-width: 560px) {
  .rest-grid { grid-template-columns: 1fr; }
  .page-label { padding-left: 24px; }
  .site-header { padding: 0 16px; }
  .site-header .logo { font-size: 26px; }
}
