:root {
  --bg: #ffffff;
  --bg-alt: #f6f4fa;
  --text: #16181d;
  --text-dim: #5b616e;
  --border: #e6e2ef;
  --accent: #4c19a6;
  --accent-text: #ffffff;
  --radius: 10px;
  --max-width: 880px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #14121a;
  --bg-alt: #1c1925;
  --text: #eef0f4;
  --text-dim: #a1a7b3;
  --border: #2d2940;
  --accent: #a98bf5;
  --accent-text: #0e1116;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 26px;
  width: auto;
}

.logo .logo-dark { display: none; }
[data-theme="dark"] .logo .logo-light { display: none; }
[data-theme="dark"] .logo .logo-dark { display: block; }

/* Side menu: fixed on the right edge, stacked vertically */
.side-nav {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.side-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.side-nav a:hover { color: var(--text); }
.side-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.theme-toggle:hover { background: var(--bg-alt); }

/* Hero */
.hero {
  padding: 96px 0 72px;
  text-align: left;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* the logo with the handwritten "My Logo" note and arrow above it, upper-right */
.hero-mark {
  display: flex;
  flex-direction: column-reverse; /* the note follows the logo in the page, but shows above it */
  align-items: flex-end;
  flex-shrink: 0;
  margin-right: 80px;
}

.hero-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 -62px 6px 0; /* nudged to the right of the logo's edge */
  color: var(--accent);
}

/* with a mouse, the note appears when the pointer is over the logo; on touch screens it stays visible */
@media (hover: hover) {
  .hero-note {
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .hero-logo:hover + .hero-note,
  .hero-logo:focus-visible + .hero-note { opacity: 1; }
}

@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .hero-note { transition: none; }
}

.hero-note-arrow {
  display: block;
  width: 56px;
  height: auto;
  flex-shrink: 0;
}

.hero-note-text {
  margin-top: 5px;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hero-logo {
  display: block;
  height: 340px;
  width: auto;
}

[data-theme="dark"] .hero-logo { filter: invert(1); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Headline: a labelled text box */
.headline-field {
  margin: 0 0 28px;
  max-width: 440px;
}

.hero .headline-label {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 1.05rem;
  font-weight: 400;
}

.hero .headline-box {
  margin: 0;
  min-height: 5.5rem;
  padding: 18px 22px;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.4;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--text) 50%, transparent);
  border-radius: 8px;
}

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

/* typed headline: the caret is part of the design */
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: caret-blink 1.05s steps(1) infinite;
}

.is-typing .caret { animation: none; }

@keyframes caret-blink { 50% { opacity: 0; } }

