/* ============================================================================
   Aquiles Barreto — Cinematic Field Notes Portfolio
   Plain CSS, no build step. Organized top to bottom:
   1. Reset & tokens
   2. Environment stage (homepage hero + lens transition)
   3. Custom cursor
   4. About section
   5. Field Notes grid + polaroid system
   6. Project page: nav, paper system, frame sections, gallery, lightbox
   7. Footer
   8. Responsive
   9. Reduced motion
   ============================================================================ */

/* ---------- 1. Reset & tokens ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --charcoal: #0b0906;
  --cream: #f4efe4;
  --cream-dim: #d9d0bd;
  --amber: #c98a4b;
  --amber-deep: #a9682f;

  --paper: #ece4d2;
  --paper-deep: #e0d5bb;
  --kraft: #c3a877;
  --kraft-deep: #a3855a;
  --ink: #241c14;
  --ink-soft: #4a3f30;

  --overlay-scrim: rgba(10, 8, 6, 0.55);
  --overlay-scrim-strong: rgba(8, 6, 4, 0.72);

  --font-display: 'Fraunces', serif;
  --font-body: 'General Sans', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-hand: 'Caveat', cursive;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html.scroll-locked, body.scroll-locked { height: 100vh; overflow: hidden; }

html, body {
  width: 100%;
  background: var(--charcoal);
  color: var(--cream);
  overflow-x: hidden;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.65;
}

@view-transition { navigation: auto; }

/* ---------- 2. Environment stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--charcoal);
  z-index: 500;
}

.project-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--charcoal);
  filter: brightness(0.6) saturate(0.8);
}

.canvas {
  position: absolute;
  top: 50%; left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  will-change: transform;
}

.env-back { filter: blur(3px); }
.env-sharp-enhance { filter: contrast(1) saturate(1) brightness(1); }

#layer1 { z-index: 10; }
#layer2 { z-index: 20; }
#layer3 { z-index: 30; }
#layer4 { z-index: 40; }
#layer5 { z-index: 50; mix-blend-mode: soft-light; }
#layer6 { z-index: 60; }
.env-sharp { z-index: 65; }
#layer7 { z-index: 70; }
#layer9 { z-index: 90; mix-blend-mode: multiply; }
#layer10 { z-index: 100; }

#layer7img {
  position: absolute;
  left: -54px;
  top: 105px;
  width: 1786px;
  height: auto;
  animation: breatheLens 8s ease-in-out infinite;
  transform-origin: 59.5% 38.2%;
}

#layer10 {
  position: absolute;
  /* .layer sets `inset: 0`, which includes `left: 0`. With both left and
     right set plus an explicit width the box is over-constrained and the
     browser drops `right`, anchoring the branch to the LEFT edge. Reset
     left/bottom to auto so `right: 0` actually wins. */
  top: 0; right: 0; left: auto; bottom: auto;
  width: 620px;
  height: auto;
  object-fit: contain;
}

.site-paint-glass, .site-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 750;
}
.site-paint-glass { mix-blend-mode: overlay; opacity: 0.4; }
.site-grain { mix-blend-mode: overlay; }

.hero-text {
  position: absolute;
  inset: 0;
  z-index: 71; /* above #layer7 (z-index 70, the hand) at every viewport width */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 48px 115px 0;
  color: var(--cream);
  pointer-events: none;
}
.hero-text::before {
  content: "";
  position: absolute;
  inset: -12px -24px auto -24px;
  height: 200px;
  background: linear-gradient(to bottom, rgba(11,9,6,0.6), transparent);
  z-index: -1;
  pointer-events: none;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(27px, 6.2vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0,0,0,0.85), 0 8px 40px rgba(0,0,0,0.7);
}
.hero-text .role {
  margin-top: 18px;
  font-size: 16px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.85;
}

