/* Carla Botcoin: shared components. Use only the role variables from tokens.css
   (--ground --raised --ink --muted --accent --fill --on-fill --spice --rule
   --radius --glow --font-display --font-body --font-label). Never a world token,
   never a hard-coded colour or font.

   Optional hooks a world file may set (all have defaults here):
     --grain          texture overlay opacity (0 to 0.12)
     --enter          entrance animation for .reveal blocks
     --title-case     text-transform for hero and section titles
     --title-track    letter-spacing for the hero title
     --head-track     letter-spacing for section titles
     --title-style    font-style for titles
     --title-weight   font-weight for titles */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; font-weight: var(--title-weight, 400); }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--fill); color: var(--on-fill); }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--space-3); }
@media (min-width: 760px) { .wrap { padding-inline: var(--space-5); } }

.skip {
  position: absolute; left: var(--space-3); top: -100px; z-index: 100;
  background: var(--fill); color: var(--on-fill); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
}
.skip:focus { top: var(--space-3); }

/* ---- layering: ground < texture < content < control < curtain */
.texture {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--grain, 0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.6 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---- header and nav */
.site-header { background: var(--raised); border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); padding-block: var(--space-2); }
.brand-svg { height: 40px; width: auto; }
.brand-text { font-family: var(--font-display); font-size: 1.125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.brand-o { color: var(--bitcoin); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.site-nav a { font-family: var(--font-label); font-size: 0.9375rem; color: var(--ink); text-decoration: none; display: inline-block; padding-block: var(--space-2); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }
.nav-toggle { display: none; }
.social { list-style: none; margin: 0 auto 0 0; padding: 0; display: flex; gap: var(--space-2); }
.social-btn {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 40px; min-width: 40px; padding: 0 0.7em;
  border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none;
  font-family: var(--font-label); font-size: 0.8125rem;
}
.social-btn svg, .btn-follow svg { width: 18px; height: 18px; flex: none; }
.social-btn:hover, .social-btn:focus-visible { color: var(--accent); border-color: var(--accent); }
.social-label { display: none; }

@media (max-width: 1199px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3);
    background: transparent; border: 1px solid var(--rule); border-radius: var(--radius);
    font-family: var(--font-label); color: var(--ink); cursor: pointer;
  }
  .js .site-nav { display: none; width: 100%; padding-bottom: var(--space-3); order: 5; }
  .bar { gap: var(--space-2); }
  .social { gap: 6px; }
  .social-btn { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
}
@media (max-width: 400px) {
  .bar { gap: 6px; }
  .brand-text { font-size: 0.8125rem; letter-spacing: 0.02em; }
  .brand-svg { height: 28px; }
  .social { gap: 4px; }
  .social-btn { min-width: 40px; min-height: 40px; }
  .js .nav-toggle { font-size: 0; min-width: 44px; justify-content: center; padding: 0; }
  .js .nav-toggle::before { content: "\2630"; font-size: 1.25rem; line-height: 1; }
  .js .nav-toggle { padding: 0 0.75em; }
  .brand-text { font-size: 0.9375rem; letter-spacing: 0.04em; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding-block: var(--space-2); min-height: 44px; display: flex; align-items: center; }
  .brand-svg { height: 32px; }
}

/* ---- shared type */
.eyebrow, .meta, .ph-note, .fine { font-family: var(--font-label); color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.06em; }
.eyebrow { margin: 0 0 var(--space-2); }
.meta { margin: 0 0 var(--space-1); }
.signoff { font-family: var(--font-display); color: var(--ink); font-size: 1.25rem; }
.prose { max-width: 38em; }
.prose p:last-child { margin-bottom: 0; }
.empty { color: var(--muted); font-style: italic; margin: 0; }

/* ---- buttons and links */
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.6em 1.3em;
  background: var(--fill); color: var(--on-fill); border-radius: var(--radius);
  font-family: var(--font-label); font-weight: 600; text-decoration: none; border: 0;
}
.btn-primary { box-shadow: var(--glow); }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline-color: var(--ink); }
.link { font-family: var(--font-label); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin: var(--space-4) 0 0; }

/* ---- placeholders (until approved images arrive) */
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  background: var(--raised); color: var(--muted); text-align: center; padding: var(--space-3);
  border: 1px solid var(--rule);
}
.ph-name { font-family: var(--font-display); color: var(--ink); font-size: 1.25rem; }

/* ---- hero: a film still, then the title below it (never over her face) */
.hero { position: relative; }
.hero-screen { background: color-mix(in srgb, var(--raised) 55%, var(--ground)); }
/* the full 16:9 frame, never cropped; on wide screens it is capped like a cinema screen */
.hero-media { position: relative; overflow: hidden; width: min(100%, 1440px, calc(68vh * var(--ar, 16 / 9))); margin-inline: auto; background: var(--raised); }
.hero-img, .hero-img img { width: 100%; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; border-radius: var(--radius-frame); }
.hero-media .ph { aspect-ratio: 16 / 9; border: 0; }
.hero-media .ph-name { font-size: clamp(1.5rem, 5vw, 3rem); }
.hero-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-copy { padding-block: var(--space-5) var(--space-3); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: var(--title-track, 0);
  text-transform: var(--title-case, none);
  font-style: var(--title-style, normal);
  max-width: 14em;
  overflow-wrap: break-word;
}
.tagline { font-size: 1.125rem; max-width: 34em; margin: var(--space-3) 0 0; }