.tagline {
  margin: 0 0 28px;
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.12s ease, opacity 0.12s ease;
  border: 1px solid transparent;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover { opacity: 0.92; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover { background: var(--bg-alt); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section.alt { background: var(--bg-alt); }

/* Standalone pages: no divider under the header, fill the viewport */
.section.page { border-top: 0; min-height: 60vh; flex: 1; }

.section h2 {
  font-size: 1.6rem;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

.section p {
  color: var(--text-dim);
  max-width: 65ch;
}

/* Projects grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* patent cards: a drawing on top, the details below */
.card-patent {
  padding: 0;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-patent:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.card-figure {
  position: relative;
  display: block;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  cursor: zoom-in;
}

.card-figure img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 16px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.5s ease;
}

/* dark theme: white-on-black line art */
[data-theme="dark"] .card-figure img {
  filter: invert(1);
  mix-blend-mode: screen;
}

.card-figure:hover img { transform: scale(1.04); }

.card-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

@media (prefers-reduced-motion: reduce) {
  .card-patent,
  .card-figure img { transition: none; }
  .card-patent:hover { transform: none; }
  .card-figure:hover img { transform: none; }
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tags span {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: auto;
}

.card-link:hover { text-decoration: underline; }

/* Design patents stat callout */
.stat-callout {
  margin-top: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.stat-callout-top { margin: 0 0 24px; }

.stat-callout.stat-callout-selected { margin: 0 0 24px; }

.stat-number {
  min-width: 116px; /* keeps the headings of the two callouts aligned */
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}

.stat-body h3 {
  margin: 4px 0 8px;
  font-size: 1.1rem;
}

.stat-body p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-dim);
  max-width: 60ch;
}

.design-list {
  margin-bottom: 14px;
}

.design-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
}

.design-numbers {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 16px;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-dim);
}

.stat-body p.design-note-block {
  font-size: 0.85rem;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.design-note {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-style: italic;
  font-size: 0.78rem;
}

/* Design patent gallery */
.design-gallery {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.design-tile {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.design-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.design-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg);
}

.design-tile .design-caption {
  display: block;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Design gallery lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #07070a; /* solid, so the page behind never shows through */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 88px;
}

.lightbox[hidden] { display: none; }

/* clicking quickly (double-click) must not select the picture and tint it blue */
.lightbox,
.lightbox * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-img {
  -webkit-user-drag: none;
  user-drag: none;
}

.lightbox ::selection,
.lightbox::selection { background: transparent; }

.art-tile,
.art-tile img,
.design-tile,
.design-tile img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* with a mouse, the cursor is the navigation: an arrow on each half of the screen */
.lightbox.is-left { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='12.5' fill='rgba(0,0,0,0.55)' stroke='white' stroke-width='1.5'/%3E%3Cpath d='M16 8 L10 14 L16 20' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 14 14, w-resize; }
.lightbox.is-right { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='12.5' fill='rgba(0,0,0,0.55)' stroke='white' stroke-width='1.5'/%3E%3Cpath d='M12 8 L18 14 L12 20' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 14 14, e-resize; }

@media (hover: hover) and (pointer: fine) {
  .lightbox .lightbox-nav { display: none; }
}

/* only one picture: no arrows, click anywhere to close */
.lightbox.is-single, .lightbox.is-single.is-left, .lightbox.is-single.is-right { cursor: default; }
.lightbox.is-single .lightbox-img,
.lightbox.is-single.is-left .lightbox-img,
.lightbox.is-single.is-right .lightbox-img { cursor: zoom-in; }
.lightbox.is-single.is-zoomed, .lightbox.is-single.is-zoomed .lightbox-img { cursor: zoom-out; }
.lightbox.is-zoomed { overflow: hidden; }
.lightbox.is-zoomed .lightbox-caption { opacity: 0; }
.lightbox.is-zoomed .lightbox-close { z-index: 2; }
.lightbox.is-single .lightbox-nav { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  transition: transform 0.25s ease;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.lightbox-caption {
  color: #eef0f4;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.85;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  /* same look as the arrow cursor: dark disc, white ring, white arrow */
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.18s ease, transform 0.18s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.08);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.lightbox-nav {
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  padding-bottom: 3px;
}

.lightbox-close {
  top: 22px;
  right: 22px;
  width: 36px;
  height: 36px;
}

.lightbox-close svg {
  display: block;
  width: 24px; /* drawn 1:1 so the cross has the same 2px stroke as the cursor arrows */
  height: 24px;
  transition: transform 0.25s ease;
}

.lightbox-close:hover svg { transform: rotate(90deg); }

@media (prefers-reduced-motion: reduce) {
  .lightbox-close svg,
  .lightbox-close,
  .lightbox-nav { transition: none; }
  .lightbox-close:hover svg,
  .lightbox-close:hover,
  .lightbox-nav:hover { transform: none; }
}

.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-prev:focus-visible,
.lightbox-next:hover, .lightbox-next:focus-visible { transform: translateY(-50%) scale(1.08); }

@media (max-width: 600px) {
  .lightbox { padding: 56px 52px; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.4rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { width: 34px; height: 34px; top: 12px; right: 12px; }
}

/* Music: embedded video */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}

/* full width, so it lines up with the dividers and the pictures around it */
.video-embed.video-wide { max-width: none; }

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.music-heading {
  margin: 32px 0 14px;
  font-size: 1.05rem;
}

.listen-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.listen-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: color 0.15s ease;
}

.listen-icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.listen-icon svg { width: 26px; height: 26px; }

.listen-link:hover { color: var(--text); }

.listen-link:hover .listen-icon,
.listen-link:focus-visible .listen-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  transform: translateY(-2px);
}

/* Spotify's own green on hover */
.listen-spotify:hover .listen-icon,
.listen-spotify:focus-visible .listen-icon {
  background: #1db954;
  border-color: #1db954;
  color: #191414;
}

/* Apple Music's own red on hover */
.listen-apple:hover .listen-icon,
.listen-apple:focus-visible .listen-icon {
  background: #fa243c;
  border-color: #fa243c;
  color: #fff;
}

/* a set of pictures kept side by side in a single row (e.g. game screenshots) */
.art-grid.art-grid-row {
  flex-wrap: nowrap;
}

/* space between this project's caption and the next project */
.art-grid-row + .work-caption { margin-bottom: 80px; }

/* Modern Art: the same generous gap under every divider */
.section h3.art-divider.art-divider-roomy { margin-bottom: 52px; }

/* caption under a work: title, then indented details */
.work-caption { margin-top: 40px; }

.section .work-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.work-details { padding-left: 24px; }

.section .work-details p {
  margin: 0 0 6px;
  max-width: 52ch;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* small reference preview (e.g. a storyboard) inside a caption */
/* "Storyboard" label with the preview to its right */
.work-ref-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
}

.section .work-details .work-ref-row p.work-ref-label { margin: 0; }

.work-ref {
  display: inline-block;
  margin-top: 0;
  line-height: 0;
  border-radius: 4px;
  transition: transform 0.15s ease;
}

.work-ref img {
  display: block;
  width: 76px;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.15s ease;
}

.work-ref:hover,
.work-ref:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.work-ref:hover img,
.work-ref:focus-visible img { border-color: var(--accent); }

/* Film page: cinematic title card */
.section.page.film {
  background: #08080a;
  border-top: 0;
}

.film-figure {
  position: relative;
  margin: 0 auto;
  max-width: 520px;
  overflow: hidden;
  border-radius: 2px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

/* cinema bars that slide open when the page loads */
.film-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  z-index: 6;
  background: #000;
  pointer-events: none;
}

.film-bar-top {
  top: 0;
  animation: film-bar-up 1.3s 0.25s cubic-bezier(0.7, 0, 0.2, 1) both;
}

.film-bar-bottom {
  bottom: 0;
  animation: film-bar-down 1.3s 0.25s cubic-bezier(0.7, 0, 0.2, 1) both;
}

@keyframes film-bar-up { to { transform: translateY(-101%); } }
@keyframes film-bar-down { to { transform: translateY(101%); } }

@keyframes film-grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-3%, -2%); }
  80% { transform: translate(4%, 4%); }
  100% { transform: translate(0, 0); }
}