.enter {
  position: absolute;
  bottom: 65px; left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: bob 3s ease-in-out infinite;
  cursor: pointer;
  pointer-events: auto;
  background: none;
}
.enter-chevrons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.enter-chevrons span {
  display: block;
  font-size: 20px;
  line-height: 1;
  transform: rotate(90deg);
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

#layer1 { animation: driftSlow 70s ease-in-out infinite; }
#layer2 { animation: driftMed 45s ease-in-out infinite; }
#layer3 { animation: swayTrees 26s ease-in-out infinite; }
#layer5 { animation: driftGrade 34s ease-in-out infinite; }
#layer6 { animation: breatheRocks 15s ease-in-out infinite; }
#layer9 { animation: driftShadow 24s ease-in-out infinite; }
#layer10 { animation: swayBranch 8s ease-in-out infinite; transform-origin: top right; }

@keyframes driftSlow { 0%, 100% { transform: scale(1.02) translate(0, 0); } 50% { transform: scale(1.04) translate(-0.4%, -0.2%); } }
@keyframes driftMed { 0%, 100% { transform: translate(0, 0) scale(1.01); } 50% { transform: translate(0.5%, 0.15%) scale(1.02); } }
@keyframes swayTrees { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(0.2%); } }
@keyframes driftGrade { 0%, 100% { transform: translate(0, 0) scale(1.005); } 50% { transform: translate(-0.3%, 0.2%) scale(1.01); } }
@keyframes breatheRocks { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes breatheLens { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.012) rotate(0.4deg); } }
@keyframes driftShadow { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-0.6%, 0.3%); } }
@keyframes swayBranch { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-0.8deg); } }

body.motion-paused .layer, body.motion-paused #layer7img, body.motion-paused .enter { animation-play-state: paused !important; }

/* ---------- 3. Custom cursor ---------- */
.focus-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--cream);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3000;
  transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out), border-color 0.2s, background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  mix-blend-mode: difference;
  opacity: 0;
}
.focus-cursor.is-visible { opacity: 1; }
.focus-cursor .cursor-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.focus-cursor[data-state="focus"], .focus-cursor[data-state="view"], .focus-cursor[data-state="play"], .focus-cursor[data-state="open"] {
  width: 74px; height: 74px;
  background: rgba(244, 239, 228, 0.08);
}
.focus-cursor[data-state="focus"] .cursor-label,
.focus-cursor[data-state="view"] .cursor-label,
.focus-cursor[data-state="play"] .cursor-label,
.focus-cursor[data-state="open"] .cursor-label { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .focus-cursor { display: none; }
}

/* ---------- 4. Site main / About ---------- */
.site-main {
  position: relative;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.site-main.revealed { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }

.about {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7vh 6vw 4vh;
}
.about-inner {
  position: relative;
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 4.5rem;
  background-color: var(--paper);
  background-image: url('../assets/env/About_page_paper.png');
  /* About_page_paper.png has a real transparent margin around the
     illustrated sheet (same source art as the project-hero paper), and
     per spec we only want the bottom 3/4 of it (where the corner stamp
     sits) visible — 125% width keeps the crop off the transparent
     side-margins, and the position is biased down to land inside that
     bottom three-quarters rather than centering on the whole sheet. */
  background-size: 125% auto;
  background-position: center 78%;
  background-repeat: no-repeat;
  color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}
.about-inner .eyebrow { color: var(--ink-soft); opacity: 0.75; }
.about-inner h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin: 0.8rem 0 1.4rem;
  line-height: 1.05;
  color: var(--ink);
}
.about-copy { font-size: 1.4rem; line-height: 1.65; color: var(--ink-soft); max-width: 46ch; }
.about-polaroid { width: 100%; }

/* ---------- 5. Field Notes grid + polaroid system ---------- */
.field-notes { padding: 2.5vh 6vw 2.5vh; position: relative; }
.field-notes-head { text-align: center; margin-bottom: 2.5rem; }
.field-notes-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  margin-top: 0.6rem;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.notes-grid {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 900px;
}

.note-card {
  position: absolute;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}
.note-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 6px; }

.notes-grid.is-hovering .note-card { opacity: 0.45; filter: saturate(0.7); transition: opacity 0.3s, filter 0.3s; }
.notes-grid.is-hovering .note-card.is-active { opacity: 1; filter: saturate(1); z-index: 50; }
.note-card.is-active { transform: scale(1.035); }

.polaroid {
  position: relative;
  display: block;
  container-type: inline-size; /* lets the caption size off the frame's own width */
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}
.polaroid[data-frame="1"] { aspect-ratio: 2258 / 2484; }
.polaroid[data-frame="1"] .polaroid-photo { left: 13.64%; top: 9.66%; width: 76.71%; height: 62.80%; }
.polaroid[data-frame="2"] { aspect-ratio: 2052 / 2514; }
.polaroid[data-frame="2"] .polaroid-photo { left: 10.14%; top: 9.55%; width: 79.53%; height: 61.58%; }
.polaroid[data-frame="3"] { aspect-ratio: 2092 / 2439; }
.polaroid[data-frame="3"] .polaroid-photo { left: 10.32%; top: 8.69%; width: 77.44%; height: 64.12%; }
.polaroid[data-frame="4"] { aspect-ratio: 1254 / 1254; }
.polaroid[data-frame="4"] .polaroid-photo { left: 14.67%; top: 11.16%; width: 70.18%; height: 65.07%; }

