/* ───────── TOKENS ───────── */
:root {
  --bg: #07060a;
  --bg-2: #110f16;
  --ink: #f2ecf4;
  --ink-2: #a79fb0;
  --line: rgba(242, 236, 244, .12);
  --accent: #e58fa6;   /* petal rose */
  --ice: #8db3dd;      /* forget-me-not */
  --card: rgba(255, 255, 255, .03);
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter Tight", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}
[data-world="day"] {
  --bg: #e9f0f9;
  --bg-2: #dbe6f4;
  --ink: #18203a;
  --ink-2: #5a6582;
  --line: rgba(24, 32, 58, .14);
  --accent: #c24d6c;
  --ice: #2f7fd0;
  --card: rgba(255, 255, 255, .55);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .8s var(--ease), color .8s var(--ease);
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

.mono, .kicker, .section__aside, .section__num, .film__idx, .film__time, .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* world-specific inline text */
[data-world="night"] .w-day, [data-world="day"] .w-night { display: none; }

/* ───────── PETAL CANVAS ───────── */
#petals {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ───────── NAV ───────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #fff;
  transition: background .4s, color .4s, backdrop-filter .4s;
}
.nav.is-solid {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.nav__brand { font-weight: 500; letter-spacing: .3em; display: flex; align-items: center; gap: 8px; }
.nav__mark { color: var(--accent); font-size: 14px; }
.nav__sub { opacity: .45; letter-spacing: .14em; text-transform: lowercase; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { opacity: .7; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }

.world-toggle {
  position: relative;
  display: flex; align-items: center;
  border: 1px solid currentColor;
  border-radius: 99px;
  padding: 3px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
}
.world-toggle__opt { position: relative; z-index: 1; padding: 5px 10px; transition: color .4s; }
.world-toggle__knob {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  border-radius: 99px;
  background: currentColor;
  transition: transform .5s var(--ease);
}
/* the active option sits on the knob, so it takes the inverse colour */
[data-world="night"] .world-toggle__opt[data-opt="night"],
[data-world="day"] .world-toggle__opt[data-opt="day"] { color: #111; }
[data-world="night"] .nav.is-solid .world-toggle__opt[data-opt="night"],
[data-world="day"] .nav.is-solid .world-toggle__opt[data-opt="day"] { color: var(--bg); }
[data-world="day"] .world-toggle__knob { transform: translateX(100%); }

/* ───────── HERO ───────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 120px var(--gutter) 56px;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -2; background: #07060a; transition: background 1.2s var(--ease); }
[data-world="day"] .hero__bg { background: #3b86d4; }
@media (min-width: 901px) {
  .hero__img {
    left: 30%; width: 74%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
  }
  .hero__img--night { object-position: 50% 92% !important; }
  .hero__img--day { object-position: 38% 50% !important; }
}
.hero__img {
  position: absolute; inset: -4%;
  width: 108%; height: 108%;
  object-fit: cover;
  transition: opacity 1.2s var(--ease), transform 1.6s var(--ease);
  will-change: transform;
}
.hero__img--night { object-position: 70% 78%; }
.hero__img--day { object-position: 50% 40%; opacity: 0; transform: scale(1.06); }
[data-world="day"] .hero__img--night { opacity: 0; transform: scale(1.06); }
[data-world="day"] .hero__img--day { opacity: 1; transform: none; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,4,8,.78) 0%, rgba(5,4,8,.35) 45%, rgba(5,4,8,0) 70%),
    linear-gradient(0deg, rgba(5,4,8,.75) 0%, rgba(5,4,8,0) 40%);
  transition: opacity 1s;
}
[data-world="day"] .hero__veil {
  background:
    linear-gradient(90deg, rgba(12,30,70,.55) 0%, rgba(12,30,70,.15) 45%, rgba(12,30,70,0) 70%),
    linear-gradient(0deg, rgba(12,30,70,.55) 0%, rgba(12,30,70,0) 40%);
}

.hero__content { max-width: 620px; position: relative; z-index: 3; }
.kicker { display: flex; align-items: center; gap: 10px; opacity: .85; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.hero__logo { margin: 18px 0 10px -2%; }
.hero__logo img {
  width: min(440px, 80vw);
  filter: drop-shadow(0 6px 30px rgba(0,0,0,.45));
  animation: logoIn 1.8s var(--ease) both;
}
@keyframes logoIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.hero__lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  max-width: 34em;
  color: rgba(255,255,255,.86);
  animation: rise 1.2s .4s var(--ease) both;
}
.hero__lede em { font-family: var(--serif); font-size: 1.2em; color: var(--accent); }
[data-world="day"] .hero__lede em { color: #ffd7e2; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; animation: rise 1.2s .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.hero__meta {
  position: absolute; right: var(--gutter); bottom: 56px; z-index: 3;
  display: grid; grid-template-columns: auto auto; gap: 6px 22px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  text-align: right;
}
.hero__meta div { display: contents; }
.hero__meta span { opacity: .55; }
.hero__meta b { font-weight: 500; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; opacity: .6;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll i { width: 1px; height: 28px; background: linear-gradient(#fff, transparent); animation: drip 2s infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ───────── BUTTONS ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.hero .btn--solid { background: #fff; color: #111; border-color: #fff; }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ───────── MARQUEE ───────── */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 18px 0;
  position: relative; z-index: 3;
  background: var(--bg);
  transition: background .8s;
}
.marquee__track {
  display: flex; gap: 32px; width: max-content;
  font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 34px);
  white-space: nowrap;
  animation: scroll 40s linear infinite;
}
.marquee__track i { font-style: normal; color: var(--accent); font-size: .7em; align-self: center; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ───────── SECTIONS ───────── */
.section {
  position: relative; z-index: 3;
  padding: clamp(80px, 11vw, 150px) var(--gutter);
}
.section__head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px; margin-bottom: clamp(36px, 5vw, 64px);
}
.section__num { color: var(--accent); }
.section__head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 7vw, 104px); line-height: .9; letter-spacing: -.01em;
}
.section__aside { margin-left: auto; color: var(--ink-2); }

