/* =========================================================
   DROSERA FILMS — base stylesheet
   Palette + type from "color and font.png" (mint/teal + Jost/
   Space Mono). Logo, cursor, and this :root block are the
   places brand colors/fonts/assets need to change together —
   see the README for what's paired with what.
   ========================================================= */

:root {
  --bg: #e9f3e5;
  --fg: #082726;
  --muted: #5c7a70;
  --surface: #dce8d6;
  --border: #c7d6c0;
  --brand-green: #81cf97;
  --accent: #4f9c68;

  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Poppins", "Jost", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-label: "Space Grotesk", "Jost", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --nav-height: 84px;
  --gutter: clamp(20px, 4vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.7;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, p {
  margin: 0;
}

/* ---------- Splash (landing page) ----------
   Full-bleed looping Amma background video (Vimeo's own
   "background=1" mode: autoplay, loop, muted, no UI). The
   iframe is oversized and centered with the classic cover
   trick so it fills the viewport at any aspect ratio. Video,
   scrim, and logo are all position:fixed so the hero — and the
   clickable logo — stay put no matter what, even if something
   ever causes the page to scroll. */

.splash-body {
  background: #000;
  overflow: hidden;
  height: 100vh;
}

.splash-video-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  /* Shows instantly (it's a local file) so there's no black gap while
     the Vimeo iframe loads — the video fades in over it once playing. */
  background-image: url("../assets/gifs/Amma.gif");
  background-size: cover;
  background-position: center;
}

.splash-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100vh;
  min-width: 177.78vh; /* 16:9 */
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.splash-video.is-ready {
  opacity: 1;
}

.splash-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.3);
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.splash-logo {
  display: block;
  width: min(360px, 60vw);
  transition: opacity 0.2s ease;
}

.splash-logo img {
  width: 100%;
  height: auto;
}

/* ---------- Header ----------
   Just the centered logo now — the Work/About/Contact nav and
   mobile menu toggle were removed site-wide. `.is-overlay` is
   used on the About page, where the header floats transparent
   over the video instead of sitting on a solid bar. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nav-height);
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header.is-overlay {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: none;
}

.site-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.site-logo img {
  height: clamp(50px, 6vw, 72px);
  width: auto;
}

/* ---------- Footer ----------
   Menu (about / work / contact) sitting right above the bug icon,
   pinned to the bottom of every page that has it. The menu is set in
   Space Mono Bold, lowercase, wide-tracked — the same typeface as the
   "FILMS" in the logo. The footer itself ignores clicks
   (pointer-events: none) so it can never swallow a click meant for the
   page underneath — that is what was blocking "Back" on the long Verde
   and Skull + Bone pages — and only the menu links and the bug button
   take clicks. `.has-scrim` adds a fade to black so scrolling content
   doesn't run through the menu on the film and About pages. */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter) 24px;
  color: #fff;
}

.site-footer.is-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  pointer-events: none;
}

.site-footer.has-scrim {
  padding-top: 72px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.94) 40%, #000 62%);
}

.site-footer a,
.site-footer button {
  pointer-events: auto;
}

.footer-nav {
  display: flex;
  gap: clamp(22px, 4vw, 40px);
  padding-left: 0.3em; /* balances the trailing letter-spacing so the row looks centered */
}

.footer-nav a {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.footer-bug-btn {
  display: inline-flex;
  padding: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

.footer-bug-btn:hover {
  opacity: 0.7;
}

.footer-bug {
  width: clamp(26px, 2.6vw, 34px);
  height: auto;
}

/* ---------- Work (title list) ----------
   Modeled on mac-scott.com/selected-works: a right-justified
   stack of bold titles on black, each with the film's Vimeo id
   in a data attribute. Hovering a title fades in that film full
   -screen behind the list (background=1 embed, muted/looping,
   swapped via JS — see js/main.js); the other titles dim via
   :has() so the hovered one and the video stay the focus.
   Clicking navigates to that film's own page. */

.work-body {
  background: #000;
  overflow: hidden;
  height: 100vh;
}

.work-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.work-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.3);
}