/* ---- section blocks */
.blocks { padding-bottom: var(--space-6); }
.block { padding-top: var(--space-5); }
.block + .block { border-top: 1px solid var(--rule); margin-top: var(--space-5); }
@media (min-width: 760px) { .block { padding-top: var(--space-6); } .block + .block { margin-top: var(--space-6); } }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.block-title {
  font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2rem); line-height: 1.15;
  letter-spacing: var(--head-track, 0); text-transform: var(--title-case, none); font-style: var(--title-style, normal);
}
h1.block-title { font-size: clamp(1.6rem, 7vw, 3.5rem); }
.block-title, .card-title { overflow-wrap: break-word; hyphens: auto; }
.block-num { display: none; }
.more { font-family: var(--font-label); margin-left: auto; }
.page { padding-top: var(--space-5); padding-bottom: var(--space-6); }
.page .block { padding-top: 0; }
.main-home .blocks > .block:first-child { padding-top: var(--space-3); }

/* ---- grids and cards */
.grid { display: grid; gap: var(--space-4); }
.grid-video { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-feature { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.grid-shots { /* justified rows: every image in a row shares one height, widths follow each image's own shape, order is kept */
  --row: 190px; display: flex; flex-wrap: wrap; align-items: flex-start; }
.grid-shots > .shot { flex: var(--ar, 0.8) 1 calc(var(--ar, 0.8) * var(--row)); min-width: 0; }
.grid-shots::after { content: ""; flex: 10 1 0; } /* keeps a short last row from stretching */
.grid-shots .shot-img img { aspect-ratio: var(--ar, 0.8); height: auto; object-fit: cover; display: block; }
.grid-shots .shot .ph { aspect-ratio: var(--ar, 0.8); }
@media (max-width: 760px) { .grid-shots { --row: 150px; } }
@media (max-width: 520px) { .grid-shots { --row: 110px; gap: var(--space-3); } }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 0; }
.card-body { padding: var(--space-3); }
.card-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; margin-bottom: var(--space-1); }
.card-text { margin: var(--space-2) 0 0; }

.embed { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--ground); overflow: hidden; color: var(--ink); }
.embed .poster, .embed .poster img, .embed .ph { width: 100%; height: 100%; object-fit: cover; }
.embed .ph { border: 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: var(--fill); box-shadow: var(--glow);
}
.play::after {
  content: ""; position: absolute; left: 26px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent var(--on-fill);
}
.embed:hover .play, .embed:focus-visible .play { transform: scale(1.08); }

.shot { background: transparent; border: 0; }
.shot-link { display: block; }
.shot-img, .shot-img img { width: 100%; border-radius: var(--radius-frame); }
.shot .ph { aspect-ratio: var(--ar, 4 / 5); }
.shot figcaption { font-family: var(--font-label); color: var(--muted); font-size: 0.8125rem; padding-top: var(--space-2); display: grid; gap: 2px; }
.shot .chapter { color: var(--ink); }

/* ---- development builds only: images still awaiting Carla's sign-off */
.preview-banner {
  position: relative; z-index: 2; margin: 0; padding: var(--space-2) var(--space-3); text-align: center;
  background: var(--fill); color: var(--on-fill); font-family: var(--font-label); font-size: 0.8125rem;
}
.preview-banner code { font-family: inherit; font-weight: 600; }
.review { font-family: var(--font-label); font-size: 0.75rem; color: var(--muted); font-style: italic; }
.hero-review { margin: 0; padding-block: var(--space-1); text-align: center; }

.dispatches { display: grid; gap: var(--space-4); max-width: 46em; }
.dispatch { padding: var(--space-4); }

.follow-block p { max-width: 34em; }
.follow-links { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.follow-links a { display: inline-flex; align-items: baseline; gap: 0.4em; min-height: 44px; align-items: center; font-family: var(--font-label); font-size: 1.0625rem; }
.handle { color: var(--muted); font-size: 0.875em; }

/* ---- footer */
.site-footer { background: var(--raised); border-top: 1px solid var(--rule); padding-block: var(--space-5) calc(var(--space-6) + var(--space-3)); }
.foot-title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: var(--space-3); }
.site-footer .signoff { margin: var(--space-3) 0 var(--space-2); }
.fine { margin: 0; }

