/* ==========================================================
   Fiona Rolland — shared styles
   ========================================================== */

:root {
  --ink: #2b1d14;
  --paper: #fbf6ea;
  /* object scale: original scan pixels → viewport width
     (keeps every tool at its real relative size) */
  --s: 0.0135vw;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  /* tiled wooden boards */
  background: #b9874f url("../assets/wood-tile.jpg") repeat;
  background-size: 1400px auto;
}

a { color: inherit; }

/* ---------- Ruler menu ---------- */

.menu {
  position: relative;
  z-index: 5;
  width: min(92vw, 820px);
  aspect-ratio: 900 / 130;
  margin: clamp(14px, 3vh, 34px) auto 0;
  background: url("../assets/ruler-horizontal.png") center / 100% 100% no-repeat;
  filter: drop-shadow(2px 6px 6px rgba(40, 20, 5, .45));
  transform: rotate(-1.2deg);
  container-type: inline-size;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0 5%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.menu a {
  display: inline-block;
  text-decoration: none;
  font-size: 3.5cqw;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1;
  padding: .1em .35em;
  transition: transform .2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  transform: translateY(-3px) rotate(-2deg);
  text-decoration: underline wavy #b8433a 2px;
  text-underline-offset: 4px;
}

/* ---------- Home stage ---------- */

.stage {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  /* room below the photo for the bottom border of tools */
  padding-bottom: clamp(110px, 14vw, 220px);
}

.hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 0 18vw;
  pointer-events: none; /* the empty parts of the hero let the tools be grabbed */
}

.hero > * { pointer-events: auto; }

/* picked-up tool */
.tool.dragging {
  cursor: grabbing;
  --sc: 1.1;
  --hr: 0deg;
  transition: none;
  filter: drop-shadow(10px 18px 12px rgba(30, 15, 5, .45));
}

/* ---------- Paper-cut title ---------- */

.cutout-title {
  --h: clamp(54px, 8.2vw, 128px);
  margin: clamp(18px, 4vh, 48px) 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: calc(var(--h) * .45);
  row-gap: calc(var(--h) * .12);
  font-size: 0; /* hide whitespace between images */
}

.cutout-title .word {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.cutout-title img {
  height: calc(var(--h) * var(--k, 1));
  width: auto;
  margin: 0 calc(var(--h) * .02);
  transform: rotate(var(--r, 0deg)) translateY(var(--dy, 0));
  filter: drop-shadow(1px 3px 2px rgba(30, 15, 5, .45));
}

.contact {
  margin: .4em 0 0;
  align-self: center;
  font-size: clamp(.95rem, 1.5vw, 1.4rem);
  font-weight: 700;
  background: var(--paper);
  padding: .1em .7em .15em;
  transform: rotate(-1.5deg);
  box-shadow: 1px 3px 6px rgba(40, 20, 5, .35);
  clip-path: polygon(0 6%, 4% 0, 30% 5%, 62% 0, 100% 4%, 98% 52%, 100% 100%, 70% 95%, 35% 100%, 2% 96%, 0 60%);
}

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

/* ---------- Photo in a polaroid, with tape ---------- */

.photo {
  position: relative;
  width: clamp(240px, 23vw, 400px);
  margin: clamp(28px, 5vh, 56px) 0 0;
  left: 10vw; /* centre at 3/5 of the page width */
  transform: rotate(2.5deg);
  filter: drop-shadow(3px 9px 10px rgba(30, 15, 5, .5));
}

.photo .polaroid-frame {
  display: block;
  width: 100%;
  height: auto;
}

/* the photo sits in the window of the scanned polaroid
   (window measured on polaroid.png: x 54–522, y 95–726 of 578×900) */
.photo img.portrait {
  position: absolute;
  left: 10.5%;
  top: 9.6%;
  width: 70.2%;
  height: 81.1%;
  object-fit: cover;
  object-position: 49% 35%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.photo .tape {
  position: absolute;
  width: 34%;
  opacity: .93;
  pointer-events: none;
}

.photo .tape.tl { top: -13%; left: -2%; width: 9%; transform: rotate(48deg); }
.photo .tape.br { bottom: -13%; right: -2%; width: 9%; transform: rotate(46deg); }

/* ---------- Scattered tools ---------- */

.tools {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.tool {
  position: absolute;
  top: var(--y);
  width: calc(var(--ow) * var(--s) * var(--z, 1));
  height: auto;
  filter: drop-shadow(3px 6px 5px rgba(30, 15, 5, .45));
  --rr: var(--r, 0deg);
  transform:
    translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px)))
    rotate(calc(var(--rr) + var(--hr, 0deg)))
    scale(var(--sc, 1));
  pointer-events: auto;
  cursor: grab;
  touch-action: none; /* lets fingers drag the tool instead of scrolling */
  user-select: none;
  -webkit-user-drag: none;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}

