/* ================================================
   CHARNA TERVEUS — Document Portfolio Viewer
   Page-flip between original documents
   ================================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'Elegance Signature';
  src: url('fonts/Elegance Signature Serif.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

@font-face { font-family: 'MADE Canvas'; src: url('fonts/MADE-Canvas-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'MADE Canvas'; src: url('fonts/MADE-Canvas-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'MADE Canvas'; src: url('fonts/MADE-Canvas-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* --- Theme: UT Southwestern Brand --- */
:root {
  /* Navy scale — based on Pantone 2955 #00355d → Pantone 2945 #004c97 */
  --blue-slate-50: #e8f0f8;
  --blue-slate-100: #d3dde6;  /* Pantone 642 */
  --blue-slate-200: #9bb3cc;
  --blue-slate-300: #6b8fb3;
  --blue-slate-400: #49759f;  /* Pantone 646 */
  --blue-slate-500: #636466;  /* Pantone 431 — UTSW gray */
  --blue-slate-600: #4a5264;
  --blue-slate-700: #004c97;  /* Pantone 2945 — UTSW main blue */
  --blue-slate-800: #003d78;
  --blue-slate-900: #00355d;  /* Pantone 2955 — UTSW dark navy */
  --blue-slate-950: #001d35;

  /* Orange accent — Pantone 166 #f26531, muted Pantone 160 #b36127 */
  --harvest-orange-50: #fef1eb;
  --harvest-orange-100: #fcd5c0;
  --harvest-orange-200: #f9ab82;
  --harvest-orange-300: #f68e5c;
  --harvest-orange-400: #f26531;  /* Pantone 166 */
  --harvest-orange-500: #d9531e;
  --harvest-orange-600: #b36127;  /* Pantone 160 */
  --harvest-orange-700: #8c3d14;

  /* Bright blue accent — Pantone 299 #009ee2 → Pantone 2945 #004c97 */
  --ocean-deep-50: #e6f5fd;
  --ocean-deep-100: #b3e0f7;
  --ocean-deep-200: #66c4ef;
  --ocean-deep-300: #33b1e9;
  --ocean-deep-400: #009ee2;  /* Pantone 299 — UTSW bright blue */
  --ocean-deep-500: #0088c6;
  --ocean-deep-600: #0070a4;
  --ocean-deep-700: #004c97;  /* Pantone 2945 */
  --ocean-deep-900: #00355d;  /* Pantone 2955 */

  /* Gray — Pantone 431 */
  --shadow-grey-50: #f5f5f5;
  --shadow-grey-200: #d1d1d2;
  --shadow-grey-400: #9a9b9d;
  --shadow-grey-600: #636466;  /* Pantone 431 */

  /* Purple accent — Pantone 2725 */
  --velvet-orchid-400: #776cb1;

  --font-display: 'Lora', 'Georgia', serif;
  --font-body: 'MADE Canvas', -apple-system, sans-serif;

  /* Document uses system serif to mimic the originals */
  --font-doc: 'Times New Roman', 'Georgia', serif;

  --topnav-height: 56px;
  --page-width: 680px;
  --page-height: min(88vh, 920px);
  --spread-width: calc(var(--page-width) * 2);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  color: var(--blue-slate-900);
  background: var(--blue-slate-950);
  min-height: 100vh;
  overflow: hidden;
}

/* Content layers */
.topnav { z-index: 200; }
.arrow { z-index: 150; }
.page-counter { z-index: 150; }
.book-wrapper { position: relative; z-index: 10; }

/* ======================================
   TOP NAVIGATION
   ====================================== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(0, 29, 53, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 76, 151, 0.3);
  overflow: visible;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.topnav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tab {
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-slate-400);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: all 0.2s ease;
}

.tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08); /* Lighter glass effect */
}

.tab.active {
  color: #fff;
  background: var(--ocean-deep-700);
  border-color: var(--ocean-deep-500);
  box-shadow: 0 0 15px rgba(0, 158, 226, 0.3);
}

.dropdown-trigger.active {
  background: var(--ocean-deep-900);
  border-color: var(--ocean-deep-400);
}

