/* about.css: page styles for /about on top of site.css. */

:root {
  --film: #17171b;
  --film-hole: #fbfbfa;
  --hand: "Caveat", "Bradley Hand", cursive;
}
:root[data-theme="dark"] {
  --film: #050507;
  --film-hole: #1c1d25;
}

.scene-about { top: 0; height: 460px; -webkit-mask-image: linear-gradient(#000 30%, transparent 96%); mask-image: linear-gradient(#000 30%, transparent 96%); }

.about-head { padding-top: 132px; }
.about-head .kicker { margin-bottom: 10px; }
.about-title { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.about-sub { color: var(--text-muted); max-width: 46ch; text-wrap: pretty; }

/* wide elements break out of the reading column */
.breakout {
  position: relative; z-index: 2;
  width: min(100vw - 2 * var(--gutter), 920px);
  margin-inline: auto;
}

/* ---------- Sticker board (behaviour lives in js/about-collage.js) ---------- */
.collage-section { margin-top: 44px; }
.board-wrap { position: relative; rotate: -0.4deg; }
.board-wrap::before, .board-wrap::after {
  content: ""; position: absolute; z-index: 4; top: -13px; width: 96px; height: 28px;
  background: var(--tape);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  clip-path: polygon(0 0, 4% 50%, 0 100%, 100% 100%, 96% 50%, 100% 0);
}
.board-wrap::before { left: 7%; rotate: -5deg; }
.board-wrap::after { right: 9%; rotate: 4deg; }

.collage-container {
  position: relative; width: 100%; min-height: 480px; overflow: hidden;
  border-radius: 6px;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.1px, transparent 1.2px);
  background-size: 22px 22px; background-position: 11px 11px;
  box-shadow: 0 0 0 1px var(--pill-border), 0 1px 1px rgba(0, 0, 0, 0.05), 0 30px 50px -30px rgba(20, 20, 30, 0.35);
  isolation: isolate; outline: none;
}
.collage-container:focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 30px 50px -30px rgba(20, 20, 30, 0.35); }
.collage-board-grid { display: none; }
.collage-reset {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 32px; height: 32px;
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--text-muted);
  font-size: 20px; line-height: 1;
  transition: transform 0.3s var(--ease), color 0.2s, border-color 0.2s;
}
.collage-reset:hover, .collage-reset:focus-visible { border-color: var(--text-dim); color: var(--text); transform: rotate(-90deg); }
.collage-items { position: absolute; inset: 0; z-index: 1; }
.collage-item {
  position: absolute; left: 50%; top: 50%; border-radius: 12px; background: var(--surface);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(var(--scale, 1));
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab;
}
.collage-item:hover { z-index: 40; --scale: 1.06; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15); }
.collage-item.is-dragging { --scale: 1.04; cursor: grabbing; transition: none; box-shadow: 0 24px 42px -12px rgba(0, 0, 0, 0.2); }
.collage-image { width: 120px; height: 120px; object-fit: contain; background: transparent; box-shadow: none; border-radius: 0; }
.collage-image.portrait { width: 180px; height: 220px; object-fit: cover; border-radius: 12px; border: 6px solid #fff; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06); }
.collage-image.gif { width: 160px; height: 136px; padding: 8px; object-fit: cover; border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08); }
.collage-image.icon { width: 60px; height: 60px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.collage-image.flag { width: 100px; height: 100px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.collage-image.project { width: 136px; height: 86px; object-fit: cover; border: 6px solid #fff; border-radius: 10px; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06); }
.collage-image.size-large { width: 172px; height: 108px; }
.collage-image.size-small { width: 92px; height: 60px; }
.collage-badge { padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.collage-badge.theme-dark { background: #27272a; color: #fff; }
.collage-badge.theme-blue { background: #006bb6; color: #fff; }
.collage-badge:focus-visible, .collage-image:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.collage-badge-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }

/* handwritten margin note */
.board-note {
  position: absolute; z-index: 5; left: 26px; bottom: 18px; pointer-events: none;
  display: flex; align-items: flex-end; gap: 6px;
  font-family: var(--hand); font-size: 21px; line-height: 1; color: var(--accent); rotate: -4deg;
}
.board-note svg { width: 46px; height: 34px; overflow: visible; }
.board-note path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Prose ---------- */
.about-prose { margin-top: 72px; display: grid; gap: 18px; text-wrap: pretty; }
.about-prose h1 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.about-prose p { color: color-mix(in srgb, var(--text) 84%, var(--bg)); }
.about-prose strong { color: var(--text); font-weight: 500; }
.about-prose a { border-bottom: 1px solid var(--line); transition: border-color 0.2s; }
.about-prose a:hover { border-color: var(--text-dim); }
.scribble { position: relative; white-space: nowrap; }
.scribble svg { position: absolute; left: -2%; bottom: -7px; width: 104%; height: 9px; overflow: visible; }
.scribble path { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; }

/* ---------- Film strip ---------- */
.films-section { margin-top: 64px; }
.films-section .kicker, .albums-section .kicker { margin-bottom: 18px; }
.films-section .kicker { width: min(100%, var(--col)); margin-inline: auto; }
.film-strip {
  position: relative; rotate: 0.8deg;
  padding: 30px 18px; border-radius: 4px; background: var(--film);
  box-shadow: 0 30px 50px -30px rgba(20, 20, 30, 0.5);
}
.film-strip::before, .film-strip::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 12px;
  background: repeating-linear-gradient(90deg, var(--film-hole) 0 14px, transparent 14px 30px);
  border-radius: 3px; opacity: 0.92;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 30px);
  mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 30px);
}
.film-strip::before { top: 9px; }
.film-strip::after { bottom: 9px; }
.films-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.film-card { position: relative; display: block; border-radius: 3px; overflow: hidden; background: #000; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.film-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; filter: saturate(0.9); transition: filter 0.4s var(--ease), transform 0.6s var(--ease); }
.film-card:focus-visible { transform: translateY(-6px) rotate(-1.2deg); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.7); z-index: 2; }
.film-card:focus-visible img { filter: saturate(1.1); transform: scale(1.04); }
@media (hover: hover) {
  .film-card:hover { transform: translateY(-6px) rotate(-1.2deg); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.7); z-index: 2; }
  .film-card:hover img { filter: saturate(1.1); transform: scale(1.04); }
}
.film-imdb-tag {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px;
  background: #f5c518; color: #111; font: 600 10px var(--font-sans); letter-spacing: 0.02em;
  opacity: 0; translate: 0 4px; transition: opacity 0.3s var(--ease), translate 0.3s var(--ease);
}
.film-card:hover .film-imdb-tag, .film-card:focus-visible .film-imdb-tag { opacity: 1; translate: 0 0; }
@media (hover: none) { .film-imdb-tag { opacity: 1; translate: 0 0; } }
.film-frame-no { position: absolute; right: 22px; bottom: -22px; font: 500 10px var(--font-mono); color: var(--text-dim); letter-spacing: 0.08em; }

/* ---------- Records ---------- */
.albums-section { margin-top: 84px; }
.albums-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
.album-card { display: flex; align-items: center; gap: 0; min-width: 0; }
.sleeve { position: relative; flex: none; width: 84px; height: 84px; margin-right: 46px; }
.album-cover { position: relative; z-index: 1; width: 84px; height: 84px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 10px 20px -10px rgba(0, 0, 0, 0.4); }
.sleeve::after {
  content: ""; position: absolute; top: 3px; left: 28px; width: 78px; height: 78px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--signal) 0 15%, #111 16% 18%, transparent 19%),
    repeating-radial-gradient(circle, #1a1a1e 0 2px, #2b2b31 2px 3px);
  transition: translate 0.5s var(--ease), rotate 0.9s var(--ease);
}
.album-card:hover .sleeve::after, .album-card:focus-visible .sleeve::after { translate: 16px 0; rotate: 200deg; }
.album-title { display: flex; align-items: center; gap: 5px; font-weight: 500; font-size: 15px; }
.album-title .ico { width: 12px; height: 12px; color: var(--text-dim); }
.album-artist { display: block; color: var(--text-muted); font-size: 13.5px; }

.about-end { margin-top: 84px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }

@media (max-width: 768px) {
  .collage-container { min-height: 380px; }
  .collage-image.portrait { width: 140px; height: 175px; }
  /* plain 3x2 grid on small screens: Safari mis-paints the old sideways scroller */
  .film-strip { rotate: 0deg; padding: 14px; }
  .films-grid { grid-template-columns: repeat(3, 1fr); }
  .film-strip::before, .film-strip::after { display: none; }
  .film-card img { filter: none; transition: none; }
  .film-frame-no { display: none; }
}

@media (max-width: 560px) {
  .about-head { padding-top: 108px; }
  .board-wrap { rotate: 0deg; }
  .collage-container { min-height: 400px; }
  .collage-image.portrait { width: 122px; height: 152px; }
  .collage-image.gif { width: 126px; height: 108px; }
  .collage-image.project { width: 112px; height: 72px; border-width: 4px; }
  .collage-image.size-large { width: 138px; height: 88px; }
  .collage-image.size-small { width: 78px; height: 52px; }
  .collage-badge { padding: 8px 10px; font-size: 11px; }
  .albums-grid { grid-template-columns: 1fr; }
  .board-note { font-size: 18px; left: 16px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .collage-item { transition: none; }
}
