/* Shared styles for the MKV Player site (index.html = engine/player, nextcloud.html = plugin). */
:root {
  --bg:        #0a0907;
  --bg-2:      #100d0a;
  --panel:     #16120d;
  --panel-2:   #1d1811;
  --line:      #2a2219;
  --ink:       #f4ecdf;
  --ink-soft:  #cdc1ae;
  --muted:     #8b8071;
  --amber:     #ffab5e;
  --amber-hot: #ff7a1a;
  --amber-dim: #b9773c;
  --teal:      #63d6c4;
  --radius:    16px;
  --maxw:      1180px;
  --shadow:    0 40px 120px -40px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--amber-hot); color: #150c02; }

/* --- Atmosphere: projector glow + film grain + vignette --- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,122,26,.20), transparent 55%),
    radial-gradient(90% 60% at 85% 8%, rgba(99,214,196,.06), transparent 60%),
    radial-gradient(140% 120% at 50% 120%, rgba(0,0,0,.7), transparent 60%);
}
body::after { /* grain */
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.wrap { position: relative; z-index: 1; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- Nav --- */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(10,9,7,.85), rgba(10,9,7,.55));
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .04em; font-size: 15px; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; position: relative;
  background: linear-gradient(150deg, var(--amber), var(--amber-hot));
  box-shadow: 0 0 22px -2px rgba(255,122,26,.7);
  display: grid; place-items: center; flex: 0 0 auto;
}
.brand .mark::after { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #1a0e02; margin-left: 2px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--amber); }
.nav-links a.nc { color: var(--teal); }
.nav-cta { margin-left: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .25s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-primary {
  color: #1a0d01; background: linear-gradient(150deg, var(--amber), var(--amber-hot));
  box-shadow: 0 10px 30px -10px rgba(255,122,26,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(255,122,26,.75); }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.03); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber-dim); color: var(--amber); }
.btn-block { width: 100%; justify-content: center; padding: 15px; font-size: 16px; }

/* --- Hero --- */
header.hero { padding: 78px 0 40px; text-align: center; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

h1 {
  font-family: "Fraunces", serif; font-weight: 300;
  font-size: clamp(42px, 7vw, 92px); line-height: 0.98; letter-spacing: -.02em;
  margin: 0 auto; max-width: 15ch;
}
h1 em { font-style: italic; font-weight: 400; color: var(--amber); }
.lead { max-width: 58ch; margin: 26px auto 0; color: var(--ink-soft); font-size: clamp(17px, 2.1vw, 20px); }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.trust { margin-top: 20px; font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.trust b { color: var(--teal); font-weight: 500; }

/* --- Player preview / stage --- */
.stage { margin: 54px auto 0; max-width: 1100px; padding: 0 24px; }
.screen { position: relative; aspect-ratio: 2.09125475285; overflow: hidden; }
.screen img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Demo button below the preview --- */
.stage-cta { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.stage-note { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); letter-spacing: .03em; }

/* --- Codec marquee --- */
.marquee { margin-top: 64px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: scroll 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.codec { font-family: "JetBrains Mono", monospace; font-size: 15px; color: var(--muted); letter-spacing: .03em; display: inline-flex; align-items: center; gap: 12px; }
.codec::before { content: "◆"; color: var(--amber-dim); font-size: 9px; }

/* --- Sections --- */
section { padding: 90px 0; position: relative; }
.sec-head { max-width: 62ch; margin-bottom: 52px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font-family: "JetBrains Mono", monospace; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-dim); }
h2 { font-family: "Fraunces", serif; font-weight: 400; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -.02em; margin: 14px 0 0; }
h2 em { font-style: italic; color: var(--amber); }
.sec-head p { color: var(--ink-soft); font-size: 18px; margin: 16px 0 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--amber-dim); }
.card .ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 18px; font-size: 21px; background: rgba(255,171,94,.09); border: 1px solid var(--line); }
.card h3 { font-family: "Fraunces", serif; font-weight: 600; font-size: 21px; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }

/* --- Bands --- */
.band { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* --- Freemium compare --- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 44px; }
.plate { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; background: var(--panel); position: relative; overflow: hidden; }
.plate .frame { aspect-ratio: 16/8; border-radius: 10px; background: radial-gradient(70% 60% at 50% 40%, #1a140d, #0a0a0d); position: relative; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--line); }
.plate .frame .wm { position: absolute; right: 12px; bottom: 10px; font-family: "JetBrains Mono", monospace; font-size: 12px; color: rgba(255,171,94,.55); letter-spacing: .06em; }
.plate .frame .clean { position: absolute; inset: 0; display: grid; place-items: center; color: var(--teal); font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .1em; }
.plate h3 { font-family: "Fraunces", serif; font-weight: 600; font-size: 22px; margin: 0 0 6px; }
.plate .tag { font-family: "JetBrains Mono", monospace; font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.plate.paid { border-color: rgba(255,171,94,.35); box-shadow: 0 0 60px -30px rgba(255,122,26,.5); }

/* --- Pricing --- */
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 820px; }
.price {
  border: 1px solid var(--line); border-radius: 20px; padding: 34px; background: var(--panel);
  display: flex; flex-direction: column; transition: transform .25s, border-color .25s;
}
.price:hover { transform: translateY(-4px); }
.price.feat { border-color: rgba(255,171,94,.4); background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow); position: relative; }
.price.feat::before { content: "For teams"; position: absolute; top: -12px; left: 34px; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #1a0d01; background: linear-gradient(150deg, var(--amber), var(--amber-hot)); padding: 5px 12px; border-radius: 100px; }
.price .name { font-family: "JetBrains Mono", monospace; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.price .amt { font-family: "Fraunces", serif; font-size: 56px; font-weight: 400; letter-spacing: -.02em; margin: 14px 0 2px; }
.price .amt small { font-size: 18px; color: var(--muted); font-family: "Hanken Grotesk", sans-serif; }
.price .per { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.price ul { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 12px; }
.price li { display: flex; gap: 11px; font-size: 15px; color: var(--ink-soft); }
.price li::before { content: "✓"; color: var(--teal); font-weight: 700; }
.price .btn { margin-top: auto; }

/* --- Purchase form --- */
.buy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
form.buy { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: var(--shadow); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field .hint { font-size: 13px; color: var(--muted); margin: -2px 0 9px; line-height: 1.5; }
.field input[type=email], .field input[type=text] {
  width: 100%; padding: 14px 15px; border-radius: 11px; font-family: "JetBrains Mono", monospace; font-size: 15px;
  background: #0b0906; border: 1px solid var(--line); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,122,26,.15); }
.field input::placeholder { color: #5c554a; }
.field code, .steps code, .hint code { font-family: "JetBrains Mono", monospace; color: var(--amber); }

.toggle-row { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #0b0906; cursor: pointer; user-select: none; }
.toggle-row .sw { width: 46px; height: 26px; border-radius: 100px; background: #2a2219; position: relative; flex: 0 0 auto; transition: background .2s; }
.toggle-row .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-soft); transition: transform .2s, background .2s; }
.toggle-row.on .sw { background: linear-gradient(150deg, var(--amber), var(--amber-hot)); }
.toggle-row.on .sw::after { transform: translateX(20px); background: #1a0d01; }
.toggle-row .t-txt strong { display: block; font-size: 15px; }
.toggle-row .t-txt span { font-size: 13px; color: var(--muted); }

.summary { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 2px; margin: 6px 0 18px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.summary .lbl { color: var(--muted); font-size: 14px; }
.summary .val { font-family: "Fraunces", serif; font-size: 30px; }
.summary .val small { font-size: 13px; color: var(--muted); font-family: "Hanken Grotesk", sans-serif; }

.form-msg { font-size: 14px; margin-top: 14px; min-height: 20px; }
.form-msg.err { color: #ff8f6b; }
.form-msg.ok { color: var(--teal); }
.devnote { margin-top: 16px; font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--amber-dim); border: 1px dashed var(--amber-dim); border-radius: 8px; padding: 10px 12px; display: none; }
.devnote.show { display: block; }

.buy-aside h3 { font-family: "Fraunces", serif; font-weight: 400; font-size: 30px; margin: 0 0 20px; letter-spacing: -.01em; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: flex; flex-direction: column; gap: 20px; }
.steps li { display: flex; gap: 16px; counter-increment: s; }
.steps li::before { content: counter(s); flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,171,94,.09); border: 1px solid var(--line); color: var(--amber); font-family: "JetBrains Mono", monospace; font-size: 14px; display: grid; place-items: center; }
.steps li b { display: block; font-family: inherit; font-size: 16px; margin-bottom: 2px; }
.steps li span { color: var(--muted); font-size: 14.5px; }
.steps code { background: rgba(255,171,94,.08); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* --- Commercial / developer licensing --- */
.lic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.lic-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; transition: transform .25s, border-color .25s; }
.lic-card:hover { transform: translateY(-4px); border-color: var(--amber-dim); }
.lic-card.soon { border-style: dashed; }
.lic-card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; font-size: 22px; background: rgba(255,171,94,.09); border: 1px solid var(--line); }
.lic-card h3 { font-family: "Fraunces", serif; font-weight: 600; font-size: 22px; margin: 0 0 6px; }
.lic-card .lic-tag { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .12em; color: var(--amber-dim); margin-bottom: 14px; }
.lic-card p { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.lic-card p code { font-family: "JetBrains Mono", monospace; color: var(--amber); }
.lic-card .lic-cta { margin-top: auto; }
.lic-card .btn { width: 100%; justify-content: center; }
.lic-badge { position: absolute; top: 22px; right: 22px; font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); background: rgba(99,214,196,.1); border: 1px solid rgba(99,214,196,.3); padding: 4px 10px; border-radius: 100px; }
.lic-foot { margin-top: 26px; font-size: 15px; color: var(--ink-soft); }
.lic-foot a { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--amber-dim); }
.lic-foot a:hover { color: var(--amber-hot); }

/* --- Nextcloud cross-link banner --- */
.nc-banner { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; justify-content: space-between; padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(120deg, rgba(99,214,196,.08), var(--panel)); }
.nc-banner .nc-copy { max-width: 62ch; }
.nc-banner h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.nc-banner h3 em { font-style: italic; color: var(--teal); }
.nc-banner p { margin: 0; color: var(--muted); font-size: 15.5px; }
.btn-teal { color: #04120f; background: linear-gradient(150deg, var(--teal), #35b7a5); box-shadow: 0 10px 30px -10px rgba(99,214,196,.5); }
.btn-teal:hover { transform: translateY(-2px); }

/* --- Footer --- */
footer { border-top: 1px solid var(--line); padding: 50px 0 60px; margin-top: 40px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
footer .brand { margin-bottom: 12px; }
.foot-col h4 { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.foot-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: 14.5px; margin-bottom: 9px; }
.foot-col a:hover { color: var(--amber); }
.foot-note { color: var(--muted); font-size: 13.5px; max-width: 40ch; margin-top: 12px; }

/* --- Returning-visitor "your license" pill + modal --- */
.nav-license {
  display: none; align-items: center; gap: 8px; margin-left: 4px;
  font-size: 13.5px; font-weight: 600; color: var(--amber);
  border: 1px solid var(--amber-dim); background: rgba(255,171,94,.08);
  padding: 8px 14px; border-radius: 100px; text-decoration: none; cursor: pointer;
  transition: background .2s, transform .15s;
}
.nav-license.show { display: inline-flex; }
.nav-license:hover { background: rgba(255,171,94,.16); transform: translateY(-1px); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(6,5,3,.72); backdrop-filter: blur(8px);
  animation: fade .25s ease;
}
.modal-backdrop.open { display: flex; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative; width: 100%; max-width: 500px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 20px; padding: 34px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,171,94,.06);
  animation: pop .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal .kicker { color: var(--amber-dim); }
.modal h3 { font-family: "Fraunces", serif; font-weight: 400; font-size: 30px; letter-spacing: -.01em; margin: 12px 0 8px; }
.modal h3 em { font-style: italic; color: var(--amber); }
.modal-sub { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 20px; }
.modal-x { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer; transition: border-color .2s, color .2s; }
.modal-x:hover { border-color: var(--amber-dim); color: var(--amber); }
.om-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.om-meta span { font-family: "JetBrains Mono", monospace; font-size: 11.5px; padding: 5px 10px; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--line); color: var(--ink-soft); }
.om-key { display: none; margin-bottom: 18px; }
.om-key.show { display: block; }
.om-key .keyval { font-family: "JetBrains Mono", monospace; font-size: 13px; line-height: 1.65; color: var(--ink); background: #0b0906; border: 1px solid var(--line); border-radius: 11px; padding: 15px; word-break: break-all; user-select: all; max-height: 150px; overflow: auto; }
.om-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.om-actions .btn { flex: 1 1 auto; justify-content: center; }
.om-forget { display: block; margin: 18px auto 0; background: none; border: none; color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.om-forget:hover { color: #ff8f6b; }

/* --- Load animation --- */
.rise { opacity: 0; transform: translateY(22px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .grid, .compare, .prices, .buy-grid, .lic-grid { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .buy-aside { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; }
}
