/* Core – Personal Site (HTML/CSS/JS replica) */

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@latest/files/geist-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --text: #7e7e7e;
  --text-muted: #7e7e7e;
  --text-prominent: #121212;
  --border: #e7e5e4;
  --font: "Inter", system-ui, sans-serif;
  --font-header: "Geist Mono", var(--font);
  --space: 1.5rem;
  --max-width: 720px;
  --polaroid-bg: #fafaf9;
  --polaroid-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Dark mode (system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --text: #8f8f8f;
    --text-muted: #8f8f8f;
    --text-prominent: #ffffff;
    --border: #2a2a2a;
    --polaroid-bg: #1c1917;
    --polaroid-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.4);
  }
}

/* Dark mode (manual override) */
.dark-mode {
  --bg: #0d0d0d;
  --text: #8f8f8f;
  --text-muted: #8f8f8f;
  --text-prominent: #ffffff;
  --border: #2a2a2a;
  --polaroid-bg: #1c1917;
  --polaroid-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Light mode override */
.light-mode {
  --bg: #ffffff;
  --text: #7e7e7e;
  --text-muted: #7e7e7e;
  --text-prominent: #121212;
  --border: #e7e5e4;
  --polaroid-bg: #fafaf9;
  --polaroid-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Top bar */
.top-bar {
  font-family: var(--font-header);
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space) 1.5rem;
  border-bottom: 1px solid var(--border);
}

.top-bar .logo {
  color: var(--text);
  text-decoration: none;
}

.top-bar .logo:hover {
  text-decoration: underline;
}

.top-bar .nav-link {
  color: var(--text);
  text-decoration: none;
}

.top-bar .nav-link:hover {
  color: var(--text-prominent);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Hero */
.hero {
  margin-bottom: 2.5rem;
}

.hero-profile {
  color: var(--text);
  padding: 0 0 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  max-width: 100%;
}

.hero-profile-photo-link {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.hero-profile-photo-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  transform: scale(1) rotate(0deg);
  transform-origin: center;
  transition: transform 450ms cubic-bezier(0.22, 1.4, 0.36, 1);
}

.hero-profile-photo-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.hero-profile-photo {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.hero-profile-photo-link:hover {
  cursor: pointer;
}

.hero-profile-photo-link:hover .hero-profile-photo-wrap {
  transform: scale(2) rotate(-5deg);
}

/* Tooltip */
.hero-profile-tooltip {
  position: fixed;
  pointer-events: none;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: rgba(0, 0, 0, 0.75);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .hero-profile-tooltip {
  background: rgba(30, 30, 30, 0.95);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-profile-tooltip.visible {
  opacity: 1;
}

/* Falling cards – polaroid style */
.falling-cards-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  perspective: 1000px;
  overflow: hidden;
}

.falling-card {
  position: absolute;
  width: 200px;
  padding: 10px 10px 18px;
  background: var(--polaroid-bg);
  border: none;
  border-radius: 2px;
  box-shadow: var(--polaroid-shadow);
  pointer-events: auto;
  opacity: 0;
  transform-origin: center;
  cursor: grab;
  user-select: none;
}

.falling-card:active {
  cursor: grabbing;
}

.falling-card.visible {
  opacity: 1;
}

.falling-card--no-frame {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.falling-card--no-frame img {
  margin-bottom: 0;
  filter: none;
}

.falling-card img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
  border-radius: 1px;
}

.falling-card-caption {
  font-family: "Caveat", cursive;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-prominent);
  opacity: 0.6;
  margin: 0;
  line-height: 1.1;
  padding: 0 2px;
  text-align: center;
}

/* Drop in from left or right of viewport (via --start-x); land at --land-y with --land-rotation. */
@keyframes drop-in {
  0% {
    transform: translate(var(--start-x, 0), -120%);
  }

  100% {
    transform: translate(0, var(--land-y, 36vh)) rotate(var(--land-rotation, 0deg));
  }
}

/* Trash can (shown when cards exist; right side, bottom of viewport) */
.trash-can {
  position: fixed;
  right: 2rem;
  bottom: 2.5rem;
  width: 52px;
  height: 64px;
  z-index: 1001;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--text);
  overflow: visible;
}

.trash-can.visible {
  opacity: 1;
}

.trash-can-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trash-can-lid {
  transform-origin: 48px 21px;
  transition: transform 0.25s ease;
}

.trash-can:hover .trash-can-lid {
  transform: rotate(55deg);
}

.trash-can.trash-closing .trash-can-lid {
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

/* Cards flying into trash (animated via JS requestAnimationFrame) */
.falling-card.fly-into-trash {
  pointer-events: none;
  z-index: 1002;
  transform-origin: center center;
}

.hero-profile-status {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid var(--bg);
  box-sizing: border-box;
  z-index: 1;
}

.hero-profile-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  color: var(--text-prominent);
}

.hero-profile-badge {
  flex-shrink: 0;
  vertical-align: middle;
}

.hero-profile-role {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.hero-intro {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 400;
  margin: 0 0 1.5rem;
}

.hero-intro a {
  color: var(--text-prominent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.hero-intro a:hover {
  text-decoration: none;
}

.hero-intro-location {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.copy-hint {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.copy-hint kbd {
  display: inline-block;
  padding: 0.15em 0.4em;
  font-family: var(--font);
  font-size: 0.85em;
  background: var(--border);
  border-radius: 4px;
}

/* Sections */
.section {
  margin-bottom: 4rem;
}

.section-label {
  font-family: var(--font-header);
  font-size: 12px;
  font-weight: 400;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
}

.section-desc {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 2rem;
  max-width: 42ch;
}

/* Work section – draggable cards */
.work-section {
  position: relative;
}

.work-cards-container {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 200px;
  margin: 0 auto;
}

.work-card {
  position: absolute;
  width: 340px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s ease;
}

.work-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 11px 11px 0 0;
  pointer-events: none;
  vertical-align: middle;
}

.work-card-expand-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 6px;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.2s ease;
}

.work-card-expand-icon:hover {
  background: rgba(0, 0, 0, 0.6);
}

.work-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.work-card:active {
  cursor: grabbing;
}

.work-card--rotate-cw {
  transform: rotate(2deg);
}

.work-card--rotate-ccw {
  transform: rotate(-2deg);
}

/* Work modal (expand on click) */
.work-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.work-modal[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.work-modal[data-open="true"] .work-modal-panel {
  transform: scale(1);
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.work-modal-panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.work-modal-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}

.work-modal-gallery {
  flex: 0 0 44%;
  min-width: 0;
  padding: 1rem 0 1rem 1rem;
  border-radius: 12px 0 0 12px;
}

.work-modal-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.work-modal-scroll::-webkit-scrollbar {
  display: none;
}

.work-modal-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: var(--bg);
}

.work-modal-body {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 2rem;
}

@media (max-width: 640px) {
  .work-modal-panel {
    max-width: 100%;
  }

  .work-modal-layout {
    flex-direction: column;
  }

  .work-modal-gallery {
    flex: none;
    padding: 1rem 1rem 0;
    border-radius: 12px 12px 0 0;
  }

  .work-modal-image {
    max-height: 40vh;
    object-fit: contain;
  }

  .work-modal-body {
    padding: 1.25rem 1.5rem 2rem;
  }
}

.work-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  z-index: 1;
}

.dark-mode .work-modal-close,
.work-modal-panel .work-modal-close {
  background: rgba(255, 255, 255, 0.08);
}

.work-modal-close:hover {
  color: var(--text-prominent);
  background: var(--border);
}

.work-modal-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-prominent);
  margin: 0 2.5rem 0 0;
  padding-right: 0.5rem;
}

.work-modal-title-wrap {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 2.5rem 0 0;
  padding-right: 0.5rem;
}

.work-modal-title-link {
  color: var(--text-prominent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.work-modal-title-link:hover {
  text-decoration: underline;
}

.work-modal-external-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.85;
}

.work-modal-title-link:hover .work-modal-external-icon {
  color: var(--text-prominent);
}

#work-modal-title-fallback {
  color: var(--text-prominent);
}

.work-modal-meta {
  display: grid;
  gap: 0.5rem 1rem;
  margin: 1rem 0 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.work-modal-meta-row {
  display: flex;
  gap: 0.5rem;
}

.work-modal-meta dt {
  margin: 0;
  font-weight: 500;
  color: var(--text-prominent);
  min-width: 4.5rem;
}

.work-modal-meta dd {
  margin: 0;
  color: var(--text);
}

.work-modal-section {
  margin-bottom: 1.25rem;
}

.work-modal-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.work-modal-details {
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}

.work-modal-outcomes-wrap {
  margin-bottom: 1.5rem;
}

.work-modal-outcomes {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}

.work-modal-outcomes li {
  margin-bottom: 0.35rem;
}

.work-modal-outcomes li:last-child {
  margin-bottom: 0;
}

/* Experience timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date {
  font-family: var(--font-header);
  font-size: 12px;
  color: var(--text);
}

.timeline-content {
  font-size: 16px;
}

.timeline-content strong {
  font-weight: 600;
  color: var(--text-prominent);
}

.timeline-content p {
  margin: 0.5rem 0 0;
  color: var(--text);
}

@media (max-width: 480px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Certifications */
.cert-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cert-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  color: var(--text);
}

.cert-list li strong {
  color: var(--text-prominent);
}

.cert-list li:last-child {
  border-bottom: 0;
}

.cert-date {
  display: block;
  font-size: 16px;
  color: var(--text);
  font-weight: 400;
  margin-top: 0.25rem;
}

.cert-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 16px;
  color: var(--text-prominent);
  text-decoration: underline;
}

.cert-link:hover {
  text-decoration: none;
}

/* Skills */
.skills-tags {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

/* Toolbelt */
#toolbelt .section-label {
  color: var(--text);
}

.toolbelt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin: 0.5rem 0 0;
  list-style: none;
  padding: 0;
}

