/* Buttons, panels, forms, dialogs, lightbox, carousel, toast, reveal states. */

/* ---------- buttons (notched parallelogram, like the mockups) ---------- */
.btn {
  --b-bg: transparent; --b-fg: var(--text); --b-line: var(--line-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 28px;
  font-family: var(--font-label); font-weight: 600; font-size: .86rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--b-fg); white-space: nowrap; isolation: isolate; cursor: pointer;
  clip-path: polygon(var(--notch) 0, 100% 0, calc(100% - var(--notch)) 100%, 0 100%);
  background: var(--b-line);
  transition: color .25s, transform .25s var(--ease), filter .25s;
}
.btn::before {
  content: ""; position: absolute; inset: 1.5px; z-index: -1; background: var(--b-bg);
  clip-path: polygon(var(--notch) 0, 100% 0, calc(100% - var(--notch)) 100%, 0 100%);
  transition: background .25s;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.btn .icon { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(4px); }
.btn:active { transform: scale(.98); }
.btn-primary {
  --b-fg: #fff; --b-line: var(--accent-hot);
  --b-bg: linear-gradient(100deg, var(--accent-2), var(--accent));
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  filter: drop-shadow(0 0 14px var(--glow));
}
:root[data-theme="blue"] .btn-primary { --b-bg: linear-gradient(100deg, #e3411e, var(--accent)); filter: drop-shadow(0 0 14px rgba(255, 106, 42, .4)); }
.btn-primary:hover { filter: drop-shadow(0 0 22px var(--glow)) brightness(1.1); }
.btn-outline { --b-bg: rgba(var(--shade-rgb), .82); }
.btn-outline:hover { --b-bg: rgba(var(--shade-rgb), .3); --b-line: var(--accent); color: #fff; }
.btn-ghost { --b-line: var(--line-soft); --b-bg: var(--bg); color: var(--muted); }
.btn-ghost:hover { color: #fff; --b-line: var(--line-strong); }
.btn-lg { min-height: 58px; padding: 0 38px; font-size: .95rem; }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: .78rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
[data-soon] { cursor: help; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 28px; }

/* ---------- reveal on scroll (JS adds .is-in; without JS everything is visible) ---------- */
.js:not([data-motion="reduced"]) [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js:not([data-motion="reduced"]) [data-reveal="left"] { transform: translateX(-40px); }
.js:not([data-motion="reduced"]) [data-reveal="right"] { transform: translateX(40px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- forms ---------- */
.field { margin: 0 0 16px; display: block; }
.field label, .field > span {
  display: block; margin-bottom: 6px;
  font-family: var(--font-label); font-weight: 600; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.req { color: var(--accent-hot); }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: rgba(var(--shade-rgb), .7); border: 1px solid var(--line-soft); border-left: 2px solid var(--line-strong);
  border-radius: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--text); }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint), 0 0 24px -8px var(--glow); background: rgba(var(--shade-rgb), .9); }
::placeholder { color: rgba(255, 255, 255, .32); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field.check label { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: .95rem; color: var(--text); }
.field.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #ff4d4d; }
.field-msg { display: block; margin-top: 6px; color: #ff8080; font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { margin: 22px 0 0; }
.form-status { min-height: 1.4em; margin-top: 10px; font-size: .9rem; }
.form-status.ok { color: #7ee2a0; }
.form-status.err, .form-error-banner { color: #ff8080; }
.form-thanks { padding: 28px; border: 1px solid var(--line); background: var(--tint); }
.form-thanks h3 { font-style: italic; font-weight: 800; font-stretch: 125%; text-transform: uppercase; color: #fff; margin-bottom: 6px; }
.subscribe-form p { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.subscribe-form .field { margin-bottom: 10px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- dialogs ---------- */
dialog { color: var(--text); }
.modal {
  width: min(680px, calc(100vw - 24px)); max-width: none; max-height: min(92dvh, 980px);
  padding: 0; border: 0; background: transparent; overflow: visible;
}
.modal-wide { width: min(980px, calc(100vw - 24px)); }
.modal-narrow { width: min(520px, calc(100vw - 24px)); }
.modal::backdrop, .lightbox::backdrop { background: rgba(4, 3, 6, .82); backdrop-filter: blur(8px); }
.modal-panel {
  position: relative; max-height: min(92dvh, 980px); overflow: auto; overscroll-behavior: contain;
  padding: clamp(22px, 4vw, 44px);
  background:
    radial-gradient(700px 300px at 100% 0%, var(--tint), transparent 70%),
    var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.modal-close { position: sticky; float: right; top: 0; margin: -6px -6px 8px 12px; z-index: 5; }
.modal p { color: var(--muted); }
.modal p + p { margin-top: .9em; }
.modal .h-sub { margin-bottom: 14px; }
.modal-lede { font-size: 1.15em; color: var(--text) !important; font-style: italic; }
.modal-hero { margin: calc(clamp(22px, 4vw, 44px) * -1); margin-bottom: 26px; aspect-ratio: 21 / 9; overflow: hidden; position: relative; }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, var(--panel)); }
.modal-hero + .eyebrow { position: relative; }
.modal-badge {
  width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 18px;
  color: var(--accent-hot); border: 1px solid var(--line-strong); background: var(--tint);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.modal-badge .icon { width: 30px; height: 30px; }
.modal-split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(20px, 4vw, 44px); }
.modal-main .h-mini:first-child { margin-top: 0; }
.cols-2 { columns: 2 280px; column-gap: 32px; }
.cols-2 p { break-inside: avoid; margin: 0 0 1em !important; }
.rules li, .steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); color: var(--text); font-size: .95rem; }
.rules .icon { color: var(--accent-hot); margin-top: 2px; }
.steps { counter-reset: s; }
.steps li::before {
  counter-increment: s; content: "0" counter(s);
  font-family: var(--font-label); font-weight: 600; font-size: .8rem; color: var(--accent-hot); letter-spacing: .1em; padding-top: 3px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li {
  padding: 5px 12px; border: 1px solid var(--line); background: var(--tint);
  font-family: var(--font-label); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text);
}
@media (max-width: 760px) { .modal-split { grid-template-columns: 1fr; } }

/* ---------- lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: clamp(12px, 3vw, 40px);
  border: 0; background: transparent;
}
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(6px, 2vw, 24px); }
.lightbox .modal-close { position: fixed; float: none; top: 16px; right: 16px; margin: 0; }
.lb-figure { min-width: 0; display: grid; justify-items: center; gap: 14px; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 150px); width: auto; border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, .8); }
.lb-figure figcaption { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: center; text-align: center; }
.lb-title { font-style: italic; font-weight: 800; font-stretch: 125%; text-transform: uppercase; }
.lb-detail { color: var(--muted); }
.lb-count { font-family: var(--font-label); font-size: .78rem; letter-spacing: .2em; color: var(--accent-hot); }
@media (max-width: 700px) {
  .lightbox[open] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .lb-figure { grid-column: 1 / -1; grid-row: 1; }
  .lb-prev { justify-self: end; } .lb-next { justify-self: start; }
}

/* ---------- capture tile (reels + archive) ---------- */
.shot {
  position: relative; display: block; overflow: hidden; background: #000; border: 1px solid var(--line-soft);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .4s; filter: saturate(.85) contrast(1.05); }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(var(--shade-rgb), .92)); pointer-events: none; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.06); filter: none; }
.shot-cap { position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 2; display: grid; line-height: 1.25; }
.shot-cap strong { font-style: italic; font-weight: 800; font-stretch: 125%; text-transform: uppercase; font-size: 1rem; letter-spacing: .02em; }
.shot-cap em { font-style: normal; color: var(--muted); font-size: .85rem; }
.shot-open {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(var(--shade-rgb), .7); border: 1px solid var(--line); color: #fff;
  opacity: 0; transform: scale(.8); transition: all .3s var(--ease);
}
.shot:hover .shot-open, .shot:focus-visible .shot-open { opacity: 1; transform: none; }
.shot-num { position: absolute; top: 10px; left: 14px; z-index: 2; font-family: var(--font-label); font-size: .74rem; letter-spacing: .2em; color: var(--accent-hot); text-shadow: 0 1px 4px #000; }

/* ---------- carousel ---------- */
.carousel { position: relative; min-width: 0; }
.car-viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-y; }
.car-viewport::-webkit-scrollbar { display: none; }
.is-draggable .car-viewport { overflow: hidden; scroll-snap-type: none; cursor: grab; }
.is-draggable .car-viewport:active { cursor: grabbing; }
.car-track { display: flex; gap: 16px; width: max-content; }
.car-slide { flex: none; width: clamp(240px, 30vw, 400px); aspect-ratio: 16 / 10; scroll-snap-align: start; }
.car-slide .shot { height: 100%; }
.car-btn {
  position: absolute; top: calc(50% - 34px); z-index: 3; width: 44px; height: 44px; display: grid; place-items: center;
  background: rgba(var(--shade-rgb), .85); border: 1px solid var(--line); color: #fff; transition: all .2s;
}
.car-btn:hover { background: var(--accent); color: var(--accent-ink); }
.car-btn[disabled] { opacity: .3; pointer-events: none; }
.car-prev { left: -14px; } .car-next { right: -14px; }
.car-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; height: 8px; }
.car-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); transition: all .3s; }
.car-dots i.on { background: var(--accent); border-color: var(--accent); width: 22px; border-radius: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400; transform: translateX(-50%);
  padding: 12px 22px; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-label); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px); text-align: center;
}
