/* KINEMA — engraving in a storm. Black and white everywhere; the product file card is the only orange thing. */
:root {
  --bg: #070707;
  --ink: #f1eee8;
  --ink-2: #c9c4bb;
  --muted: #8d8881;
  --orange: #ec5f1a;
  --orange-hot: #ff8a3d;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: var(--tg-content-safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 600 18px/1.4 "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(160px + var(--safe-b));
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[data-ink], [data-ink-line], [data-ink-circle] { position: relative; }
.ink-svg { position: absolute; pointer-events: none; overflow: visible; z-index: 0; }
.ink-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------ the storm */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 45%, rgba(7, 7, 7, .78), rgba(7, 7, 7, .25) 75%); }
.sky-img { position: absolute; inset: -4%; background: url("/img/storm.webp") center top / cover no-repeat; opacity: .26; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04) translate3d(-1%, 0, 0); } to { transform: scale(1.08) translate3d(1%, -1.5%, 0); } }
#bolt { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
#bolt path { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
#flash { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .05) 60%); opacity: 0; }

/* ------------------------------------------------ top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: calc(8px + var(--safe-t)) 20px 8px;
  background: linear-gradient(rgba(7, 7, 7, .92), rgba(7, 7, 7, .78));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 16px/1 Cinzel, serif; letter-spacing: .32em; padding-left: .32em; }
.brand img { width: 46px; height: auto; }

main { position: relative; z-index: 1; }

/* ------------------------------------------------ views */
.view { display: none; padding: 0 20px; animation: viewIn .5s var(--ease) both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ hero: the file card + its roots */
.hero { position: relative; padding: 34px 0 30px; }
.roots { position: absolute; left: -20px; right: -20px; top: -40px; height: calc(100% + 110px); width: calc(100% + 40px); overflow: visible; pointer-events: none; z-index: 0; }
.roots path { fill: none; stroke: var(--orange); stroke-linecap: round; stroke-linejoin: round; }
.roots .root { animation: rootPulse var(--d, 2.6s) ease-in-out var(--dl, 0s) infinite; }
@keyframes rootPulse { 0%, 100% { opacity: .38; } 45% { opacity: .85; } 60% { opacity: .55; } }
.roots .spark { stroke: var(--orange-hot); filter: drop-shadow(0 0 4px rgba(255, 138, 61, .95)); animation: sap var(--d, 3s) linear var(--dl, 0s) infinite; }
@keyframes sap { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -260; } }
.roots-glow { filter: drop-shadow(0 0 5px rgba(236, 95, 26, .4)); }