/* All four are loaded and looping from page load (muted, so autoplay is
   allowed) — hover just crossfades opacity instead of setting src, which
   is what was causing a few seconds of black while each video buffered. */
.work-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100vh;
  min-width: 177.78vh; /* 16:9 */
  transform: translate(-50%, -50%);
  border: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.work-bg-video.is-active {
  opacity: 1;
}

.work-list-wrap {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 1vw, 10px);
  padding: calc(var(--nav-height) + 24px) var(--gutter) 150px;
}

.work-list-item {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: clamp(14px, 1.6vw, 24px);
  font-family: var(--font-display); /* Poppins, same as the About page, set bold */
  font-size: clamp(22px, 3.7vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: right;
  color: #fff;
  transition: opacity 0.25s ease;
}

.work-title {
  min-width: 0;
}

/* The kind of film (lowercase, small, muted — like "what." / "where." on the
   About page) appears to the left of a title while it's hovered or focused. */
.work-type {
  flex: none;
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.78);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.work-list-item:hover .work-type,
.work-list-item:focus-visible .work-type {
  opacity: 1;
  transform: none;
}

/* No hover on touch screens, and on phones the label would only squeeze the
   title onto two lines — so drop it from the layout there. */
@media (hover: none), (max-width: 640px) {
  .work-type {
    display: none;
  }
}

/* keep the hovered title at full brightness (the global a:hover dims links) */
.work-list-item:hover {
  opacity: 1;
}

.work-list-wrap:has(.work-list-item:hover) .work-list-item:not(:hover) {
  opacity: 0.35;
}

/* ---------- Film page ----------
   One film per page: a real (non-background) Vimeo embed with
   its own controls, title + credits below, "Back" link at the
   bottom — no descriptions, per request. */

.film-body {
  background: #000;
  color: #fff;
}

.film-header {
  display: flex;
  justify-content: center;
  padding: 40px var(--gutter) 0;
}

.film-header img {
  height: clamp(40px, 5vw, 56px);
  width: auto;
}

.film-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px var(--gutter) 200px;
}

.film-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  margin-bottom: 48px;
  overflow: hidden;
}

.film-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* GIF poster + play button shown until clicked, then swapped for the
   real Vimeo iframe (js/main.js) — same pattern used across the site
   so a video isn't loaded until someone actually wants to watch it. */
.video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #111;
}

.video-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

.video-poster:hover::after {
  background: rgba(0, 0, 0, 0.35);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.video-play::after {
  content: "";
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #000;
  margin-left: 4px;
}

/* Same type as the titles on the Work list: bold Poppins, same size, normal
   capitalization (not all caps). */
.film-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.7vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 24px;
}

.film-credits {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.film-credits + .film-credits {
  margin-top: 16px;
}

.film-credits a {
  color: var(--brand-green);
  border-bottom: 1px solid var(--brand-green);
}

/* ---------- About ----------
   Modeled on baisik.com.au/about (minus its big "about" hero image):
   a centered Poppins statement with hand-drawn underlines/circles that
   draw themselves on as they scroll into view, then lowercase labels
   ("what." "where." ...) over Poppins paragraphs in a right-hand
   column, and a full-width fold-out at the bottom. Colors are the
   site's: black, white, brand green for the hand-drawn marks. */

.about-body {
  background: #000;
  color: #fff;
}

.about-main {
  padding-bottom: 240px;
  overflow-x: clip; /* the photo marks' svg box pokes past the edges */
}

.about-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--gutter) clamp(72px, 11vw, 150px);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(23px, 2.55vw, 34px);
  line-height: 1.4;
}

.about-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 var(--gutter);
}

.about-section {
  grid-column: 2;
  max-width: 540px;
  margin-bottom: clamp(56px, 7vw, 96px);
}