.toolbelt-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-prominent);
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toolbelt-item:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.toolbelt-item::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  padding: 0.35rem 0.6rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text-prominent);
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toolbelt-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(8px);
}

.toolbelt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.toolbelt-icon svg,
.toolbelt-icon .toolbelt-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Cursor & GitHub: light/dark variants from SVGL */
.toolbelt-icon--dual {
  position: relative;
}

.toolbelt-icon--dual .toolbelt-img--dark {
  display: none;
}

.toolbelt-icon--dual .toolbelt-img--light {
  display: block;
}

.dark-mode .toolbelt-icon--dual .toolbelt-img--dark {
  display: block;
}

.dark-mode .toolbelt-icon--dual .toolbelt-img--light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  body:not(.light-mode) .toolbelt-icon--dual .toolbelt-img--dark {
    display: block;
  }

  body:not(.light-mode) .toolbelt-icon--dual .toolbelt-img--light {
    display: none;
  }
}

/* Cursor & GitHub: separate SVGs — black (light mode), white (dark mode). No filters. */

/* Writing */
.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.writing-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-list a {
  font-size: 16px;
  color: var(--text-prominent);
  text-decoration: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.writing-list a:hover {
  text-decoration: underline;
}

.writing-list a span {
  font-size: 16px;
  color: var(--text);
}

/* Personal */
.personal-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.music-card {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.music-title {
  font-family: var(--font);
  font-size: 16px;
  margin: 0 0 0.25rem;
}

.music-artist,
.music-meta {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.music-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 16px;
  color: var(--text);
  text-decoration: underline;
}

.music-link:hover {
  text-decoration: none;
}

.photos-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.photo-placeholder {
  aspect-ratio: 1;
  background: var(--border);
  border-radius: 6px;
}

.photo-caption {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.ig-link {
  font-size: 16px;
  color: var(--text);
  text-decoration: underline;
}

.ig-link:hover {
  text-decoration: none;
}

@media (max-width: 560px) {
  .photos-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Bookshelf */
.book-wrapper {
  width: 100%;
  max-width: 900px;
  position: relative;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 12px 4px;
  perspective: 1400px;
}

.book-items {
  position: relative;
  cursor: default;
  padding: 8px;
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
}

.main-book-wrap {
  position: relative;
}

.book-cover {
  position: relative;
}

.book-cover .book-inside {
  position: absolute;
  width: 90%;
  height: 96%;
  top: 1%;
  left: 16px;
  border: 1px solid var(--border);
  border-radius: 2px 6px 6px 2px;
  background: var(--bg);
  box-shadow:
    10px 40px 40px -10px rgba(0, 0, 0, 0.2),
    inset -2px 0 0 var(--border),
    inset -3px 0 0 #dbdbdb,
    inset -4px 0 0 var(--bg),
    inset -5px 0 0 #dbdbdb,
    inset -6px 0 0 var(--bg),
    inset -7px 0 0 #dbdbdb,
    inset -8px 0 0 var(--bg),
    inset -9px 0 0 #dbdbdb;
}

.book-cover .book-image {
  line-height: 0;
  position: relative;
  border-radius: 2px 6px 6px 2px;
  box-shadow:
    6px 6px 12px -1px rgba(0, 0, 0, 0.1),
    20px 14px 16px -6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  transform: perspective(1200px) rotateY(0deg) translateX(0) scaleX(1);
  cursor: pointer;
}

.book-image img {
  grid-row: 1 / -1;
  grid-column: 1;
  width: 100%;
  border-radius: 2px 6px 6px 2px;
  display: block;
}

.book-image:hover {
  transform: perspective(1200px) rotateY(-8deg) translateX(0) scaleX(0.96);
  transform-style: preserve-3d;
  box-shadow:
    6px 6px 18px -2px rgba(0, 0, 0, 0.2),
    24px 28px 40px -6px rgba(0, 0, 0, 0.1);
}

.book-image .effect {
  position: absolute;
  width: 20px;
  height: 100%;
  margin-left: 6px;
  top: 0;
  left: 0;
  border-left: 2px solid rgba(0, 0, 0, 0.06);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: all 0.5s ease;
  z-index: 5;
}

.book-image .light {
  width: 90%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 3px;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 100%
  );
  opacity: 0.1;
  transition: all 0.5s ease;
  z-index: 4;
}

.book-image:hover .effect {
  margin-left: 7px;
}

/* Contact */
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-links li {
  padding: 0.5rem 0;
  font-size: 16px;
}

.contact-links a {
  color: var(--text-prominent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-links a:hover {
  text-decoration: none;
}

/* Footer */
.footer {
  padding: 2rem 1.5rem;
  font-size: 16px;
  color: var(--text);
  text-align: center;
}

.footer p {
  margin: 0.5rem 0;
}

.footer a {
  color: var(--text);
  text-decoration: underline;
}

.footer a:hover {
  color: var(--text-prominent);
}

.footer .sep {
  margin: 0 0.25rem;
}

.footer-book-hint {
  position: relative;
  cursor: help;
}

.footer-book-hint a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-book-hint:hover {
  color: var(--text-prominent);
}

.footer-book-byline {
  margin-left: 0.25em;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.footer-book-hint:hover .footer-book-byline {
  opacity: 1;
}

.footer-book-tooltip {
  position: absolute;
  left: 100%;
  bottom: 0;
  margin-left: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
  height: 210px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.footer-book-hint:hover .footer-book-tooltip {
  opacity: 1;
  visibility: visible;
}

.footer-book-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  background: var(--text-prominent);
  color: var(--bg);
  border-radius: 8px;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
}

.toast[data-visible="true"] {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Shortcuts panel (bottom left) */
.shortcuts-panel {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  text-align: left;
}

.shortcut-item:hover {
  color: var(--text-prominent);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #f5f5f5;
  color: #7e7e7e;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.1s ease, box-shadow 0.1s ease, color 0.15s ease;
}

.shortcut-item:hover .shortcut-key {
  color: #121212;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 3px 6px rgba(0, 0, 0, 0.05);
}

.shortcut-item:active .shortcut-key,
.shortcut-item .shortcut-key.key-pressed {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.04);
}

.shortcut-item[aria-pressed="true"] .shortcut-label {
  color: var(--text-prominent);
}

.dark-mode .shortcut-item[aria-pressed="true"] .shortcut-label {
  color: var(--text);
}

.dark-mode .shortcut-item[aria-pressed="true"]:hover .shortcut-label {
  color: var(--text-prominent);
}

.shortcut-item[aria-pressed="true"] .shortcut-key {
  color: #121212;
}

/* Dim Lights: keep key same as other keys when active (no visual change for D) */
#shortcut-dim[aria-pressed="true"] .shortcut-key {
  color: #7e7e7e;
}

.dark-mode #shortcut-dim[aria-pressed="true"] .shortcut-key {
  color: #8f8f8f;
}

.shortcut-label {
  flex: 1;
}

/* Annotations overlay */
.annotations-overlay {
  position: fixed;
  inset: 0;
  z-index: 855;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.annotations-overlay[data-active="true"] {
  opacity: 1;
}

.annotation-item {
  position: absolute;
  z-index: 1;
}

.annotation-left {
  left: 4.5rem;
  max-width: 200px;
}

.annotation-right {
  right: 4.5rem;
  max-width: 200px;
}

.annotation-box {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
}

/* Option A: Minimal / soft — annotations 1 & 4 */
.annotation-option-a .annotation-box {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark-mode .annotation-option-a .annotation-box {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Option B: Card / elevated — annotation 2 */
.annotation-option-b .annotation-box {
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.dark-mode .annotation-option-b .annotation-box {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Option C: Flat / graphic — annotation 3 */
.annotation-option-c .annotation-box {
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
}

.dark-mode .annotation-option-c .annotation-box {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

/* Option D: Solid (mockup) — all solid fill, no border; line & dot same color */
.annotation-option-d .annotation-box {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.85rem;
}

.annotation-option-d .annotation-text {
  color: #fff;
}

#annotation-1.annotation-option-d .annotation-box {
  background: #14AE5C;
}

#annotation-2.annotation-option-d .annotation-box {
  background: #0D99FF;
}

#annotation-3.annotation-option-d .annotation-box {
  background: #FF24BD;
}

#annotation-4.annotation-option-d .annotation-box {
  background: #FC9E24;
}

.dark-mode .annotation-option-d .annotation-box {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Pastel colors per annotation (Figma-style) — used when not option-d */
#annotation-1 .annotation-box {
  background: #fff9e6;
  border-color: #f5e6b8;
}

#annotation-2 .annotation-box {
  background: #ffe8f0;
  border-color: #f5c6d6;
}

#annotation-3 .annotation-box {
  background: #e6f4ff;
  border-color: #b8daf5;
}

#annotation-4 .annotation-box {
  background: #e8f5e9;
  border-color: #c5e1c6;
}

.dark-mode .annotation-box {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
}

.dark-mode #annotation-1 .annotation-box {
  background: #2b2414;
  border-color: #f5e6b8;
}

.dark-mode #annotation-2 .annotation-box {
  background: #2b1822;
  border-color: #f5c6d6;
}

.dark-mode #annotation-3 .annotation-box {
  background: #141f2b;
  border-color: #b8daf5;
}