/* ───────── CANON ───────── */
.canon { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.canon__sheet { position: sticky; top: 90px; }
.canon__sheet-frame { position: relative; aspect-ratio: 1; background: var(--bg-2); }
.sheet { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .9s var(--ease); }
.sheet--day { opacity: 0; }
[data-world="day"] .sheet--day { opacity: 1; }
[data-world="day"] .sheet--night { opacity: 0; }
.corner { position: absolute; width: 18px; height: 18px; border: 1px solid var(--accent); }
.corner.tl { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -8px; right: -8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -8px; left: -8px; border-right: 0; border-top: 0; }
.corner.br { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }
.canon__sheet figcaption { margin-top: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.canon__sheet figcaption .mono { color: var(--ink); }

.canon__intro { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.22; margin-bottom: 40px; }

.traits { list-style: none; border-top: 1px solid var(--line); }
.traits li {
  display: grid; grid-template-columns: 38px 100px 1fr; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.traits__n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.traits b { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.traits p { color: var(--ink-2); font-size: 15px; }

.palette { margin-top: 40px; }
.palette .label { color: var(--ink-2); }
.palette__chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.palette__chips button {
  display: grid; gap: 2px; text-align: left;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px;
  transition: border-color .2s, transform .3s var(--ease);
}
.palette__chips button:hover { border-color: var(--c); transform: translateY(-2px); }
.palette__chips i { height: 44px; border-radius: 6px; background: var(--c); margin-bottom: 6px; }
.palette__chips code { font-family: var(--mono); font-size: 10px; color: var(--ink-2); }

/* ───────── FILMS ───────── */
.films { display: grid; gap: clamp(64px, 9vw, 130px); }
.film { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; cursor: pointer; }
.film--flip .film__media { order: 2; }
.film__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 4px; background: #000;
}
.film__media img, .film__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease), opacity .6s;
}
.film__media video { opacity: 0; }
.film.is-previewing .film__media video { opacity: 1; }
.film:hover .film__media img { transform: scale(1.04); }
.film__media::after {
  content: "▶"; position: absolute; left: 50%; top: 50%;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: grid; place-items: center; padding-left: 4px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.6);
  color: #fff; font-size: 18px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  background: rgba(0,0,0,.18);
  transition: transform .5s var(--ease), opacity .4s;
}
.film:hover .film__media::after { transform: scale(1.1); opacity: 0; }
.film__time {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  padding: 4px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff;
}
.film__idx { color: var(--accent); }
.film__body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 7vw, 112px); line-height: .9; margin: 10px 0 4px;
}
.film__tag { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink-2); margin-bottom: 18px; }
.film__body > p:not(.film__tag) { color: var(--ink-2); max-width: 32em; }
.film dl {
  display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px;
  margin: 22px 0 26px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.film dt { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding-top: 3px; }

/* ───────── GALLERY ───────── */
.filters { margin-left: auto; display: flex; gap: 6px; }
.filters button, .seg button {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line);
  transition: all .25s;
}
.filters button.is-on, .seg button.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(140px, 16vw, 240px);
  grid-auto-flow: dense;
  gap: 10px;
}
.tile {
  position: relative; overflow: hidden; border-radius: 3px; cursor: zoom-in;
  background: var(--bg-2);
  transition: opacity .5s var(--ease), transform .5s var(--ease), filter .5s;
}
.tile--tall { grid-row: span 2; }
.tile--wide { grid-column: span 2; }
.tile--sq { grid-column: span 2; grid-row: span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s, transform .4s var(--ease);
}
.tile:hover figcaption { opacity: 1; transform: none; }
.tile.is-dim { opacity: .12; filter: grayscale(1); pointer-events: none; }

