/* Palette sampled from Design/concept.jpg (see Design/cv/palette.json) */
:root {
  --night: #040b3e;
  --navy: #071186;
  --indigo: #1c23a2;
  --violet: #3e2385;
  --purple: #6d57b3;
  --orchid: #b552e5;
  --pink: #f388fd;
  --blush: #f3c7f6;
  --ice: #c6d8f9;
  --sky: #a0b9ec;
  --ink: #0d0a2e;
  --text: #f4f1ff;
  --muted: #c9c3ec;
  --radius: 18px;
  --wrap: 1120px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html:not(.lenis) { scroll-behavior: smooth; } /* Lenis owns scrolling when present; native smooth would skew ScrollTrigger refreshes */
body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--text);
  /* vertical gradient follows the concept: night → violet → pink → indigo */
  background: linear-gradient(180deg,
    var(--night) 0%, var(--navy) 14%, var(--violet) 40%,
    #8a3fc9 58%, var(--violet) 74%, var(--ink) 100%);
  background-color: var(--night);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--pink); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 16px; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* the thin light line that runs through the whole concept */
.spine {
  position: absolute; left: 50%; top: 72px; bottom: 0; width: 1px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.7) 6%, rgba(255,255,255,.25) 60%, transparent);
}

/* Placeholders for artwork not yet supplied */
.ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6);
  border: 1px dashed rgba(255,255,255,.35); border-radius: inherit;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 10px, transparent 10px 20px);
}

/* Lenis smooth scroll (from lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Cursor glow on logo / section titles: a brighter copy of the text, masked to a circle at the cursor.
   --mx/--my are set by main.js; --glow fades it in while the cursor is near. */
