/* =========================================================
   SAMSON THROUGH THE YEARS
   Portfolio-matched baseline
   ========================================================= */

:root {
  /* Exact existing site colors */
  --page-bg: #E8DDC5;
  --surface: #F3E9D7;
  --charcoal: #4F4F4F;
  --yellow: #EDB33B;

  /* Exact Carrd page grid color */
  --grid-color: #4F4F4F15;

  /* Shelf */
  --shelf: #6A584A;
  --shelf-dark: #4F4238;

  /* Existing animation-gallery component language */
  --border: 3px solid var(--charcoal);
  --shadow-none: 0 0 0 var(--charcoal);
  --shadow-small: .20rem .20rem 0 var(--charcoal);
  --shadow-card: .26rem .26rem 0 var(--charcoal);
  --shadow-hover: .30rem .30rem 0 var(--charcoal);
  --shadow-modal: 8px 8px 0 var(--charcoal);

  /* Books */
  --book-width: 64px;
  --book-height: 226px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;

  color: var(--charcoal);
  background-color: var(--page-bg);
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 24px 24px;

  font-family: "Space Mono", monospace;
  font-weight: 400;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   PAGE / MAIN CONTAINER
   ========================================================= */

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(30px, 4vw, 64px);
}

.archive-card {
  width: min(1280px, calc(100vw - 56px));
  min-height: 660px;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: var(--surface);
  border: var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-modal);
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  flex: 0 0 auto;
  min-height: 74px;

  display: flex;
  align-items: center;

  padding: 18px 30px;
  border-bottom: 2px solid #4F4F4F20;
}