.tool.l { left: var(--x); }
.tool.r { left: calc(100% - var(--x)); }

.tool:hover {
  --hr: 4deg;
  --sc: 1.04;
}

/* gentle "dropped on the desk" entrance */
@media (prefers-reduced-motion: no-preference) {
  .tool, .cutout-title img, .photo, .menu {
    animation: drop .7s cubic-bezier(.2, 1.4, .4, 1) both;
    animation-delay: var(--d, 0s);
  }
  @keyframes drop {
    from { opacity: 0; translate: 0 -24px; }
    to   { opacity: 1; translate: 0 0; }
  }
}

/* ---------- Wide screens: name on one line, as in the sketch ---------- */

@media (min-width: 1100px) {
  .hero { padding: 0 12vw; }
  .cutout-title { --h: clamp(70px, 6.6vw, 124px); flex-wrap: nowrap; }
}

/* ---------- Tablets ---------- */

@media (min-width: 761px) and (max-width: 1099px) {
  :root { --s: 0.017vw; }
  .photo { width: 40vw; }
  .cutout-title { --h: 9.5vw; }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  :root { --s: 0.031vw; }

  body { background-size: 900px auto; }

  .stage { padding-bottom: 38vw; }

  .hero { padding: 0 9vw; }

  .cutout-title { --h: clamp(40px, 13vw, 76px); }

  .photo { width: min(76vw, 330px); margin-top: 9vw; left: 0; }

  /* mobile positions override the desktop ones when given */
  .tool { top: var(--my, var(--y)); --rr: var(--mr, var(--r, 0deg)); }
  .tool.l { left: var(--mx, var(--x)); }
  .tool.r { left: calc(100% - var(--mx, var(--x))); }
  .tool.desk-only { display: none; }
}

/* ==========================================================
   Sub-pages (About me · Portfolio · Curriculum Vitae)
   ========================================================== */

.menu a[aria-current="page"] {
  text-decoration: underline wavy #b8433a 2px;
  text-underline-offset: 4px;
}

.home-tag {
  position: absolute;
  z-index: 6;
  top: clamp(10px, 2vw, 22px);
  left: clamp(8px, 2vw, 26px);
  font-weight: 700;
  font-size: clamp(.8rem, 1.1vw, 1rem);
  text-decoration: none;
  background: var(--paper);
  padding: .3em .7em;
  transform: rotate(-4deg);
  box-shadow: 1px 3px 5px rgba(40, 20, 5, .35);
}
.home-tag:hover { transform: rotate(-2deg) translateY(-2px); }

.sub {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding-bottom: 60px;
}

.page-title {
  --h: clamp(46px, 7vw, 110px);
  position: relative;
  margin: clamp(24px, 4vw, 50px) 0 clamp(20px, 3vw, 40px);
  justify-content: flex-start;
}

.title-acorn {
  height: calc(var(--h) * .8) !important;
  align-self: center;
  margin-left: calc(var(--h) * .3) !important;
}