.glow-text { position: relative; }
.glow-text::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  color: #fff; text-shadow: 0 0 12px #fff, 0 0 28px var(--pink), 0 0 60px var(--orchid);
  -webkit-mask: radial-gradient(circle 9rem at var(--mx, -50%) var(--my, -50%), #000 0, transparent 70%);
  mask: radial-gradient(circle 9rem at var(--mx, -50%) var(--my, -50%), #000 0, transparent 70%);
  /* never fully 0: an invisible layer is not painted, and its first paint (the 60px blur) stalls ~250 ms on the first hover;
     the mask parks the circle off the text until the cursor comes, so .01 stays invisible */
  opacity: calc(var(--glow, 0) * .99 + .01); transition: opacity .4s ease;
}

/* ---------- 1. Header ---------- */
.site-header {
  position: relative; text-align: center; padding: 20px 16px 56px;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; isolation: isolate;
  overflow: clip; /* the scaled-out star must not widen the page */
}
.site-header > :not(.nebula) { position: relative; z-index: 1; }
.site-header { --logo-size: clamp(72px, 17vw, 230px); }
.site-header .brand { margin: auto auto 0; }
.site-header .status { margin: calc(var(--logo-size) * .75) 0 0; }
.site-header .hero-cta { margin: 18px auto auto; }
.nebula { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nav { display: flex; justify-content: center; gap: clamp(14px, 4vw, 40px); font-size: 14px; letter-spacing: .06em; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 2px; }
.nav a:hover { color: var(--text); }
.nav .lang { padding: 6px 10px; border-radius: 99px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); color: var(--text); }
.brand { position: relative; margin-top: 40px; display: inline-block; }
/* tall thin star centred on the "o" (main.js sets --ox/--oy and shifts the brand so the "o" sits on the page axis) */
.spark {
  position: absolute; left: var(--ox, 50%); top: var(--oy, 40%); height: calc(var(--logo-size) * 2.5); width: var(--sw, calc(var(--logo-size) * .75));
  transform: translate(-50%, -50%); overflow: visible; z-index: 2; opacity: .85; pointer-events: none;
  filter: drop-shadow(0 0 14px #9fb4ff);
}
/* star draws itself (outline only, never filled), then breathes */
.spark path {
  fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: spark-draw 1.6s cubic-bezier(.6,0,.3,1) .3s forwards, spark-breathe 4s ease-in-out 2.4s infinite;
  transform-origin: 50% 50%; transform-box: fill-box;
}
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes spark-breathe { 50% { transform: scale(1.12); filter: drop-shadow(0 0 6px var(--pink)); } }
.logo {
  margin: 0; font: italic 300 var(--logo-size)/1 var(--serif); letter-spacing: .02em;
  text-shadow: 0 0 24px rgba(160,185,255,.55);
  animation: rise 1.2s ease .2s both;
}
.subtitle { animation: rise 1.2s ease .5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.subtitle { display: flex; justify-content: space-between; gap: 40px; margin: 14px 0 0; font-size: clamp(11px, 1.1vw, 16px); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.status { margin: 28px 0 0; font-size: 13px; }
.status span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; position: relative; z-index: 1; background: #0a1270; border: 1px solid rgba(255,255,255,.18); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #6effb0; box-shadow: 0 0 8px #6effb0; }
.status .closed i { background: #ff8a8a; box-shadow: 0 0 8px #ff8a8a; }

/* ---------- 2. Works ----------
   The stage spans the section; its child is sticky, so the character stays put (CSS only) while the
   works scroll over her, one per screen. main.js + GSAP add: scale-in/out per card, dimming, soft snap. */
.works { position: relative; }
.works-stage { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: clip; } /* clip, not hidden: keeps the child sticky; stops the scaled scene from widening the page */
.works-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: flex-end; }
/* soft aura behind her so the cut-out sits in the page instead of floating on it */
.works-sticky::before {
  content: ""; position: absolute; left: 50%; bottom: -10%; width: min(120vh, 110vw); aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(181,82,229,.35), rgba(109,87,179,.12) 45%, transparent 68%);
  opacity: var(--aura, 1);
}
.works-art { position: relative; height: 92vh; aspect-ratio: 1200 / 1346; max-width: 100vw; }
.works-figure { position: absolute; inset: 0; }
.works-character {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; will-change: transform;
}
.half-l { clip-path: inset(0 50% 0 0); }
.half-r { clip-path: inset(0 0 0 50%); }
/* constellation drawn over her as she appears (main.js builds the stars + lines) */
.constellation { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.constellation line { stroke: #e6eeff; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 4px #9fc0ff); }
.constellation circle { fill: #fff; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 18px #bcd3ff) drop-shadow(0 0 34px var(--pink)); }
.constellation .glint { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; filter: drop-shadow(0 0 3px #cfe0ff); }
/* light ray down the page axis that she unfolds from (main.js scales it in from the top) */
.ray { position: absolute; left: calc(50% - 1px); top: 0; bottom: 0; width: 2px; opacity: 0; transform-origin: 50% 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, #fff, rgba(230,238,255,.9) 70%, transparent); box-shadow: 0 0 12px 2px rgba(159,192,255,.8), 0 0 40px 6px rgba(240,135,250,.35); }
/* once the intro starts the header is only the docked logo + nav: it must not catch clicks meant for the stage */
.fx:not([data-intro=idle]) .site-header { pointer-events: none; }
.fx:not([data-intro=idle]) .site-header .nav, .fx:not([data-intro=idle]) .site-header .brand { pointer-events: auto; }
/* desktop: leave room above her for the docked logo, as in the concept (logo over her head, not on it) */
@media (min-width: 761px) { .works-art { height: min(92vh, calc(100vh - 170px)); } }
/* motion mode: the works stage lies under the header (one screen), so the timed intro plays in place */
.fx .works { margin-top: -100vh; }
.fx .site-header { position: sticky; top: 0; height: 100vh; min-height: 0; z-index: 2; }
.fx .works-figure, .fx .works-intro { opacity: 0; } /* revealed by the scene; without motion she is simply there */
.fx .works-sticky { --aura: 0; }
.works-intro, .work { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.works-intro { justify-content: flex-end; padding: 0 16px 10vh; }
.works-intro .section-title { margin: 0; font-size: clamp(44px, 8vw, 96px); text-shadow: 0 1px 2px rgba(4,11,62,.9), 0 2px 12px rgba(4,11,62,.85), 0 2px 30px rgba(4,11,62,.85); /* tight dark edge: the title sits over her white face */ }
.hero-hint { text-align: center; color: var(--text); font-size: 14px; margin: 14px 0 0; text-shadow: 0 1px 2px var(--night), 0 0 6px var(--night), 0 1px 12px var(--night); }
.hero-hint a { color: var(--blush); }
.work-strip { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
:root { --card-w: clamp(240px, 30vw, 420px); }
@media (max-width: 1000px) { :root { --card-w: min(76vw, 420px); } } /* phone and tablet: the art is the point, use the width */
.work a {
  position: relative; display: block; width: var(--card-w); aspect-ratio: 4/5;
  border-radius: 14px; overflow: hidden; background: var(--ink); text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 30px 80px rgba(4,11,62,.7), 0 0 60px rgba(181,82,229,.35);
  transition: box-shadow .25s ease;
}
.work a:hover, .work a:focus-visible { box-shadow: 0 0 0 2px var(--pink), 0 30px 80px rgba(4,11,62,.7), 0 0 80px rgba(243,136,253,.55); }
.work .ph { background-color: rgba(13,10,46,.75); }
.work img { width: 100%; height: 100%; object-fit: cover; }
.work .cap {
  position: absolute; inset: auto 0 0 0; padding: 28px 14px 12px; font-size: 13px; line-height: 1.3;
  background: linear-gradient(transparent, rgba(4,11,62,.92));
}
.work .cap b { display: block; font-weight: 700; }

/* ---------- 3. Books: one screen, three side by side ---------- */
.section-title { text-align: center; margin: 0 0 28px; font: italic 500 clamp(36px, 6vw, 56px)/1.1 var(--serif); }
.books {
  position: relative; min-height: 100vh; max-width: 1320px; margin: 0 auto; padding: 12vh 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.books .section-title { font-size: clamp(44px, 7vw, 88px); margin-bottom: 6vh; }
.book-row { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); }
/* each book is an inline flipbook: StPageFlip sizes it from the slot width and page ratio. Closed, it is one page on one
   side of an empty spread, so main.js shifts it a quarter of the spread to sit centred */
.flip { border-radius: 4px; outline-offset: 6px; filter: drop-shadow(0 20px 40px rgba(0,0,0,.4)); }
.flip.is-live { transition: translate .6s ease; }
/* no library (or until it starts): only the cover, centred and static */
.flip:not(.stf__parent) > .page-leaf { width: 50%; margin: 0 auto; aspect-ratio: 7/8; }
.flip:not(.stf__parent) > .page-leaf ~ .page-leaf { display: none; }
.page-leaf { background: #fff; overflow: hidden; }
.page-leaf img { display: block; width: 100%; height: 100%; object-fit: cover; }
.page-leaf .ph { border: 0; border-radius: 0; background-color: var(--ink); }
.page-leaf[data-density="hard"] { background: var(--ink); }
.book-nav { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.book-nav[hidden] { display: none; }
.book-nav .btn { min-height: 36px; padding: 0 16px; }
@media (prefers-reduced-motion: reduce) { .flip.is-live { transition: none; } }
.book-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 12px; font-size: 15px; }
.book-meta a { font-size: 13px; color: var(--blush); }
.books-more { margin-top: 6vh; }

/* ---------- 4. Commissions (plain, no effects) ---------- */
.commissions { position: relative; max-width: 1080px; margin: 120px auto 0; padding: 0 16px 80px; }
/* mascot and price card share one height: the card is as tall as she is */
.comm-board {
  --board-h: min(80vh, 700px);
  display: grid; grid-template-columns: calc(var(--board-h) * 402 / 917) 1fr; grid-template-rows: minmax(0, 1fr);
  gap: 24px; height: var(--board-h);
}
.mascot img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 30px rgba(4,11,62,.6)); }
.price-card {
  display: grid; grid-template-columns: 1fr minmax(200px, .42fr); height: 100%;
  color: var(--ink); background: linear-gradient(180deg, #fff 0%, var(--ice) 55%, var(--sky) 100%);
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden;
}
.price-main { display: flex; flex-direction: column; padding: 24px; }
.price-table { width: 100%; flex: 1; border-collapse: collapse; font-size: 16px; }
.price-table th, .price-table td { padding: 12px 10px; text-align: center; border-bottom: 1px solid rgba(13,10,46,.15); }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--violet); height: 1px; }
.price-table .price { font: italic 500 32px/1 var(--serif); }
.price-extras { padding: 24px; border-left: 1px solid rgba(13,10,46,.15); background: rgba(255,255,255,.35); }
.price-extras h3 { margin: 6px 0 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--violet); }
.price-extras ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 14px; }
.price-extras li { padding-left: 16px; position: relative; }
.price-extras li::before { content: "✦"; position: absolute; left: 0; color: var(--orchid); font-size: 11px; top: 2px; }
.price-extras h4 { margin: 18px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--violet); }
.price-extras p { margin: 0 0 6px; font-size: 13px; }
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.do-dont ul { gap: 6px; font-size: 13px; }
.price-extras .no li::before { content: "✕"; color: #c0395a; }
.price-extras .methods { font-weight: 700; color: var(--violet); }
.fine { font-size: 12px; opacity: .75; margin: 12px 0 0; }
.cta-row { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px;
  border-radius: 99px; font: 600 15px var(--sans); text-decoration: none; cursor: pointer; border: 0;
}
.btn-primary { background: var(--sky); color: var(--ink); box-shadow: 0 0 24px rgba(160,185,236,.55); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sky); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.terms { margin: 32px auto 0; max-width: 640px; background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 18px; }
.terms summary { cursor: pointer; font-weight: 600; }

/* ---------- 5. Contacts ---------- */
.contacts {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  max-width: var(--wrap); margin: 0 auto 32px; padding: 22px 28px; border-radius: var(--radius);
  background: var(--pink); color: var(--ink);
}
.contacts-label { margin: 0; font: italic 500 32px/1 var(--serif); }
.contacts ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; flex: 1; }
.contacts a { font-weight: 600; }
.contacts-mail { margin-left: auto; }

/* ---------- Dialogs ---------- */
.modal {
  width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 0; border-radius: var(--radius);
  padding: 24px; color: var(--text); background: linear-gradient(180deg, #120d4a, #24135c);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 30px 80px rgba(0,0,0,.6);
}
.modal::backdrop { background: rgba(4,11,62,.75); backdrop-filter: blur(4px); }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal h2 { margin: 0; font: italic 500 30px/1.1 var(--serif); }
.x { all: unset; cursor: pointer; font-size: 28px; line-height: 1; padding: 4px 10px; border-radius: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.grid .wide { grid-column: 1 / -1; }
.grid .check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.grid input:not([type=checkbox]), .grid select, .grid textarea {
  font: 15px var(--sans); color: var(--text); background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.grid select option { color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.turnstile:not(:empty) { margin-bottom: 14px; min-height: 65px; }
.form-status { min-height: 1.4em; font-size: 14px; }

/* ---------- Responsive ---------- */
/* phone/tablet: she is width-bound, so her cut-off bottom edge and the aura's box show as the scene leaves; fade them out */
@media (max-width: 1000px) {
  .works-sticky { -webkit-mask: linear-gradient(to top, transparent 16%, #000 40%); mask: linear-gradient(to top, transparent 16%, #000 40%); }
}
@media (max-width: 760px) {
  :root { --card-w: 72vw; }
  .works-art { height: 70vh; }
  .book-row { grid-template-columns: 1fr; }
  .comm-board { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .mascot { display: none; }
  .price-card { grid-template-columns: 1fr; }
  .price-main, .price-extras { padding: 14px 10px; }
  .price-extras { border-left: 0; border-top: 1px solid rgba(13,10,46,.15); }
  .price-table { font-size: 12px; }
  .price-table thead th { font-size: 10px; letter-spacing: .02em; }
  .price-table th, .price-table td { padding: 10px 3px; }
  .price-table .price { font-size: 20px; }
  .nav { gap: 10px 16px; flex-wrap: wrap; }
  .grid { grid-template-columns: 1fr; }
  .subtitle { gap: 16px; font-size: 11px; }
  .contacts-mail { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .spark path { stroke-dashoffset: 0; }
}