.polaroid-photo {
  position: absolute;
  overflow: hidden;
  background: #000;
}
.polaroid-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.4s;
  filter: saturate(0.94) contrast(1.02);
}
.note-card:hover .polaroid-photo img, .note-card.is-active .polaroid-photo img { transform: scale(1.05); }

.polaroid-frame-img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.polaroid-caption {
  position: absolute;
  left: 4%; right: 4%;
  font-family: var(--font-hand);
  /* Sized off the frame's OWN width (cqw) so every polaroid gets a caption
     in proportion to itself, and additionally divided by the title's
     character count (--caption-len, set by grid.js) so a long name like
     "Golden Table Foundation" shrinks to fit one line instead of wrapping
     and overflowing the way a fixed rem size did. The 12cqw cap is what a
     short title like "Harbor Motors" renders at. */
  font-size: min(12cqw, calc(185cqw / var(--caption-len, 16)));
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
  text-align: center;
}
/* Each frame variant's printed cardboard strip sits at a different height
   (measured from the frame PNG's own transparent photo-window bounds) —
   center the caption in *that* strip rather than a single universal
   offset, so it reads the same everywhere the way it already did on the
   frame-4 (square) variant. */
.polaroid[data-frame="1"] .polaroid-caption { bottom: 13.8%; }
.polaroid[data-frame="2"] .polaroid-caption { bottom: 14.4%; }
.polaroid[data-frame="3"] .polaroid-caption { bottom: 13.6%; }
.polaroid[data-frame="4"] .polaroid-caption { bottom: 11.9%; }

.note-reticle {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.note-card:hover .note-reticle, .note-card.is-active .note-reticle { opacity: 1; }
.note-reticle::before, .note-reticle::after {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* hover metadata lives inside the photo window itself, never outside the frame */
.note-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 10% 10px;
  background: linear-gradient(to top, rgba(8, 6, 4, 0.82), transparent);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.25s;
  line-height: 1.4;
  text-align: center;
}
.note-card:hover .note-meta, .note-card.is-active .note-meta { opacity: 1; }
.note-meta .note-meta-title { font-family: var(--font-display); font-size: 1.7rem; text-transform: none; letter-spacing: 0; display: block; margin-bottom: 3px; }

/* deterministic scatter sizing — fluid so cards scale with the viewport
   instead of a fixed px, per spec: big and prominent, but must never
   overflow/clip content on any screen. */
.note-card[data-size="small"] .polaroid { width: clamp(220px, 27vw, 360px); }
.note-card[data-size="medium"] .polaroid { width: clamp(240px, 30vw, 400px); }
.note-card[data-size="large"] .polaroid { width: clamp(260px, 34vw, 460px); }

/* ---------- 6. Project page ---------- */
.paper-body { background: var(--paper); color: var(--ink); font-family: var(--font-body); }

.project-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2rem;
  background: linear-gradient(to bottom, rgba(20, 15, 8, 0.5), transparent);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.project-nav a { display: flex; align-items: center; gap: 0.5rem; }
.project-nav .nav-counter { opacity: 0.85; }
.project-nav .nav-menu { opacity: 0.85; }

.project-content { position: relative; z-index: 10; }

/* Each Frame is a full-bleed transparent strip (just vertical breathing
   room) so the dark environment shows through as a thin gap between
   sections; the actual paper "card" lives on .frame-section inside it,
   width-matched to .about-inner and .notes-grid. */
.paper-sheet {
  position: relative;
  background: transparent;
  padding: 0.9rem 6vw;
}
.torn-top::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 14px;
  background: var(--paper);
  clip-path: polygon(0% 100%, 2% 0%, 5% 100%, 8% 10%, 12% 100%, 16% 5%, 20% 100%, 24% 15%, 28% 100%, 32% 0%, 36% 100%, 40% 10%, 44% 100%, 48% 5%, 52% 100%, 56% 15%, 60% 100%, 64% 0%, 68% 100%, 72% 10%, 76% 100%, 80% 5%, 84% 100%, 88% 15%, 92% 100%, 96% 0%, 100% 100%);
}

/* Project_Details.png is a tall film-strip graphic that already has its
   own dark margins built in along both edges — used directly as the
   section's own background (not a separate side-strip element) it
   naturally frames the content with those margins on every section. */