.file {
  position: relative; z-index: 2; text-align: center; padding: 16px 16px 22px; width: min(80%, 330px); margin: 0 auto;
  background: radial-gradient(120% 80% at 50% 30%, rgba(236, 95, 26, .16), rgba(7, 7, 7, .92) 70%), #090706;
  color: var(--orange);
  animation: fileIn 1.1s var(--ease) .1s both;
}
@keyframes fileIn { from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.file-ear { position: absolute; top: 0; right: 0; width: 34px; height: 34px; z-index: 3;
  background: linear-gradient(225deg, var(--bg) 0 50%, transparent 50%); }
.file-ear::after { content: ""; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 0 calc(50% - 1px), var(--orange) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
.file-art { width: 84%; height: auto; margin: 0 auto; aspect-ratio: 1; object-fit: contain; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(236, 95, 26, 0)); } 50% { transform: translateY(-5px) scale(1.01); filter: drop-shadow(0 0 14px rgba(236, 95, 26, .35)); } }
.file-name { margin-top: 6px; font: 900 40px/1 Cinzel, serif; letter-spacing: .16em; padding-left: .16em; text-shadow: 0 0 22px rgba(236, 95, 26, .45); }
.file-sub { margin-top: 10px; font: 700 12px/1 Cinzel, serif; letter-spacing: .3em; text-transform: uppercase; }
.file-lead { margin: 12px auto 0; max-width: 270px; font: 600 17px/1.35 "Cormorant Garamond", serif; color: #f2b48f; }
.file-price { margin-top: 14px; font: 800 30px/1 Cinzel, serif; letter-spacing: .06em; }
.file-buy { margin-top: 16px; height: 52px; }

/* ------------------------------------------------ blocks */
.block { margin-top: 64px; position: relative; z-index: 1; }
.h2 { position: relative; z-index: 1; font: 800 25px/1.15 Cinzel, serif; letter-spacing: .06em; margin-bottom: 20px; text-transform: uppercase; text-shadow: 0 0 14px #070707, 0 0 4px #070707; }
.title { font: 800 30px/1.1 Cinzel, serif; letter-spacing: .06em; margin: 18px 0 22px; text-transform: uppercase; }
.center { text-align: center; }
.muted { color: var(--muted); }

.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feat { padding: 0 0 16px; background: #0a0a0a; transition: transform .35s var(--ease); }
.feat:active { transform: scale(.98); }
.feat img { width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0 0 2px; }
.feat h3, .feat p { padding: 0 12px; }
.feat h3 { font: 800 15px/1.2 Cinzel, serif; letter-spacing: .08em; text-transform: uppercase; }
.feat p { margin-top: 5px; font-size: 16px; line-height: 1.3; color: var(--ink-2); }

.reels { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 6px 20px 10px; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; flex: 0 0 60%; aspect-ratio: 9 / 16; padding: 5px; background: #0a0a0a; scroll-snap-align: center; transition: transform .35s var(--ease); }
.reel:active { transform: scale(.97); }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) contrast(1.08); transition: filter .6s var(--ease); }
.reel-tag { position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 6px 10px; background: var(--bg); font: 700 11px/1 Cinzel, serif; letter-spacing: .1em; color: var(--ink); }


/* ------------------------------------------------ engravings come out of the dark — never a pasted rectangle */
.feather {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 17%, #000 68%, transparent 100%), linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 17%, #000 68%, transparent 100%), linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%);
  mask-composite: intersect;
}
/* feature cards: the engraving fills the card and melts into it under the text */
.feat img {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 52%, transparent 98%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 0, #000 52%, transparent 98%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}
.art-bleed { width: calc(100% + 40px); max-width: none; margin: 0 -20px 2px; translate: 0 var(--py, 0px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; padding: 16px 16px 18px; background: #0a0a0a; }
.steps b { flex: 0 0 40px; height: 40px; display: grid; place-items: center; font: 800 14px/1 Cinzel, serif; letter-spacing: .04em; }
.steps h3 { font: 800 16px/1.2 Cinzel, serif; letter-spacing: .08em; text-transform: uppercase; }
.steps p { margin-top: 4px; font-size: 17px; color: var(--ink-2); }

.needs { list-style: none; margin: 0; padding: 0; }
.needs li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; }
.needs span { color: var(--muted); font: 700 12px/1.6 Cinzel, serif; letter-spacing: .14em; text-transform: uppercase; }
.needs b { font-weight: 700; text-align: right; }

.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; font: 700 19px/1.25 "Cormorant Garamond", serif; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 500 26px/1 Cinzel, serif; color: var(--muted); transition: transform .35s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); animation: viewIn .35s var(--ease) both; }

.foot { display: flex; justify-content: center; gap: 24px; margin: 46px 0 10px; font: 700 11px/1 Cinzel, serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------ orders / help */
.orders { display: grid; gap: 14px; }
.order { padding: 16px; background: #0a0a0a; animation: viewIn .4s var(--ease) both; }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order-id { font: 800 15px/1.2 Cinzel, serif; letter-spacing: .06em; }
.order-date { font-size: 15px; color: var(--muted); margin-top: 3px; }
.chip { padding: 6px 10px; font: 700 11px/1 Cinzel, serif; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--muted); color: var(--ink-2); white-space: nowrap; }
.chip.ok { border-color: var(--ink); color: var(--ink); }
.order .btn { margin-top: 14px; }
.empty { text-align: center; padding: 6px 0 30px; }
.empty img { width: 92%; margin: 0 auto 4px; }
.empty p { color: var(--muted); margin: 6px 0 22px; }
.help-art { width: calc(100% + 40px); max-width: none; margin: 0 -20px 8px; }
.help-item { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font: 700 14px/1.2 Cinzel, serif; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
.help-item i { font-style: normal; color: var(--muted); transition: transform .3s var(--ease); }
.help-item:active i { transform: translateX(4px); }
.install { margin-top: 36px; }
.mini { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--ink-2); }

/* ------------------------------------------------ buttons (black & white, drawn) */
.btn { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; height: 58px; padding: 0 22px;
  font: 800 15px/1 Cinzel, serif; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: rgba(7, 7, 7, .85);
  transition: transform .2s var(--ease), color .3s, background .3s; }
.btn > span { position: relative; z-index: 2; }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-main { background: var(--ink); color: var(--bg); }
.btn-main .ink-svg path { stroke: var(--bg); }
.btn-price { padding-left: 14px; border-left: 1.5px solid currentColor; }
#back-to-bot { margin-top: 26px; }

/* ------------------------------------------------ buy bar + tabs */
.buybar { position: fixed; left: 0; right: 0; bottom: calc(74px + var(--safe-b)); z-index: 30; padding: 26px 16px 10px; background: linear-gradient(rgba(7, 7, 7, 0), #070707 42%); transition: transform .45s var(--ease), opacity .3s; }
.buybar.is-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 10px calc(6px + var(--safe-b)); background: rgba(7, 7, 7, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0 4px; color: var(--muted); font: 700 10px/1 Cinzel, serif; letter-spacing: .12em; text-transform: uppercase; transition: color .25s; }
.tabs img { width: 36px; height: 36px; opacity: .42; transition: opacity .3s var(--ease), transform .4s var(--ease), filter .3s var(--ease); }
.tabs button.is-active { color: var(--ink); }
.tabs button.is-active img { opacity: 1; transform: translateY(-1px) scale(1.1); filter: drop-shadow(0 0 7px rgba(241, 238, 232, .35)); }
.tabs button:active img { transform: scale(.92); }

/* ------------------------------------------------ sheet, player, toast */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; padding: 12px 20px calc(22px + var(--safe-b)); background: #0b0b0b; transform: translateY(105%); transition: transform .5s var(--ease); max-height: 92vh; overflow-y: auto; }
.sheet.is-on { transform: none; }
.sheet-grip { width: 46px; height: 3px; background: var(--muted); margin: 0 auto 16px; opacity: .6; }
.sheet h2 { font: 800 22px/1.2 Cinzel, serif; letter-spacing: .06em; text-transform: uppercase; }
.sheet p { color: var(--ink-2); margin-top: 8px; }
.sheet .btn { margin-top: 18px; }
.sheet-art { width: 84%; margin: -6px auto 2px; }
.line-item { display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; padding: 12px; color: var(--orange); background: #0d0806; }
.line-item img { width: 62px; height: 62px; object-fit: contain; }
.line-item div { flex: 1; }
.line-item b { display: block; font: 900 18px/1.1 Cinzel, serif; letter-spacing: .12em; }
.line-item span { font-size: 15px; color: #f2b48f; }
.line-item strong { font: 800 18px/1 Cinzel, serif; }
.agree { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 17px; color: var(--ink-2); cursor: pointer; }
.agree input { position: absolute; opacity: 0; }
.agree .box { flex: 0 0 22px; height: 22px; margin-top: 1px; display: grid; place-items: center; font: 800 14px/1 Cinzel, serif; }
.agree input:checked + .box::after { content: "✕"; }
.agree a { text-decoration: underline; text-underline-offset: 3px; }
#yk { margin-top: 14px; min-height: 0; }

.player { position: fixed; inset: 0; z-index: 50; background: #000; display: none; align-items: center; justify-content: center; }
.player.is-on { display: flex; animation: viewIn .3s var(--ease) both; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.player-close { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; width: 42px; height: 42px; border: 1px solid var(--ink); color: var(--ink); font-size: 16px; background: rgba(0, 0, 0, .5); }

.toast { position: fixed; left: 50%; bottom: calc(160px + var(--safe-b)); z-index: 60; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; background: var(--ink); color: var(--bg); font: 700 16px/1.3 "Cormorant Garamond", serif; max-width: 86%; text-align: center; transition: all .4s var(--ease); pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(7, 7, 7, .35); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ reveal */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }
/* rise out of the darkness: blurred and unlit -> sharp; feature art lights up after its card appears */
.rise { transform: scale(1.06); filter: blur(10px) brightness(.22); transition: opacity 1.3s var(--ease), transform 1.9s var(--ease), filter 1.7s var(--ease); }
.rise.is-in { transform: none; filter: none; }
.feat img { filter: blur(6px) brightness(.25); transform: scale(1.05); transition: filter 1.6s var(--ease) .2s, transform 1.9s var(--ease) .2s; }
.feat.is-in img { filter: none; transform: none; }
/* a lightning strike lights the gods for a moment, then they fade back slowly */
.lit .rise.is-in, .lit .feat.is-in img, .lit .help-art, .lit .file-art { filter: brightness(1.6) drop-shadow(0 0 12px rgba(241, 238, 232, .3)); transition: filter .05s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .rv { opacity: 1; transform: none; } }
@media (min-width: 640px) {
  .view, .top { max-width: 560px; margin-left: auto; margin-right: auto; }
  .reel { flex-basis: 42%; }
  .buybar { max-width: 560px; margin: 0 auto; }
}
/* ?shot — static render for screenshots / QA */
.shot *, .shot *::before, .shot *::after { animation: none !important; transition: none !important; }
.shot .rv { opacity: 1; transform: none; }
.shot .rise, .shot .feat img { filter: none; transform: none; }
