/* ============================================================
   ALAIN MICO — PORTFOLIO LANDING PAGE (v3)
   Design recreated from user-provided reference (ChatGPT handoff).
   Flipbook mechanics (engine, single-page cover/back, buttons,
   fullscreen) are unchanged from v2 — this file only restyles
   the surrounding page.
   ============================================================ */

:root {
  --bg: #f7f7f5;
  --ink: #111111;
  --blue: #0872ce;
  --divider: #d8d8d5;
  --muted: #7a7a76;
  --paper: #ffffff;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  height: 72px;
  padding: 0 clamp(20px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-header .role {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    height: 60px;
  }
  .site-header .role {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 110px) 24px clamp(48px, 7vw, 72px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-title {
  margin: 0;
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-title .accent {
  color: var(--blue);
}

.hero-desc {
  margin: 28px auto 0;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- Viewer ---------- */

.viewer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 56px;
}

/* Book stage: permanent dark "player" chrome, matching a self-hosted
   Issuu-style viewer. Nav arrows and the bottom controls are
   absolutely positioned against this box, so the exact same markup
   and CSS works unchanged in fullscreen — the box just grows to
   fill the screen and the controls stay pinned to its corners. */

.book-stage {
  position: relative;
  width: 100%;
  background: #141414;
  border-radius: 6px;
  padding: 40px 36px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.book-frame {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Single-page spreads (cover, back page) must stay under the
   flipbook engine's own landscape/portrait threshold — which is
   2 × the "minWidth" set in app.js (280px, so 560px here) — or the
   engine falls back to normal two-slot layout and renders the page
   in one slot with the other left blank. 540px is as large as this
   can safely go while reliably staying in single-page mode. */
.book-frame.is-single {
  max-width: 540px;
}

.zoom-viewport {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.zoom-viewport.is-zoomed {
  cursor: grab;
}

.zoom-viewport.is-panning {
  cursor: grabbing;
}

/* Hide scrollbars while still allowing scroll/pan */
.zoom-viewport::-webkit-scrollbar {
  display: none;
}
.zoom-viewport {
  scrollbar-width: none;
}

#book {
  width: 100%;
  height: 560px;
  margin: 0 auto;
}

#book .stf__item {
  /* Transparent, not white: any letterbox gap between this box and
     the actual page image (e.g. when the container's aspect ratio
     doesn't exactly match the page's) should blend with the dark
     book-stage behind it, not show as a jarring white bar. */
  background: transparent;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
}

#book .stf__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

/* ---------- Edge-mounted prev/next arrows ---------- */

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 72px;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 15;
}

.nav-arrow svg {
  width: 22px;
  height: 22px;
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nav-arrow:disabled {
  opacity: 0.25;
  cursor: default;
  background: rgba(255, 255, 255, 0.08);
}

.nav-arrow-left {
  left: 12px;
}

.nav-arrow-right {
  right: 12px;
}

/* ---------- Bottom-left: page counter + scrubber ---------- */

.bottombar-left {
  position: absolute;
  left: 20px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 15;
}

.page-counter {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #c7c7c4;
  white-space: nowrap;
  min-width: 52px;
}

/* ---------- Bottom-right: zoom slider + fullscreen ---------- */

.bottombar-right {
  position: absolute;
  right: 20px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
}

.mini-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #c7c7c4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.mini-btn svg {
  width: 15px;
  height: 15px;
}

.mini-btn:hover {
  color: #ffffff;
}

.mini-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.fullscreen-btn .icon-compress {
  display: none;
}

.fullscreen-btn.is-active .icon-expand {
  display: none;
}

.fullscreen-btn.is-active .icon-compress {
  display: block;
}

/* ---------- Range inputs (page scrubber + zoom slider) ---------- */

.scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 14px;
  background: transparent;
  cursor: pointer;
}

.zoom-scrubber {
  width: 80px;
}

.scrubber::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

.scrubber::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #f2f2f0;
  transition: transform 0.1s ease;
}

.scrubber::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: #f2f2f0;
  transition: transform 0.1s ease;
}

.scrubber:hover::-webkit-slider-thumb,
.scrubber:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

.scrubber:hover::-moz-range-thumb,
.scrubber:active::-moz-range-thumb {
  transform: scale(1.2);
}

.viewer-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ----------------------------------------------------------
   Fullscreen presentation. This is a self-built overlay, not the
   browser's native Fullscreen API — see the comment in app.js for
   why. position:fixed pulls it out of the page's normal flow to
   cover the full viewport ourselves, so there's no OS/browser
   chrome (close buttons, safe-area bars) added outside our control.
   The nav arrows and bottom controls are already positioned
   relative to .book-stage itself, so this only needs to grow that
   box to fill the screen — no separate control-position overrides
   needed.
   ---------------------------------------------------------- */

.book-stage.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  padding: 28px 56px 76px;
  justify-content: center;
  z-index: 1000;
}

body.fullscreen-lock {
  overflow: hidden;
}

.book-stage.is-fullscreen #book {
  height: calc(100vh - 160px);
}

.book-stage.is-fullscreen .book-frame {
  max-width: 1400px;
}

/* Same 560px hard ceiling applies here as in the base rule above —
   going wider (this used to be 780px) breaks single-page mode in
   fullscreen specifically, which is what caused the cover/back page
   to render as one slot of a spread with the other slot blank. */
.book-stage.is-fullscreen .book-frame.is-single {
  max-width: 540px;
}

.book-stage.is-fullscreen .viewer-hint {
  display: none;
}

/* ---------- Divider ---------- */

.rule {
  border: none;
  border-top: 1px solid var(--divider);
  max-width: 1040px;
  margin: 0 auto;
}

/* ---------- About ---------- */

.about {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 72px) clamp(20px, 5vw, 56px) clamp(56px, 8vw, 88px);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
}

.about-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  padding-top: 8px;
}

.about-content h2 {
  margin: 0 0 24px;
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.about-content p {
  margin: 0 0 20px;
  max-width: 640px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

.about-links {
  display: flex;
  gap: 32px;
  margin-top: 8px;
}

.about-links a {
  font-size: 15px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--divider);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.about-links a:hover {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--divider);
  padding: 22px clamp(20px, 5vw, 56px);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .about {
    grid-template-columns: 1fr;
  }
  .about-label {
    padding-top: 0;
  }
  .book-stage {
    padding: 32px 16px 52px;
  }
  #book {
    height: 62vh;
    min-height: 380px;
  }
  .nav-arrow {
    width: 34px;
    height: 54px;
  }
  .nav-arrow-left {
    left: 4px;
  }
  .nav-arrow-right {
    right: 4px;
  }
  .bottombar-left {
    left: 12px;
    bottom: 10px;
  }
  .bottombar-right {
    right: 12px;
    bottom: 10px;
  }
  .scrubber {
    width: 100px;
  }
  .zoom-scrubber {
    width: 50px;
  }
  .book-stage.is-fullscreen {
    padding: 16px 20px 60px;
  }
  .book-stage.is-fullscreen #book {
    height: calc(100vh - 110px);
  }
}