/* ───────── MAKE ───────── */
.make { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.step { display: grid; grid-template-columns: 44px 1fr; padding: 20px 0; border-bottom: 1px solid var(--line); }
.step:first-child { border-top: 1px solid var(--line); }
.step span { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--accent); line-height: 1; }
.step p { color: var(--ink-2); }
.step b { color: var(--ink); font-weight: 500; }

.prompts { display: grid; gap: 14px; }
.prompt { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.prompt__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.prompt__head .copy { margin-left: auto; }
.seg { display: flex; gap: 4px; }
.copy {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--accent); color: var(--accent);
  transition: background .2s, color .2s;
}
.copy:hover { background: var(--accent); color: #fff; }
.prompt pre {
  padding: 16px; white-space: pre-wrap;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
}

/* ───────── FOOTER (always night) ───────── */
.footer {
  position: relative; z-index: 3;
  background: #050407; color: #f2ecf4;
  padding: clamp(80px, 10vw, 140px) var(--gutter) 28px;
  text-align: center;
}
.footer__logo { width: min(520px, 80vw); margin: 0 auto; }
.footer__line { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 32px); color: #a79fb0; margin: 8px 0 80px; }
.footer__row { display: flex; justify-content: space-between; color: #a79fb0; border-top: 1px solid rgba(242,236,244,.12); padding-top: 20px; }

/* ───────── MODAL ───────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 3, 6, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: 60px var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .4s, visibility .4s;
  color: #fff;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__stage { width: 100%; height: 100%; display: grid; place-items: center; }
.modal__stage img, .modal__stage video { max-width: 100%; max-height: calc(100svh - 140px); border-radius: 3px; }
.modal__stage video { width: min(1400px, 100%); background: #000; }
.modal__close { position: absolute; top: 16px; right: var(--gutter); font-size: 20px; padding: 8px; }
.modal__nav { position: absolute; top: 50%; font-size: 24px; padding: 16px; opacity: .6; transition: opacity .2s; }
.modal__nav:hover { opacity: 1; }
.modal__prev { left: 6px; }
.modal__next { right: 6px; }
.modal.is-video .modal__nav { display: none; }
.modal__cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; opacity: .65; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 99px;
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── REVEAL ───────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ───────── RESPONSIVE ───────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .world-toggle { margin-left: auto; }
  .canon, .make, .film { grid-template-columns: 1fr; }
  .canon__sheet { position: relative; top: 0; }
  .film--flip .film__media { order: 0; }
  .hero__meta, .hero__scroll { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .palette__chips { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .traits li { grid-template-columns: 30px 1fr; }
  .traits li p { grid-column: 2; }
  .section__aside { margin-left: 0; }
  .filters { margin-left: 0; }
  .grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
  .tile--tall { grid-row: span 2; }
  .tile--wide, .tile--sq { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