/* paper sheet */
.sheet {
  position: relative;
  background: var(--paper);
  padding: clamp(18px, 3vw, 40px);
  margin: 0 0 clamp(26px, 4vw, 48px);
  box-shadow: 2px 8px 18px rgba(30, 15, 5, .45);
  font-size: clamp(.9rem, 1.05vw, 1.02rem);
  line-height: 1.6;
}
.sheet:nth-of-type(odd)  { transform: rotate(-.6deg); }
.sheet:nth-of-type(even) { transform: rotate(.5deg); }

.sheet h2, .sheet h3 {
  margin: 0 0 .5em;
  font-size: 1.35em;
  letter-spacing: .02em;
}
.sheet p { margin: 0 0 1em; }

/* photo placeholder */
.ph {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 10px, transparent 10px 20px),
    #d9d2c3;
  color: #6b5f4f;
  font-weight: 700;
  font-size: .95rem;
}

/* --- About --- */
.intro {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
}
.me {
  position: relative;
  margin: 0;
  background: #fff;
  padding: 10px 10px 34px;
  transform: rotate(3deg);
  box-shadow: 2px 6px 12px rgba(30, 15, 5, .35);
}
.me img:first-child { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.me .pin { position: absolute; width: 9%; top: -12%; right: 12%; transform: rotate(18deg); }

.row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
}
.row.reverse { grid-template-columns: 1.6fr 1fr; }