.site-header h1 {
  margin: 0;

  color: var(--charcoal);
  font-family: "Unbounded", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

/* =========================================================
   SELECTED YEAR / HERO
   ========================================================= */

.feature {
  flex: 0 0 auto;

  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;

  padding: 34px 20px 20px;
  text-align: center;
}

.feature-year {
  color: var(--charcoal);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(44px, 4.2vw, 62px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
}

.feature-calendar {
  margin-top: 10px;

  color: var(--charcoal);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.feature-calendar::after {
  content: "";
  display: block;

  width: 34px;
  height: 3px;
  margin: 10px auto 0;

  border-radius: 99px;
  background: var(--yellow);
}

/* =========================================================
   PLAY BUTTON

   Directly mirrors the animation-gallery modal reel button:
   55–65.333px square, 2px border, 12–14px radius,
   4px hard shadow + inset highlight, 1px hover lift,
   2px pressed state.
   ========================================================= */

.watch-button {
  box-sizing: border-box;

  width: clamp(55px, 6.2vw, 65.333px);
  height: clamp(55px, 6.2vw, 65.333px);
  min-height: clamp(55px, 6.2vw, 65.333px);
  padding: 0;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--charcoal);
  -webkit-text-fill-color: var(--charcoal);
  background: var(--surface);

  border: 2px solid var(--charcoal);
  border-radius: clamp(12px, 1.3vw, 14px);

  box-shadow:
    4px 4px 0 var(--charcoal),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);

  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;

  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    transform 0.10s ease-out,
    box-shadow 0.10s ease-out;
}

.watch-icon {
  display: block;
  width: clamp(32px, 3.5vw, 36.8px);
  height: clamp(32px, 3.5vw, 36.8px);
  fill: currentColor;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .watch-button:hover,
  .watch-button:focus-visible {
    outline: none;
    background: var(--surface);
    color: var(--charcoal);
    -webkit-text-fill-color: var(--charcoal);
    transform: translate(-1px, -1px);
    box-shadow:
      5px 5px 0 var(--charcoal),
      inset 0 1px 0 rgba(255, 255, 255, 0.30);
  }
}

.watch-button:active {
  background: var(--surface);
  color: var(--charcoal);
  -webkit-text-fill-color: var(--charcoal);
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 1px 0 rgba(79, 79, 79, 0.14);
}

/* =========================================================
   BOOKSHELF
   ========================================================= */

.shelf-region {
  flex: 1 1 auto;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  min-height: 340px;
  padding: 0 48px 36px;
}

.shelf-scroll {
  position: relative;

  overflow-x: auto;
  overflow-y: visible;

  padding: 24px 8px 28px;

  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.shelf-scroll::-webkit-scrollbar {
  display: none;
}

.book-row {
  position: relative;
  z-index: 2;

  width: max-content;
  min-width: 100%;

  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;

  padding: 0 54px;
}

/* =========================================================
   BOOK
   ========================================================= */

.book {
  position: relative;

  flex: 0 0 var(--book-width);
  width: var(--book-width);
  height: var(--book-height);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  color: var(--charcoal);

  background:
    linear-gradient(
      90deg,
      #4F4F4F10 0%,
      #FFFFFF30 9%,
      #FFFFFF10 50%,
      #4F4F4F0C 100%
    ),
    var(--surface);

  border: 2px solid #4F4F4F78;
  border-radius: 8px 8px 4px 4px;

  box-shadow:
    inset 2px 0 0 #FFFFFF38,
    inset -2px 0 0 #4F4F4F0A;

  cursor: pointer;
  scroll-snap-align: start;

  transition:
    transform 0.18s ease-out,
    background-color 0.18s ease-out,
    border-color 0.18s ease-out,
    box-shadow 0.18s ease-out;
}

.book::before,
.book::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 5px;

  border-top: 1px solid #4F4F4F20;
  border-bottom: 1px solid #4F4F4F10;
}

.book::before {
  top: 8px;
}

.book::after {
  bottom: 8px;
}

.book-groove {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 1px;

  background: currentColor;
  opacity: .06;
}

.book-groove-top {
  top: 21px;
}

.book-groove-bottom {
  bottom: 21px;
}

.book-label,
.book-calendar {
  font-family: "Space Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .035em;
}

.book-number {
  margin: 12px 0 10px;

  font-family: "Space Mono", monospace;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.06em;
}

.book-rule {
  width: 18px;
  height: 1px;
  margin-bottom: 10px;

  background: currentColor;
  opacity: .48;
}

@media (hover: hover) and (pointer: fine) {
  .book:not(.is-selected):hover {
    transform: translateY(-4px);
  }
}

.book.is-selected {
  z-index: 4;

  color: var(--charcoal);

  background:
    linear-gradient(
      90deg,
      #4F4F4F12 0%,
      #FFFFFF22 9%,
      #FFFFFF08 55%,
      #4F4F4F0E 100%
    ),
    var(--yellow);

  border: var(--border);
  box-shadow: var(--shadow-small);
  transform: translateY(-7px) scale(1.02);
}

.book:focus-visible {
  outline: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Penguin intentionally parked until the final asset is right. */
.penguin-emboss {
  display: none;
}

/* =========================================================
   SHELF
   ========================================================= */

.shelf {
  position: relative;
  z-index: 3;

  height: 18px;
  margin-top: -2px;

  background: var(--shelf);
  border: 3px solid var(--shelf-dark);
  border-radius: 5px;
  box-shadow: .26rem .26rem 0 var(--charcoal);
}

/* =========================================================
   MOBILE SWIPE HINT
   ========================================================= */

.swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 20px;

  margin-top: 8px;

  color: var(--charcoal);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* =========================================================
   VIDEO MODAL PLACEHOLDER
   ========================================================= */

body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, .33);
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.modal-panel {
  position: relative;
  z-index: 1;

  width: min(980px, 94vw);

  background: var(--surface);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);

  opacity: 0;
  transform: translateY(16px) scale(.985);

  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal.is-open .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-topbar {
  min-height: 58px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 12px 14px 12px 18px;
  border-bottom: 2px solid #4F4F4F20;

  font-size: 12px;
  letter-spacing: .05em;
}

.modal-dot {
  color: var(--yellow);
  padding-inline: 6px;
}

.modal-close {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;
  padding: 0;

  color: var(--charcoal);
  background: var(--surface);

  border: var(--border);
  border-radius: .5rem;
  box-shadow: var(--shadow-small);

  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:focus-visible {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hover);
}

.video-placeholder {
  position: relative;

  aspect-ratio: 16 / 9;
  margin: 14px;

  display: grid;
  place-items: center;
  overflow: hidden;

  color: var(--surface);
  background: var(--charcoal);
  border-radius: 12px;
}

.placeholder-play {
  color: var(--yellow);
  font-size: clamp(42px, 6vw, 72px);
}

.placeholder-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  justify-content: space-between;
  gap: 20px;

  padding: 14px 16px;
  background: rgba(0, 0, 0, .24);

  font-size: 10px;
  letter-spacing: .06em;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {
  :root {
    --book-width: 64px;
    --book-height: 220px;
  }

  .page-shell {
    padding: 24px;
  }

  .archive-card {
    width: min(940px, calc(100vw - 48px));
    min-height: 620px;
  }

  .shelf-region {
    padding: 0 30px 30px;
  }

  .shelf-scroll {
    margin-inline: -30px;
    padding-inline: 30px;
    scroll-padding-inline: 30px;
  }

  .book-row {
    min-width: max-content;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .shelf {
    min-width: calc(12 * var(--book-width) + 11 * 6px + 72px);
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {
  :root {
    --book-width: 78px;
    --book-height: 220px;
  }

  .page-shell {
    min-height: 100svh;
    display: block;
    padding: 12px;
  }

  .archive-card {
    width: 100%;
    min-height: calc(100svh - 24px);
    border-radius: 16px;
    box-shadow: .20rem .20rem 0 var(--charcoal);
  }

  .site-header {
    min-height: 64px;
    padding: 15px 18px;
  }

  .site-header h1 {
    font-size: 21px;
  }

  .feature {
    gap: 16px;
    padding: 30px 18px 22px;
  }

  .feature-year {
    font-size: clamp(44px, 13vw, 58px);
  }

  .feature-calendar {
    font-size: 13px;
  }

  .shelf-region {
    min-height: 300px;
    padding: 0 0 18px;
  }

  .shelf-scroll {
    margin: 0;
    padding: 22px 18px 26px;
    scroll-padding-inline: 18px;
  }

  .book-row {
    min-width: max-content;
    justify-content: flex-start;
    gap: 5px;
    padding: 0 4px;
  }

  .book-number {
    font-size: 30px;
  }

  .book-label,
  .book-calendar {
    font-size: 9px;
  }

  .book.is-selected {
    transform: translateY(-7px) scale(1.02);
  }

  .shelf {
    min-width: calc(12 * var(--book-width) + 11 * 5px + 34px);
    height: 17px;
  }

  .swipe-hint {
    display: flex;
  }

  .modal {
    align-items: end;
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
    border-radius: 16px;
    box-shadow: .20rem .20rem 0 var(--charcoal);
  }

  .modal-topbar {
    min-height: 54px;
    padding: 9px 10px 9px 14px;
    font-size: 11px;
  }

  .video-placeholder {
    margin: 10px;
    border-radius: 10px;
  }

  .placeholder-copy {
    padding: 11px 12px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