.frame-section {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--paper);
  background-image: url('../assets/env/Project_Details.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--ink);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
  /* Project_Details.png's own dark side-margins measure ~7.6% of its
     width; horizontal padding is a percentage (not a fixed rem) so
     content always clears them by a safe margin at any rendered width. */
  padding: 4.5rem 9%;
}
.frame-label {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ede2c7;
  margin-bottom: 1.2rem;
}
.frame-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 1.6rem;
  color: #ede2c7;
}
.frame-body p { font-size: 2.04rem; line-height: 1.6; color: #ede2c7; max-width: 62ch; text-align: justify; }

.frame-work-media {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}
.frame-work-media img, .frame-work-media video { width: 100%; display: block; }
.frame-work-media .play-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
}
.frame-work-media:hover .play-badge { opacity: 1; }
.play-badge span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--cream);
  border-radius: 40px;
}
.frame-work-caption { margin-top: 1.2rem; font-family: var(--font-mono); font-size: 2.04rem; color: #ede2c7; letter-spacing: 0.02em; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.6rem;
  margin-top: 1rem;
}
.gallery-item {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption {
  padding: 0.6rem 0.2rem 0;
  font-family: var(--font-mono);
  font-size: 2.04rem;
  color: #ede2c7;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.4rem;
  margin-top: 1rem;
}
.result-stat .stat-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.04rem;
  line-height: 1.2;
  color: #ede2c7;
}
.result-stat .stat-label {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 2.04rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ede2c7;
}
.takeaway-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.04rem;
  line-height: 1.5;
  max-width: 62ch;
  color: #ede2c7;
}

.frame-credits .credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}
.credits-grid .credit-label {
  font-family: var(--font-mono);
  font-size: 2.04rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ede2c7;
  margin-bottom: 0.5rem;
}
.credits-grid .credit-value { font-size: 2.04rem; line-height: 1.4; color: #ede2c7; }

.handwritten-note {
  position: absolute;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--amber-deep);
  transform: rotate(var(--rot, -3deg));
  pointer-events: none;
}

.next-frame {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream);
  overflow: hidden;
  cursor: pointer;
}
.next-frame-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: blur(2px) saturate(0.8);
  transition: opacity 0.5s, filter 0.5s;
}
.next-frame:hover .next-frame-bg { opacity: 0.55; filter: blur(0px) saturate(1); }
.next-frame-inner { position: relative; z-index: 2; }
.next-frame .eyebrow { color: var(--cream); }
.next-frame h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  margin-top: 0.8rem;
}
.next-frame .back-link {
  display: inline-block;
  margin-top: 2.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(6, 5, 3, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-figure { max-width: min(88vw, 1100px); max-height: 82vh; text-align: center; }
.lightbox-figure img { max-width: 100%; max-height: 74vh; object-fit: contain; margin: 0 auto; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6); }
.lightbox-caption { margin-top: 1rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--cream); opacity: 0.8; letter-spacing: 0.06em; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  padding: 0.6rem 1rem;
}
.lightbox-close { top: 1.6rem; right: 2rem; }
.lightbox-prev { left: 2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 2rem; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { color: var(--amber); }

/* ---------- 7. Footer ---------- */
.site-footer {
  padding: 6rem 6vw 4rem;
  text-align: center;
}
.site-footer.footer--dark { color: var(--cream); }
.site-footer.footer--paper { color: var(--ink); background: var(--paper); }
.site-footer .footer-email {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
}
.site-footer .footer-socials {
  margin-top: 1.6rem;
  display: flex;
  gap: 1.6rem;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.site-footer .footer-socials a:hover { opacity: 0.6; }
.site-footer .footer-copyright { margin-top: 2.4rem; font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.5; }

/* ---------- 8. Responsive ---------- */
@media (max-width: 900px) {
  .hero-text { padding: 32px 16px 0; }
  .about-inner { grid-template-columns: 1fr; padding: 2.4rem 1.6rem; }
  .about-polaroid { max-width: 260px; margin: 0 auto; }
  .frame-section { padding: 2.5rem 9%; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
}

@media (max-width: 560px) {
  .notes-grid {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.6rem;
  }
  .note-card { position: static !important; transform: none !important; }
  .note-card .polaroid { transform: rotate(var(--rot)) scale(0.92); }
}

/* ---------- 9. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #layer1, #layer2, #layer3, #layer5, #layer6, #layer7img, #layer9, #layer10, .enter {
    animation: none !important;
  }
  .site-main, .note-card, .next-frame-bg { transition: none !important; animation: none !important; }
}