/* ======================================
   DROPDOWN MENU
   ====================================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chevron {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.dropdown:hover .chevron,
.dropdown.open .chevron {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(0, 35, 75, 0.98);
  backdrop-filter: blur(16px);
  min-width: 240px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(0, 158, 226, 0.25);
  padding: 8px;
  z-index: 300;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown:hover .dropdown-content,
.dropdown.open .dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-content .tab {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  border: none;
}

.dropdown-content .tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dropdown-content .tab.active {
  background: var(--ocean-deep-700);
}

/* ======================================
   ARROWS
   ====================================== */
.arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 29, 53, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 76, 151, 0.25);
  color: var(--blue-slate-200);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  line-height: 1;
}

.arrow:hover {
  background: var(--ocean-deep-400);
  color: #fff;
  border-color: var(--ocean-deep-400);
  box-shadow: 0 4px 28px rgba(0, 158, 226, 0.5);
}

.arrow:active { transform: translateY(-50%) scale(0.95); }
/* Default arrow positioning (mobile / single-page) */
.arrow-left { left: max(10px, calc(50vw - var(--page-width) / 2 - 72px)); }
.arrow-right { right: max(10px, calc(50vw - var(--page-width) / 2 - 72px)); }
.arrow:disabled { opacity: 0.15; cursor: default; pointer-events: none; }

/* ======================================
   PAGE COUNTER
   ====================================== */
.page-counter {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 29, 53, 0.9);
  backdrop-filter: blur(8px);
  color: var(--blue-slate-300);
  padding: 5px 18px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  z-index: 150;
  border: 1px solid rgba(0, 76, 151, 0.2);
}

/* ======================================
   BOOK / PAGES
   ====================================== */
.book-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
  padding: 20px;
}

.book {
  width: var(--page-width);
  height: var(--page-height);
  position: relative;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  overflow: hidden;
  /* Mobile single-page: slide transition */
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Mobile single-page: visibility classes */
.page.spread-hidden {
  visibility: hidden;
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}

.page.spread-visible {
  visibility: visible;
}

/* Paper edge shadow (single-page mode) */
.page::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 100%;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.035) 0%, transparent 100%);
  pointer-events: none;
}

/* ======================================
   DESKTOP BOOKLET (two-page spread)
   ====================================== */
@media (min-width: 961px) {
  :root {
    --page-width: min(680px, calc((100vw - 100px) / 2));
  }

  .book-wrapper {
    perspective: 2400px;
  }

  .book {
    width: var(--spread-width);
    display: grid;
    grid-template-columns: 1fr 1fr;
    transform-style: preserve-3d;
  }

  /* Spine shadow — center fold */
  .book::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 100%;
    background: linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.06) 35%,
      rgba(0, 0, 0, 0.12) 50%,
      rgba(0, 0, 0, 0.06) 65%,
      transparent 100%
    );
    pointer-events: none;
    z-index: 10;
  }

  .page {
    position: static;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
  }

  /* Left page in a spread */
  .page.spread-left {
    border-radius: 10px 0 0 10px;
    box-shadow:
      -4px 4px 20px rgba(0, 0, 0, 0.2),
      inset -8px 0 12px -8px rgba(0, 0, 0, 0.08);
  }

  /* Right page in a spread */
  .page.spread-right {
    border-radius: 0 10px 10px 0;
    box-shadow:
      4px 4px 20px rgba(0, 0, 0, 0.2),
      inset 8px 0 12px -8px rgba(0, 0, 0, 0.08);
  }

  /* Remove the right-edge paper shadow on left page, add to right only */
  .page.spread-left::after { display: none; }
  .page.spread-right::after {
    width: 40px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.03) 0%, transparent 100%);
  }

  /* Hidden pages — use visibility so PDFs stay loaded */
  .page.spread-hidden {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    width: 50%;
    height: 100%;
  }

  /* Cover mode — single centered page, no spine */
  .book.cover-mode {
    width: var(--page-width);
    display: block;
  }

  .book.cover-mode::after { display: none; }

  .book.cover-mode .page.spread-visible {
    border-radius: 10px;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.15);
  }

  /* Arrow positioning — account for spread width */
  .arrow-left { left: max(10px, calc(50vw - var(--spread-width) / 2 - 72px)); }
  .arrow-right { right: max(10px, calc(50vw - var(--spread-width) / 2 - 72px)); }

  /* Cover mode arrows revert to single-page width */
  body.cover-spread .arrow-left { left: max(10px, calc(50vw - var(--page-width) / 2 - 72px)); }
  body.cover-spread .arrow-right { right: max(10px, calc(50vw - var(--page-width) / 2 - 72px)); }

  /* --- Page flip animation (right page turns at spine) --- */
  .page.flip-right {
    position: absolute !important;
    top: 0;
    right: 0;
    left: auto;
    width: 50%;
    height: 100%;
    z-index: 20;
    transform-origin: left center;
    backface-visibility: hidden;
    transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1),
                box-shadow 0.7s ease;
    border-radius: 0 10px 10px 0;
    box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.3);
  }

  .page.flip-right.flipped {
    transform: rotateY(-180deg);
    box-shadow: -4px 4px 28px rgba(0, 0, 0, 0.35);
  }
}