.dark-mode #annotation-4 .annotation-box {
  background: #14231a;
  border-color: #c5e1c6;
}

.annotation-text {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-prominent);
  margin: 0;
  line-height: 1.4;
}

.annotations-lines-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.annotation-line {
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
  fill: none;
}

.annotation-line--1 {
  stroke: rgba(20, 174, 92, 0.55);
}

.annotation-line--2 {
  stroke: rgba(13, 153, 255, 0.55);
}

.annotation-line--3 {
  stroke: rgba(255, 36, 189, 0.55);
}

.annotation-line--4 {
  stroke: rgba(252, 158, 36, 0.55);
}

.annotation-dot {
  stroke: none;
}

/* Line and dot same color per annotation (lighter tint of solid) */
.annotation-dot--1 {
  fill: rgba(20, 174, 92, 0.55);
}

.annotation-dot--2 {
  fill: rgba(13, 153, 255, 0.55);
}

.annotation-dot--3 {
  fill: rgba(255, 36, 189, 0.55);
}

.annotation-dot--4 {
  fill: rgba(252, 158, 36, 0.55);
}

.dark-mode .annotation-line--1 {
  stroke: rgba(20, 174, 92, 0.5);
}

.dark-mode .annotation-line--2 {
  stroke: rgba(13, 153, 255, 0.5);
}

.dark-mode .annotation-line--3 {
  stroke: rgba(255, 36, 189, 0.5);
}

.dark-mode .annotation-line--4 {
  stroke: rgba(252, 158, 36, 0.5);
}

.dark-mode .annotation-dot--1 {
  fill: rgba(20, 174, 92, 0.5);
}

.dark-mode .annotation-dot--2 {
  fill: rgba(13, 153, 255, 0.5);
}

.dark-mode .annotation-dot--3 {
  fill: rgba(255, 36, 189, 0.5);
}

.dark-mode .annotation-dot--4 {
  fill: rgba(252, 158, 36, 0.5);
}