.about-label {
  font-family: var(--font-label);
  font-size: 15.5px;
  line-height: 1.8;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 14px;
}

.about-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 1.75vw, 23px);
  line-height: 1.45;
}

.about-text + .about-text {
  margin-top: 1em;
}

/* Two stills in the left column, the second overlapping the first's
   bottom-right corner (the aspect-ratio reserves the room it hangs into).
   Sticky, so they stay beside the text as it scrolls. Hand-drawn green
   brackets (built in js/main.js) highlight the top-left corner of the back
   photo and the bottom-right corner of the front one. */
.about-photos {
  grid-column: 1;
  grid-row: 1 / span 4;
  position: sticky;
  top: 16vh;
  align-self: start;
  justify-self: center;
  width: min(100%, 500px);
  aspect-ratio: 100 / 78.7; /* back photo's height + the room the front one hangs into */
  margin: 0;
}

.about-photo {
  margin: 0;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-photo--a {
  width: 78%;
}

.about-photo--b {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 58%;
  box-shadow: 0 0 0 5px #000; /* keyline where it overlaps the back photo */
}

.about-photos-marks {
  position: absolute;
  left: -36px;
  top: -36px;
  width: calc(100% + 72px);
  height: calc(100% + 72px);
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.about-photos-marks path {
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 2.4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.about-photos.is-drawn .about-photos-marks path {
  opacity: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0s linear;
}

.about-photos.is-drawn .about-photos-marks path:nth-child(2) {
  transition-delay: 0.5s, 0.5s;
}

@media (max-width: 800px) {
  .about-sections {
    grid-template-columns: 1fr;
  }

  .about-section {
    grid-column: 1;
  }

  .about-photos {
    grid-column: 1;
    grid-row: auto;
    position: relative; /* not sticky here, but still the anchor for the front photo */
    top: auto; /* drop the sticky offset, or it would push the photos down */
    width: min(100%, 420px);
    margin-bottom: 72px;
  }
}

/* Hand-drawn underline / circle. The <svg> inside each .hl is sized and
   filled in by js/main.js (so strokes stay an even thickness at any word
   size), then drawn on by animating stroke-dashoffset. */
.hl {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.hl svg {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

/* SVGs don't stretch between left/right insets like normal boxes do (they
   fall back to a 300x150 default), so size them explicitly. */
.hl--underline svg {
  left: -0.12em;
  bottom: -0.12em;
  width: calc(100% + 0.24em);
  height: 0.4em;
}

.hl--circle svg {
  left: -0.45em;
  top: -0.17em;
  width: calc(100% + 0.9em);
  height: calc(100% + 0.34em);
}

.hl path {
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 0.07em;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

/* opacity flips on exactly when the draw starts (same delay), so no stray
   dot shows up while a mark is waiting for its turn */
.hl.is-drawn path {
  opacity: 1;
  stroke-dashoffset: 0;
  transition:
    stroke-dashoffset 0.9s cubic-bezier(0.65, 0, 0.35, 1) var(--delay, 0s),
    opacity 0s linear var(--delay, 0s);
}

a.hl:hover {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hl path,
  .about-photos-marks path {
    opacity: 1;
    stroke-dashoffset: 0;
    transition: none;
  }
}

/* Fold-out ("capabilities.") — full-width row between hairlines with a
   chevron; the panel animates open by growing from 0fr to 1fr. */
.about-fold {
  margin: clamp(24px, 4vw, 56px) var(--gutter) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.fold-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 30px 0;
  background: none;
  border: 0;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 1.75vw, 23px);
  line-height: 1.4;
}

.fold-arrow {
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.35s ease;
}

.about-fold.is-open .fold-arrow {
  transform: translateY(3px) rotate(225deg);
}

.fold-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.about-fold.is-open .fold-panel {
  grid-template-rows: 1fr;
}

.fold-panel-inner {
  overflow: hidden;
}

.fold-list {
  padding: 0 0 30px;
  font-family: var(--font-label);
  font-size: 16px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.85);
}