.page-inner {
  position: relative;
  z-index: 2;
  padding: 36px 44px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--blue-slate-200) transparent;
}

.page-inner::-webkit-scrollbar { width: 4px; }
.page-inner::-webkit-scrollbar-track { background: transparent; }
.page-inner::-webkit-scrollbar-thumb { background: var(--blue-slate-200); border-radius: 2px; }

/* ======================================
   EMBEDDED PDF PAGES
   ====================================== */
.pdf-page {
  padding: 0;
  background: #fff;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: calc(100% + 44px);
  margin-top: -44px;
  border: none;
}

/* Mobile preview image (replaces embed on touch devices) */
.pdf-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  display: block;
}

/* Loading spinner */
.pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.pdf-loading.loaded {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--blue-slate-100);
  border-top-color: var(--ocean-deep-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pdf-page .download-btn {
  z-index: 60;
}

/* ======================================
   INTRODUCTION / COVER PAGE
   ====================================== */
.intro-page {
  background: linear-gradient(180deg, #fff 0%, var(--blue-slate-50) 100%);
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 48px 36px;
  height: 100%;
}

.intro-photo-ring {
  width: 130px; height: 130px; border-radius: 50%; padding: 3px;
  background: linear-gradient(135deg, var(--ocean-deep-400), var(--ocean-deep-700), var(--harvest-orange-400));
}

.intro-photo-ring .photo-placeholder {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--blue-slate-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-slate-400);
}

.intro-photo-ring .photo-placeholder svg { width: 52px; height: 52px; }

.intro-name {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--blue-slate-900);
  letter-spacing: 0.02em;
}

.intro-divider { display: flex; gap: 6px; align-items: center; justify-content: center; }
.intro-divider span { display: block; height: 3px; border-radius: 2px; }
.intro-divider span:nth-child(1) { width: 48px; background: var(--ocean-deep-400); }
.intro-divider span:nth-child(2) { width: 24px; background: var(--ocean-deep-700); }
.intro-divider span:nth-child(3) { width: 12px; background: var(--harvest-orange-400); }

.intro-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocean-deep-700);
}

.intro-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.intro-contact .contact-pill {
  color: var(--blue-slate-700);
  background: rgba(0, 76, 151, 0.08);
  border-color: rgba(0, 76, 151, 0.15);
}

.intro-contact .pill-icon {
  color: var(--ocean-deep-600);
}

.intro-highlight {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ocean-deep-600);
  letter-spacing: 0.02em;
}

.intro-tagline {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blue-slate-500);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.intro-cta {
  margin-top: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ocean-deep-500);
  letter-spacing: 0.03em;
}

.intro-arrow {
  display: inline-block;
  animation: bounce-right 1.2s ease-in-out infinite;
  font-size: 1.1rem;
  vertical-align: middle;
  margin-right: 4px;
}

/* ======================================
   DOWNLOAD BUTTON (floating)
   ====================================== */
.download-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--ocean-deep-600);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 76, 151, 0.3);
}

.download-btn svg { width: 14px; height: 14px; }

.download-btn:hover {
  background: var(--ocean-deep-400);
  box-shadow: 0 2px 14px rgba(0, 158, 226, 0.4);
}

/* Document type label */
.doc-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ocean-deep-500);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ocean-deep-100);
}

/* --- Sidebar contact pills (reused) --- */
.contact-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; font-size: 0.72rem; font-weight: 500;
  color: var(--blue-slate-200);
  background: rgba(0, 53, 93, 0.5);
  border: 1px solid rgba(0, 76, 151, 0.15);
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

a.contact-pill:hover {
  background: rgba(0, 76, 151, 0.15);
  border-color: rgba(0, 76, 151, 0.3);
}