/* film grain (jitters like real film) */
.film-figure::before {
  content: "";
  position: absolute;
  inset: -12%;
  animation: film-grain 0.9s steps(6) infinite;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.28;
}

/* vignette + bottom fade for the title */
.film-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.35) 38%, rgba(0, 0, 0, 0) 62%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.6) 100%);
}

.film-photo {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.1) saturate(0.78) brightness(0.92);
}

.section .film-kicker {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 3;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.film-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 40px 44px;
  text-align: center;
  color: #fff;
}

/* title card builds in line by line */
@keyframes film-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(10px) scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes film-rule {
  from { transform: translateX(-50%) scaleX(0); }
  to { transform: translateX(-50%) scaleX(1); }
}

.film-credit { animation: film-in 1.1s 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.film-title { animation: film-in 1.4s 1.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.film-soon { animation: film-in 1.1s 2.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.film-soon::before { animation: film-rule 0.9s 2.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.film-kicker { animation: film-in 1.2s 1.2s ease both; }

.section .film-overlay p {
  max-width: none;
  margin: 0;
  color: #fff;
}

.section .film-overlay .film-credit {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.45em;
  padding-left: 0.45em; /* balances the trailing letter-space so the text is truly centred */
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 28px;
}

.section .film-title {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(1.2rem, 4.4vw, 1.6rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.12em;
  padding-left: 0.12em;
  text-transform: uppercase;
  text-wrap: balance;
}

.section .film-overlay .film-soon {
  margin-top: 14px;
  padding-top: 18px;
  position: relative;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.page-film .side-nav a { color: rgba(255, 255, 255, 0.6); }
.page-film .side-nav a:hover,
.page-film .side-nav a[aria-current="page"] { color: #fff; }

/* narrower screens: the menu sits in the (themed) header, so keep its normal colours */
@media (max-width: 1180px) {
  .page-film .side-nav a { color: var(--text-dim); }
  .page-film .side-nav a:hover,
  .page-film .side-nav a[aria-current="page"] { color: var(--text); }
}

.film-soon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 36px;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .film-figure::before,
  .film-credit,
  .film-title,
  .film-soon,
  .film-soon::before,
  .film-kicker { animation: none; }
  .film-bar { display: none; }
}

@media (max-width: 600px) {
  .film-overlay { padding: 0 24px 34px; }
  .section .film-kicker { top: 18px; left: 22px; font-size: 1rem; }
}

/* About page: heading, photo and text share one centred column */
.about-column {
  max-width: 640px;
  margin: 0 auto;
}

.about-column p { max-width: none; }

/* the description under the details: a little brighter than the default dim text */
.about-column > p { color: color-mix(in srgb, var(--text) 60%, var(--text-dim)); }

.about-figure { margin: 0 0 28px; }

/* name + birth details */
.about-id { margin: 0 0 56px; }

/* the purple line starts at "Born" */
.about-details {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
}

.section .about-id p { max-width: none; }

.section .about-name {
  margin: 0 0 35px;
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.about-name-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  transition: color 0.15s ease;
}

.about-name-link:hover,
.about-name-link:focus-visible { color: var(--accent); }

.about-alt {
  font-weight: 400;
  color: var(--text-dim);
}

.section .about-born {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.section .about-company { margin-top: 16px; }

.about-label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.about-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.about-figure figcaption {
  margin-top: 10px;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Fashion page: editorial layout */
.section.fashion h2 {
  font-size: 2.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fashion-figure {
  position: relative;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-alt);
}

.fashion-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 55%);
}

.fashion-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 55%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s ease, transform 0.8s ease;
}

.fashion-figure:hover .fashion-photo {
  filter: none;
  transform: scale(1.02);
}

.fashion-cta {
  position: absolute;
  left: 24px;
  bottom: 22px;
  z-index: 1;
  padding: 11px 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fashion-cta:hover,
.fashion-cta:focus-visible {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .fashion-photo { transition: none; }
  .fashion-figure:hover .fashion-photo { transform: none; }
}

@media (max-width: 600px) {
  .fashion-photo { aspect-ratio: 4 / 3; }
  .fashion-cta { left: 14px; bottom: 14px; padding: 9px 16px; }
}

/* Art page: uncropped gallery in even rows (every row fills the full width) */
.art-grid {
  --row-height: 210px;
  --gap: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

@media (max-width: 600px) {
  .art-grid { --row-height: 130px; --gap: 10px; }
}

.art-tile {
  display: block;
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row-height));
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-alt);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.art-tile:hover,
.art-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.art-tile img {
  display: block;
  width: 100%;
  height: auto;
}

/* section dividers: Classic Edition (top) and Bathroom Edition */
.section h3.art-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 52px 0 28px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text);
}

/* the first divider sits right under the page title */
.section h2 + h3.art-divider { margin-top: 4px; }

.art-divider::before,
.art-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 64px;
}

/* Footer */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Not enough room beside the content: menu moves into the header bar */
@media (max-width: 1180px) {
  .side-nav {
    top: 0;
    height: 60px;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 14px; /* ten items now, so the gaps are tighter to clear the logo */
    right: calc(max(0px, (100vw - 880px) / 2) + 24px + 34px + 24px);
  }
}

@media (max-width: 900px) {
  /* Narrow screens: menu becomes a wrapping bar under the header */
  .side-nav {
    position: static;
    right: auto;
    height: auto;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .side-nav a { font-size: 0.88rem; }
}

@media (max-width: 600px) {
  .hero { padding: 64px 0 48px; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 28px; }
  .hero-mark { margin-right: 56px; align-self: flex-end; }
  .hero-logo { height: 200px; }
  .hero-note { margin-right: -16px; }
  .hero-note-arrow { width: 48px; }
  .hero-note-text { font-size: 1.1rem; }
  .stat-callout { flex-direction: column; }
}

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

/* Entertainment: same layout as Fashion, with the CGTeaTime logo on white */
.entertainment-figure { background: #fff; }

/* no dark fade over a white logo; the button is dark instead */
.entertainment-figure::after { display: none; }

.fashion-photo.entertainment-photo {
  box-sizing: border-box;
  padding: 8.4%; /* the logo fills about 70% of the panel, so it is not oversized */
  object-fit: contain;
  object-position: center;
  background: #fff;
}

/* the two buttons sit together in the lower-right corner */
.entertainment-links {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 1;
  display: flex;
  gap: 10px;
}

.entertainment-figure .fashion-cta {
  position: static;
  color: #111;
  background: rgba(255, 255, 255, 0.7);
  border-color: #111;
}

/* the red of the TEA letters in the logo */
.entertainment-figure .fashion-cta:hover,
.entertainment-figure .fashion-cta:focus-visible {
  color: #fff;
  background: #ec1f23;
  border-color: #ec1f23;
}

@media (max-width: 600px) {
  .entertainment-links { right: 14px; bottom: 14px; gap: 8px; }
}

/* Modern Art: the comic pages sit in one row like the game screenshots; on phones, three across so they stay readable */
@media (max-width: 600px) {
  .art-grid.art-grid-row.comic-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .comic-row .art-tile { aspect-ratio: var(--ar); }
}

/* Contact: the email as text with an accent underline (same look as the name on the About page) */
.contact-email {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.contact-email:hover,
.contact-email:focus-visible { color: var(--accent); outline: none; }

@media (max-width: 600px) {
  .contact-email { font-size: 1.25rem; }
}




/* Art: a single, smaller work centred on the page, with its caption under the picture */
.art-grid.art-grid-center { justify-content: center; }
.art-grid-center .art-tile { flex: 0 1 480px; }
.work-caption-center { max-width: 480px; margin-left: auto; margin-right: auto; }

/* Poetry: a poem, line breaks kept, stanzas separated */
.poem { max-width: 640px; }

.poem .poem-title {
  margin: 36px 0 44px;
  font-size: 1.2rem;
  font-weight: 600;
}

.section .poem p {
  margin: 0 0 1.7em;
  max-width: none;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text);
}

.poem-figure { margin: 28px 0 0; }

.poem-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.poem-rule {
  max-width: 640px;
  margin: 12px 0 24px;
  border: 0;
  border-top: 1px solid var(--border);
}

.section .poem-more {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}