.snap { position: relative; margin: 0; padding: 8px; background: #fff; box-shadow: 2px 6px 12px rgba(30,15,5,.35); }
.snap.left  { transform: rotate(-4deg); }
.snap.right { transform: rotate(3deg); }
.snap .tape { position: absolute; width: 38%; opacity: .92; }
.snap .t1 { top: -9%;  left: -12%; transform: rotate(-35deg); }
.snap .t2 { bottom: -9%; right: -12%; transform: rotate(-35deg); }

/* film strip, scrolling right to left */
.filmstrip {
  position: relative;
  overflow: hidden;
  margin: clamp(10px, 3vw, 30px) calc(50% - 50vw) 0;
  background: #1b1612;
  padding: 26px 0;
  box-shadow: 0 8px 18px rgba(0,0,0,.45);
}
.filmstrip::before, .filmstrip::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, #e9e0cc 10px 22px, transparent 22px 34px);
  opacity: .85;
}
.filmstrip::before { top: 7px; }
.filmstrip::after  { bottom: 7px; }
.filmstrip ul {
  display: flex;
  gap: 14px;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: film 40s linear infinite;
}
.filmstrip li { width: clamp(150px, 18vw, 240px); }
.filmstrip .ph { background-color: #8d8270; color: #f2ead9; }
.filmstrip:hover ul { animation-play-state: paused; }
@keyframes film { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .filmstrip ul { animation: none; } }

/* --- Portfolio --- */
.folders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(34px, 5vw, 64px) clamp(18px, 3vw, 40px);
  margin-top: clamp(40px, 5vw, 64px);
}
.folder {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: linear-gradient(#e7c98f, #d9b675);
  border-radius: 0 6px 6px 6px;
  box-shadow: 2px 8px 14px rgba(30, 15, 5, .45);
  transform: rotate(var(--r, 0deg));
  transition: transform .25s ease;
}
.folder::before { /* tab */
  content: "";
  position: absolute;
  left: 0; top: -11%;
  width: 42%; height: 12%;
  background: #e7c98f;
  border-radius: 8px 14px 0 0;
}
.folder:hover { transform: rotate(0deg) translateY(-6px); }
.folder .label {
  background: var(--paper);
  padding: .35em .9em;
  font-weight: 700;
  font-size: clamp(.95rem, 1.4vw, 1.25rem);
  box-shadow: 1px 2px 3px rgba(0,0,0,.25);
  border: 1px solid #3a2a1c;
}
.folder .dots { position: absolute; left: 7%; bottom: 8%; display: flex; gap: 6px; }

.dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.dot.gallery { background: #6c5fb5; }
.dot.file    { background: #8fb7dd; }
.dot.video   { background: #b7cc2c; }

.legend { width: max-content; max-width: 100%; margin-top: clamp(30px, 5vw, 56px); padding: 14px 22px; }
.legend p { margin: .2em 0; }

/* --- CV --- */
.cv { width: min(780px, 100%); margin-inline: auto; }
.cv-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.cv-head h2 { font-size: 1.7em; }
.cv dl { display: grid; grid-template-columns: max-content 1fr; gap: .3em 1em; margin: 0; }
.cv dt { font-weight: 700; }
.cv dd { margin: 0; }
.cv-photo { margin: 0; width: clamp(110px, 16vw, 170px); aspect-ratio: 3 / 4; background: #fff; padding: 6px; box-shadow: 1px 4px 8px rgba(0,0,0,.3); transform: rotate(2deg); }
.cv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.cv section { margin-top: 1.8em; }
.cv h3 { border-bottom: 2px dashed #3a2a1c; padding-bottom: .2em; }
.jobs { list-style: none; padding: 0; margin: 0; }
.jobs li { margin: 0 0 1em; }
.pdf-btn {
  display: inline-block;
  margin-top: 1em;
  padding: .4em 1.1em;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.pdf-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

/* --- Sub-pages on small screens --- */
@media (max-width: 760px) {
  .page-title { --h: clamp(34px, 11vw, 60px); justify-content: center; }
  .intro, .row, .row.reverse { grid-template-columns: 1fr; }
  .row.reverse .snap { order: -1; }
  .snap, .me { width: 82%; justify-self: center; }
  .folders { grid-template-columns: repeat(2, 1fr); }
  .cv-head { grid-template-columns: 1fr; }
  .cv-photo { order: -1; }
  .cv dl { grid-template-columns: 1fr; }
  .cv dt { margin-top: .4em; }
  .home-tag { position: static; display: inline-block; margin: 10px 0 0 10px; }
}

@media (max-width: 760px) {
  .page-portfolio .page-title { --h: 9.5vw; }
  .page-cv .page-title { --h: 7.6vw; row-gap: 2.4vw; }
}

/* ==========================================================
   Portfolio section pages (gallery · files · videos)
   ========================================================== */

@media (max-width: 760px) {
  .page-title.long { --h: 7.6vw; row-gap: 2.4vw; }
}

.kind-line { width: max-content; max-width: 100%; padding: 12px 20px; }
.kind { font-weight: 700; white-space: nowrap; margin-right: 1.2em; }

.section-sub {
  display: inline-block;
  margin: 10px 0 18px;
  padding: .2em .8em;
  background: var(--paper);
  font-size: 1.2rem;
  transform: rotate(-1.5deg);
  box-shadow: 1px 3px 6px rgba(40, 20, 5, .35);
}

/* --- picture gallery: masonry columns --- */
.gallery {
  columns: 4 220px;
  column-gap: 18px;
}
.g-item {
  position: relative;
  break-inside: avoid;
  margin: 0 0 18px;
  background: #fff;
  padding: 7px;
  box-shadow: 2px 6px 12px rgba(30, 15, 5, .4);
  cursor: zoom-in;
  transition: transform .2s ease;
}
.g-item:nth-child(3n)   { transform: rotate(-1deg); }
.g-item:nth-child(3n+1) { transform: rotate(.8deg); }
.g-item:hover { transform: rotate(0) scale(1.02); z-index: 2; }
.g-img {
  width: 100%;
  background:
    linear-gradient(160deg, rgba(255,255,255,.25), transparent 55%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 9px, transparent 9px 18px),
    var(--tint, #b9a68a);
}
/* image name in the bottom-right corner, on white */
.g-item figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
  background: #fff;
  padding: .2em .55em;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20, 12, 6, .82);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox figure { position: relative; margin: 0; background: #fff; padding: 10px; }
.lightbox .g-img { height: 78vh; width: auto; max-width: 86vw; }
.lightbox figcaption {
  position: absolute; right: 10px; bottom: 10px;
  background: #fff; padding: .25em .7em; font-weight: 700;
}
.lb-close {
  position: absolute; top: 16px; right: 22px;
  font: 700 2.4rem/1 "Courier New", monospace; color: #fff;
  background: none; border: 0; cursor: pointer;
}

/* --- files --- */
.docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 26px;
  margin-bottom: 40px;
}
.doc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .4em;
  min-height: 230px;
  padding: 20px 18px 16px;
  text-decoration: none;
  background: #fff;
  box-shadow: 2px 6px 12px rgba(30, 15, 5, .4);
  transform: rotate(var(--r, 0deg));
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
  transition: transform .2s ease;
}
.doc::after { /* folded corner */
  content: "";
  position: absolute; top: 0; right: 0;
  width: 34px; height: 34px;
  background: linear-gradient(225deg, transparent 50%, #ddd3c0 50%);
}
.doc:hover { transform: rotate(0) translateY(-5px); }
.doc-type {
  align-self: flex-start;
  background: #b8433a; color: #fff;
  font-size: .75rem; font-weight: 700;
  padding: .15em .5em;
}
.doc-title { font-weight: 700; font-size: 1.05rem; margin-top: .4em; }
.doc-meta { font-size: .85rem; color: #6b5f4f; }
.doc-open { margin-top: auto; font-weight: 700; font-size: .9rem; }
.doc::before { /* lines of "text" */
  content: "";
  position: absolute; left: 18px; right: 18px; bottom: 46px; height: 46px;
  background: repeating-linear-gradient(#e6dfd1 0 2px, transparent 2px 9px);
}

/* --- videos --- */
.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 34px;
  margin-bottom: 40px;
}
.vid {
  background: var(--paper);
  padding: 12px 12px 16px;
  box-shadow: 2px 8px 14px rgba(30, 15, 5, .45);
  transform: rotate(var(--r, 0deg));
}
.vid h3 { margin: .7em 0 .2em; font-size: 1.1rem; }
.vid p { margin: 0; font-size: .85rem; line-height: 1.5; }
.vid-screen {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 40%, #4a4038, #17120e 75%);
}
.play {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(251, 246, 234, .9);
  position: relative;
  transition: transform .2s ease;
}
.play::after {
  content: "";
  position: absolute; left: 26px; top: 19px;
  border-left: 22px solid #2b1d14;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
}
.vid-screen:hover .play { transform: scale(1.1); }
.dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .75rem; padding: .1em .4em;
}

@media (max-width: 760px) {
  .gallery { columns: 2; column-gap: 12px; }
  .g-item { margin-bottom: 12px; padding: 5px; }
  .g-item figcaption { right: 5px; bottom: 5px; font-size: .6rem; }
  .videos { grid-template-columns: 1fr; }
  .docs { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .doc { min-height: 190px; padding: 16px 12px 12px; }
  .doc-title { font-size: .9rem; }
  .doc::before { display: none; }
}

/* ==========================================================
   Home-page snapshots (hover a tool)
   ========================================================== */

.snap-pop {
  position: fixed;
  z-index: 40;
  width: clamp(150px, 13vw, 200px);
  padding: 8px 8px 0;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 3px 10px 18px rgba(30, 15, 5, .5);
  opacity: 0;
  pointer-events: none;
  transform: rotate(var(--tilt, 0deg)) scale(.85) translateY(8px);
  transition: opacity .18s ease, transform .25s cubic-bezier(.3, 1.5, .5, 1);
}
.snap-pop.on {
  opacity: 1;
  pointer-events: auto;
  transform: rotate(var(--tilt, 0deg)) scale(1) translateY(0);
}
.snap-pop:hover { box-shadow: 4px 14px 22px rgba(30, 15, 5, .55); }

.sp-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.sp-image {
  background:
    linear-gradient(160deg, rgba(255,255,255,.25), transparent 55%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 8px, transparent 8px 16px),
    var(--tint, #b9a68a);
}
.sp-name {
  position: absolute; right: 0; bottom: 0;
  background: #fff; padding: .15em .45em;
  font-size: .6rem; font-weight: 700;
}
.sp-video {
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #4a4038, #17120e 75%);
  animation: projector 0.25s steps(2) infinite;
}
@keyframes projector { 50% { filter: brightness(1.12); } }
.sp-play {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(251, 246, 234, .9); position: relative;
}
.sp-play::after {
  content: ""; position: absolute; left: 15px; top: 11px;
  border-left: 13px solid #2b1d14;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.sp-dur {
  position: absolute; right: 4px; bottom: 4px;
  background: rgba(0,0,0,.7); color: #fff; font-size: .6rem; padding: 0 .3em;
}
.sp-file {
  display: flex; flex-direction: column; gap: .25em;
  padding: 10px; background: #fbf8f1; border: 1px solid #e6dfd1;
  font-size: .7rem;
}
.sp-file b { align-self: flex-start; background: #b8433a; color: #fff; font-size: .6rem; padding: 0 .4em; }
.sp-file strong { font-size: .78rem; }
.sp-file em { color: #6b5f4f; font-style: normal; }
.sp-file i { flex: 1; background: repeating-linear-gradient(#e6dfd1 0 2px, transparent 2px 8px); }

.sp-caption {
  display: flex; flex-direction: column; gap: .1em;
  padding: .55em .1em .7em;
  font-size: .72rem; line-height: 1.25;
}
.sp-title { font-weight: 700; }
.sp-section { font-weight: 700; color: #b8433a; }

/* item reached from a snapshot */
.spotlight { animation: spotlight 2.4s ease-out 1; }
@keyframes spotlight {
  0%, 30% { outline: 5px solid #b8433a; outline-offset: 6px; box-shadow: 0 0 0 14px rgba(184, 67, 58, .25), 2px 8px 18px rgba(30,15,5,.5); }
  100% { outline: 5px solid transparent; outline-offset: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-video { animation: none; }
}

/* ---------- Info bubble on masking tape (home, top right) ---------- */
.tape-hint {
  position: absolute;
  z-index: 8;
  top: clamp(14px, 2.4vw, 34px);
  right: clamp(10px, 2.4vw, 40px);
  width: clamp(120px, 10.5vw, 180px);
  aspect-ratio: 900 / 329;
  opacity: .78;
  padding: 0 1.3em;
  border: 0;
  background: url("../assets/tools/masking-tape-2.png") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 3px 3px rgba(40, 20, 5, .35));
  font: 700 clamp(.56rem, .68vw, .72rem)/1.15 "Courier New", Courier, monospace;
  color: var(--ink);
  cursor: pointer;
  transform: rotate(4deg);
  animation: hint-wiggle 4s ease-in-out 1.5s infinite;
  transition: opacity .3s ease, transform .3s ease;
}
.tape-hint:hover { opacity: 1; }
.tape-hint.gone { opacity: 0; transform: rotate(14deg) translateY(-20px); pointer-events: none; }
@keyframes hint-wiggle {
  0%, 88%, 100% { transform: rotate(4deg); }
  92% { transform: rotate(1deg); }
  96% { transform: rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) { .tape-hint { animation: none; } }
@media (max-width: 1100px) {
  /* sits under the ruler menu on tablets and phones */
  .tape-hint { top: calc(min(92vw, 820px) * 130 / 900 + clamp(18px, 4vw, 40px)); }
}

/* ---------- Section intro line (replaces the legend box) ---------- */
.intro-line {
  display: inline-block;
  max-width: min(680px, 100%);
  margin: 0 0 clamp(22px, 3vw, 36px);
  padding: .45em .9em .5em;
  background: rgba(251, 246, 234, .92);
  font-size: clamp(.85rem, 1vw, .98rem);
  line-height: 1.5;
  transform: rotate(-.8deg);
  box-shadow: 1px 3px 6px rgba(40, 20, 5, .3);
}

/* ---------- Directing: thumbnails with a title only ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 34px);
  margin-bottom: 40px;
}
.work {
  background: var(--paper);
  padding: 10px 10px 4px;
  box-shadow: 2px 8px 14px rgba(30, 15, 5, .45);
  transform: rotate(var(--r, 0deg));
  transition: transform .2s ease;
}
.work:hover { transform: rotate(0) translateY(-5px); }
.work-thumb { aspect-ratio: 16 / 9; width: 100%; cursor: default; }
.work-thumb.vid-screen { cursor: pointer; }
.work h3 { margin: .6em .1em .5em; font-size: 1rem; }
@media (max-width: 760px) {
  .works { grid-template-columns: 1fr 1fr; gap: 14px; }
  .work { padding: 6px 6px 2px; }
  .work h3 { font-size: .8rem; }
  .work .play { width: 40px; height: 40px; }
  .work .play::after { left: 16px; top: 12px; border-left-width: 14px; border-top-width: 8px; border-bottom-width: 8px; }
}

/* ---------- Home page background: one large pine-plank texture ---------- */
body.page-home {
  background: #d9b98f url("../assets/texture-background.jpg") center top / cover no-repeat;
  background-attachment: scroll;
}

/* ==========================================================
   Real content (v2)
   ========================================================== */

/* light pine texture on every page, fixed behind the content (works on phones too) */
body, body.page-home { background: #dcc09a; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../assets/texture-background.jpg") center / cover no-repeat;
}

/* home icon at the start of the ruler */
.menu .home-li a {
  display: inline-grid;
  place-items: center;
  font-size: 4.6cqw;
  padding: .12em .2em;
  line-height: 1;
}
.menu .home-li svg { display: block; }
.menu .home-li a[aria-current="page"] { text-decoration: none; opacity: .55; }
.menu ul { padding: 0 3.5%; }
.menu a { font-size: 3.2cqw; }

/* about: real section photos */
.snap img:first-child { display: block; width: 100%; height: auto; }
.filmstrip li img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* directing: real thumbnails */
.work-thumb { display: block; border: 0; padding: 0; overflow: hidden; background: #1b1612 center / cover no-repeat; }
.work-thumb.vid-screen { display: grid; place-items: center; }
.work-thumb.vid-screen .play { background: rgba(251, 246, 234, .85); }
.work-thumb.pic { cursor: zoom-in; }
.work-thumb.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* documents with a cover of their first page */
.docs.real .doc { min-height: 0; padding: 12px 12px 14px; }
.docs.real .doc::before { display: none; }
.doc-cover { display: block; margin-bottom: .5em; background: #f3eee4; border: 1px solid #e3dccd; }
.doc-cover img { display: block; width: 100%; height: auto; }

/* real galleries */
.g-item.real img, .g-item.real video { display: block; width: 100%; height: auto; }
.g-item.real .play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 60px; height: 60px; border-radius: 50%; background: rgba(251, 246, 234, .9);
}
.g-item.real .play::after {
  content: ""; position: absolute; left: 24px; top: 18px;
  border-left: 20px solid #2b1d14; border-top: 12px solid transparent; border-bottom: 12px solid transparent;
}
.g-item.real .dur { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.7); color: #fff; font-size: .7rem; padding: 0 .35em; }
.gallery.loops { columns: 2 380px; }

/* viewer */
.lb-media img, .lb-media video { display: block; max-width: 88vw; max-height: 80vh; width: auto; height: auto; }
.lightbox figure { cursor: default; }

/* CV */
.cv-logos { display: block; height: 26px; width: auto; margin-top: .45em; mix-blend-mode: multiply; }
.cv .links a { font-weight: 700; }
.interests { margin: 0; }

/* home snapshots with real thumbnails */
.sp-real { background: #1b1612; }
.sp-real img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-real .sp-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.sp-pdf { position: absolute; left: 6px; top: 6px; background: #b8433a; color: #fff; font-size: .6rem; padding: 0 .4em; }

@media (max-width: 760px) {
  .menu a { font-size: 3.3cqw; }
  .menu .home-li a { font-size: 4.8cqw; }
  .gallery.loops { columns: 1; }
}
/* patterned washi tape on About photos (narrow strips, two opposite corners) */
.snap .tape { width: 8%; opacity: .95; }
.snap .t1 { top: -9%; left: 2%; right: auto; bottom: auto; transform: rotate(50deg); }
.snap .t2 { bottom: -9%; right: 2%; top: auto; left: auto; transform: rotate(50deg); }

/* wood background: seamless light-pine tile repeated to cover any page size */
body, body.page-home {
  background: #e0c49d url("../assets/wood-tile-light.jpg") repeat;
  background-size: 900px auto;
}
body::before { content: none; }
@media (max-width: 760px) {
  body, body.page-home { background-size: 600px auto; }
}
/* row-by-row masonry (js/gallery.js) */
.gallery.masonry { columns: auto; display: flex; gap: 18px; align-items: flex-start; }
.gallery.masonry .gcol { flex: 1 1 0; min-width: 0; }
@media (max-width: 760px) { .gallery.masonry { gap: 12px; } }

/* ==========================================================
   v1.1 — protection + viewer navigation
   ========================================================== */
img, video { -webkit-user-drag: none; user-drag: none; }
.g-item, .work, .doc, .snap, .filmstrip, .photo, .tools, .snap-pop, .cv-photo, .me, .lightbox, .cutout-title {
  -webkit-touch-callout: none;   /* no "save image" on long-press (iOS) */
  -webkit-user-select: none;
  user-select: none;
}

/* documents are buttons now */
button.doc { font: inherit; color: inherit; text-align: left; border: 0; cursor: pointer; width: 100%; }
.docs.real .doc-type { background: #6b5f4f; }

/* viewer */
body.lb-open { overflow: hidden; }
.lightbox { grid-template-columns: auto 1fr auto; padding: 0 12px; gap: 12px; }
.lightbox figure { grid-column: 2; justify-self: center; max-width: 100%; }
.lightbox figcaption {
  position: static; display: flex; justify-content: space-between; gap: 1.5em;
  background: #fff; padding: .45em .2em 0; font-weight: 700; font-size: .85rem;
}
.lb-count { color: #6b5f4f; white-space: nowrap; }
.lb-nav {
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(251, 246, 234, .92); color: var(--ink);
  font: 700 2.4rem/1 "Courier New", monospace; padding-bottom: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.35); transition: transform .15s ease;
}
.lb-nav:hover { transform: scale(1.08); }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lightbox.single .lb-nav { visibility: hidden; }
.lb-media img, .lb-media video { max-width: calc(100vw - 180px); max-height: 78vh; }
.lb-media.pages { max-height: 80vh; overflow-y: auto; background: #e9e4da; }
.lb-pages { display: flex; flex-direction: column; gap: 10px; padding: 10px; width: min(820px, calc(100vw - 180px)); }
.lb-pages img { display: block; width: 100%; height: auto; max-width: none; max-height: none; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

@media (max-width: 760px) {
  .lightbox { grid-template-columns: 1fr; padding: 0 6px; }
  .lightbox figure { grid-column: 1; }
  .lb-nav { position: fixed; bottom: 18px; width: 48px; height: 48px; z-index: 2; }
  .lb-prev { left: 18px; }
  .lb-next { right: 18px; }
  .lb-media img, .lb-media video { max-width: 96vw; max-height: 70vh; }
  .lb-pages { width: 94vw; padding: 6px; }
  .lb-media.pages { max-height: 74vh; }
}
@media (max-width: 760px) {
  .lightbox figure { padding: 6px; max-width: calc(100vw - 12px); }
  .lb-media img, .lb-media video { max-width: calc(100vw - 24px); max-height: 68vh; }
  .lb-pages { width: calc(100vw - 24px); }
}