.pill-icon { color: var(--ocean-deep-400); }

/* ======================================
   DOCUMENT PAGES — faithfully styled
   ====================================== */
.doc-page { background: #fff; }

.doc-content {
  font-family: var(--font-doc);
  color: #1a1a1a;
  line-height: 1.5;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- Resume Document --- */
.doc-name-block {
  text-align: center;
  margin-bottom: 10px;
}

.resume-doc .doc-name-block h1 {
  font-family: var(--font-doc);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.doc-name-block p {
  font-size: 0.82rem;
  color: #444;
}

.doc-summary {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #333;
  margin-bottom: 8px;
}

.doc-divider {
  border: none;
  height: 1px;
  background: #999;
  margin: 8px 0;
}

.doc-section-heading {
  font-family: var(--font-doc);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.doc-row span { color: #333; }
.doc-row strong { color: #1a1a1a; font-weight: 700; }

.doc-sub {
  font-size: 0.76rem;
  color: #555;
  padding-left: 20px;
  margin-bottom: 2px;
}

.doc-role {
  font-size: 0.8rem;
  font-weight: 400;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

/* Clinical block */
.clinical-block h3 {
  font-family: var(--font-doc);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 8px;
  margin-bottom: 4px;
}

.clinical-block ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 4px;
}

.clinical-block li {
  font-size: 0.8rem;
  margin-bottom: 2px;
}

/* Skills columns */
.skills-columns {
  display: flex;
  gap: 24px;
}

.skills-columns ul {
  flex: 1;
  list-style: disc;
  padding-left: 18px;
}

.skills-columns li {
  font-size: 0.78rem;
  color: #333;
  margin-bottom: 2px;
}

/* Doc bullets (work experience) */
.doc-bullets {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 4px;
}

.doc-bullets li {
  font-size: 0.8rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 2px;
}

/* --- Cover Letter Document --- */
.letter-doc .doc-name-block h1 {
  font-family: var(--font-doc);
  font-size: 1.3rem;
  font-weight: 400;
  color: #1a1a1a;
}

.letter-meta {
  font-size: 0.82rem;
  color: #333;
  margin-bottom: 14px;
  line-height: 1.5;
}

.letter-greeting {
  font-size: 0.85rem;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.letter-body {
  flex: 1;
}

.letter-body p {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 10px;
  text-align: justify;
}

.letter-sign {
  margin-top: 16px;
}

.letter-sign p {
  font-size: 0.85rem;
  color: #333;
}

.letter-signature {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #1a1a1a;
  margin-top: 6px;
}

/* --- Recommendation Documents --- */
.rec-from {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #333;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.rec-from strong {
  font-size: 0.9rem;
  color: #1a1a1a;
}

.rec-date {
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 10px;
}

.rec-salutation {
  font-size: 0.85rem;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.rec-body {
  flex: 1;
}

.rec-body p {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 10px;
  text-align: justify;
}

.rec-sign {
  margin-top: 16px;
}

.rec-sign p {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.4;
}

.rec-signature {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #1a1a1a;
  margin: 4px 0;
}

.rec-title {
  font-size: 0.82rem;
  font-style: italic;
  color: #444;
}

.rec-org {
  font-size: 0.8rem;
  color: #555;
  margin-top: 2px;
}

.rec-contact {
  font-size: 0.76rem;
  color: #666;
  margin-top: 6px;
}

/* ======================================
   ZOOM CONTROLS (button + font slider)
   ====================================== */
.zoom-controls {
  position: fixed;
  bottom: 14px;
  right: 20px;
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(0, 76, 151, 0.25);
  background: rgba(0, 29, 53, 0.9);
  backdrop-filter: blur(8px);
  color: var(--blue-slate-200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.zoom-btn svg {
  width: 20px;
  height: 20px;
}

.zoom-btn:hover {
  background: var(--ocean-deep-400);
  color: #fff;
  border-color: var(--ocean-deep-400);
  box-shadow: 0 4px 28px rgba(0, 158, 226, 0.5);
}

/* Show zoom-in icon by default, hide zoom-out */
.zoom-icon-out { display: none; }
body.zoomed .zoom-icon-in { display: none; }
body.zoomed .zoom-icon-out { display: block; }

/* --- Font-size slider (visible only in zoom mode) --- */
.font-slider {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(0, 29, 53, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 76, 151, 0.25);
  border-radius: 24px;
  padding: 6px 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.zoomed .font-slider {
  display: flex;
}

.font-slider-label {
  color: var(--blue-slate-300);
  font-family: var(--font-doc);
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.font-slider-label--lg {
  font-size: 1.1rem;
}

.font-slider-value {
  color: var(--ocean-deep-300);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 26px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* Range input — custom track & thumb */
#fontRange {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: #003d78;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#fontRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ocean-deep-400);
  border: 2px solid var(--blue-slate-200);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: background 0.15s ease;
}

#fontRange::-webkit-slider-thumb:hover {
  background: var(--ocean-deep-400);
}

#fontRange::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ocean-deep-400);
  border: 2px solid var(--blue-slate-200);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

#fontRange::-moz-range-thumb:hover {
  background: var(--ocean-deep-400);
}

/* ======================================
   ZOOMED STATE
   ====================================== */
body.zoomed .topnav {
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.topnav {
  transition: transform 0.4s ease;
}

body.zoomed .book-wrapper {
  margin-top: 0;
  height: 100vh;
  transition: margin-top 0.4s ease, height 0.4s ease;
}

.book-wrapper {
  transition: margin-top 0.4s ease, height 0.4s ease;
}

body.zoomed {
  --page-width: min(960px, calc(100vw - 80px));
  --page-height: min(94vh, 960px);
}

/* Zoom mode → revert to single page view */
body.zoomed .book {
  display: block;
  width: var(--page-width);
}

body.zoomed .book::after { display: none; }

body.zoomed .page {
  cursor: default;
  position: absolute;
  border-radius: 10px;
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.15);
}

body.zoomed .page.spread-left,
body.zoomed .page.spread-right {
  border-radius: 10px;
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.15);
}

body.zoomed .page::after {
  display: block;
  width: 50px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.035) 0%, transparent 100%);
}

/* Document zoom — applied by slider via --doc-zoom custom property.
   Uses CSS zoom so all rem-based children scale proportionally. */
body.zoomed .doc-content {
  zoom: var(--doc-zoom, 1);
}

/* ======================================
   NAV HINT (reused)
   ====================================== */
.nav-hint {
  position: fixed; top: 54px; left: 50%;
  transform: translateX(-50%);
  background: var(--harvest-orange-500); color: #fff;
  padding: 6px 18px; border-radius: 16px;
  font-size: 0.75rem; font-weight: 600; z-index: 100;
  opacity: 1; transition: opacity 0.6s ease; pointer-events: none;
}

.nav-hint.hidden { opacity: 0; }
.nav-hint-icon { display: inline-block; margin-right: 4px; animation: bounce-right 1.2s ease-in-out infinite; }

@keyframes bounce-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-height: 860px) {
  :root { --page-height: min(88vh, 780px); }
}

@media (max-width: 960px) {
  :root {
    --topnav-height: 48px;
    --page-width: calc(100vw - 16px);
    --page-height: calc(100vh - 68px);
  }

  .topnav { padding: 0 12px; gap: 10px; }
  .topnav-brand { font-size: 1rem; }
  .tab { font-size: 0.65rem; padding: 6px 10px; }

  .page-inner { padding: 24px 24px; }

  .arrow { width: 40px; height: 40px; font-size: 1.4rem; }
  .arrow-left { left: 4px; }
  .arrow-right { right: 4px; }

  .skills-columns { flex-direction: column; gap: 4px; }

  .zoom-controls { display: none; }

  .intro-name { font-size: 2rem; }
  .intro-photo-ring { width: 100px; height: 100px; }
}

@media (max-width: 480px) {
  .page-inner { padding: 18px 18px; }
  .topnav-brand { display: none; }
  .intro-name { font-size: 1.6rem; }
}

/* --- Print --- */
@media print {
  body { background: #fff; }
  .topnav, .page-counter, .arrow, .download-btn, .nav-hint, .zoom-controls { display: none !important; }
  .book-wrapper { perspective: none; padding: 0; }
  .book { width: auto; height: auto; position: static; }
  .page {
    position: static; transform: none !important;
    box-shadow: none; border-radius: 0;
    page-break-after: always; width: 100%; height: auto;
  }
  .page::after { display: none; }
  .page-inner { overflow: visible; }
}