/* ---- the one element that never changes: same corner, same colours, every world */
.choose-control {
  position: fixed; right: var(--space-3); bottom: var(--space-3); z-index: 50;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1em;
  background: var(--bitcoin); color: var(--chooser-ground); border-radius: 999px;
  font-family: var(--brand-font-credits); font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
  text-decoration: none; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.choose-control:hover { text-decoration: underline; }
.choose-control:focus-visible { outline: 2px solid var(--bitcoin); outline-offset: 3px; box-shadow: 0 0 0 3px var(--chooser-ground); }

/* ---- lightbox */
.lightbox { border: 0; padding: 0; background: var(--ground); max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: var(--ink); }
.lightbox::backdrop { background: var(--ground); }
.lightbox-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: var(--space-5) var(--space-3); gap: var(--space-3); }
.lightbox img { max-height: calc(100vh - 160px); width: auto; max-width: 100%; object-fit: contain; }
.lightbox p { color: var(--ink); font-family: var(--font-label); max-width: 40em; text-align: center; margin: 0; }
.lightbox-bar { display: flex; gap: var(--space-2); }
.lightbox button {
  min-height: 44px; min-width: 44px; padding: 0 var(--space-3); cursor: pointer;
  background: var(--raised); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-label);
}

/* ---- page transitions: a quick fade through black between worlds (300 ms) */
.curtain { position: fixed; inset: 0; z-index: 1000; background: #000; opacity: 0; pointer-events: none; transition: opacity 150ms ease-in; }
.leaving .curtain { opacity: 1; }
.arriving .curtain { animation: curtain-out 150ms ease-out both; }
@keyframes curtain-out { from { opacity: 1; } to { opacity: 0; } }

/* ---- entrances (worlds override --enter) */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; }
.js .reveal.in { animation: var(--enter, rise-in 500ms cubic-bezier(.2, .7, .2, 1)) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal.in { animation: fade-in 300ms linear both !important; }
  .hero-fx * { animation: none !important; }
  .embed:hover .play { transform: none; }
}

/* Business inquiries, Work with Carla, share on X */
.inquiry, .work-inquiry { max-width: 40em; margin: var(--space-3) 0 0; color: var(--muted); }
.inquiry a, .work-inquiry a { color: var(--accent); overflow-wrap: anywhere; }
.inquiry .work-link { white-space: nowrap; }
.share-cta { flex-basis: 100%; margin: var(--space-4) 0 0; padding: var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--raised); }
.share-line { margin: 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.share-line a { color: var(--accent); }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin: var(--space-3) 0 0; }
.work-text { max-width: 46em; }
.work-strip, .work-band { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); }
.work-band { margin: var(--space-5) 0; }
.work-shot { margin: 0; flex: var(--ar) 1 calc(var(--ar) * 150px); min-width: 0; }
.work-shot img { display: block; width: 100%; height: auto; }
.work-range { margin: var(--space-5) 0; }
.work-range-note { color: var(--muted); max-width: 40em; }
.range { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
@media (min-width: 760px) { .range { grid-template-columns: repeat(4, 1fr); } }
.range-tile { display: block; position: relative; text-decoration: none; color: var(--ink); background: var(--raised); }
.range-img img { display: block; width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; }
.range-name { display: block; padding: 0.5em 0.7em; font-family: var(--font-label); font-size: 0.875rem; letter-spacing: 0.04em; }
.range-tile:hover .range-name, .range-tile:focus-visible .range-name { color: var(--accent); }
.work-title { margin: 0 0 var(--space-3); }
.work-lede { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); color: var(--ink); line-height: 1.2; }
.work-h { font-family: var(--font-display); font-size: 1.375rem; margin: var(--space-5) 0 var(--space-2); }
.work-text ul { padding-left: 1.2em; margin: 0; }
.work-text li { margin: 0 0 var(--space-2); }
.work-cols { display: grid; gap: 0 var(--space-5); }
@media (min-width: 760px) { .work-cols { grid-template-columns: 1fr 1fr; } }
.work-page { padding-block: var(--space-5); }
.lb-share { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); color: var(--accent); font-family: var(--font-label); }

/* One image per page (what a shared link opens) */
.shot-full { margin: var(--space-3) 0 0; }
.shot-full img { display: block; max-width: 100%; height: auto; max-height: 85vh; width: auto; margin: 0 auto; }
.shot-full figcaption { color: var(--muted); font-family: var(--font-label); margin-top: var(--space-2); text-align: center; }
.shot-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin: var(--space-4) 0 0; }
.shot-nav a { min-height: 44px; display: inline-flex; align-items: center; }

.btn-follow { gap: 0.5em; background: var(--raised); color: var(--ink); border: 1px solid var(--rule); box-shadow: none; font-weight: 500; }
.btn-follow:hover, .btn-follow:focus-visible { border-color: var(--accent); color: var(--accent); filter: none; }
.btn-follow .handle { color: var(--muted); font-weight: 400; }

.share-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 1001; margin: 0;
  max-width: min(92vw, 34em); padding: 0.8em 1.1em; background: var(--raised); color: var(--ink);
  border: 1px solid var(--accent); border-radius: var(--radius); font-family: var(--font-label); font-size: 0.9375rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); transition: opacity 0.5s;
}
.share-toast.out { opacity: 0; }

.share-hint { margin: var(--space-2) 0 0; color: var(--muted); font-family: var(--font-label); font-size: 0.8125rem; }
.lightbox .share-hint { text-align: center; }
@media (pointer: coarse) { .share-hint { display: none; } }
.share-toast a { color: var(--accent); }
