/* Platypus Economics brand: Abyss / Surf / Sun, Sublime display + Inter body */
@font-face {
  font-family: "Sublime";
  src: url("../assets/Sublime.ttf") format("truetype");
  font-display: swap;
}

:root {
  --abyss: #0E4A53;
  --abyss-2: #13585F;
  --ink: #082C32;
  --surf: #2F9E97;
  --surf-2: #5DBAB4;
  --surf-tint: #E3F2F1;
  --sun: #D9A315;
  --sun-2: #F0BC2E;
  --coral: #D93A43;
  --orchid: #8E4AA0;
  --algae: #006B2E;
  --paper: #F6F4EE;
  --white: #FFFFFF;
  --text: #082C32;
  --muted: #5B7477;
  --line: #DCD8CC;
  --radius: 12px;
  --display: "Sublime", "Helvetica Neue", "Arial Narrow", sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--abyss); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }

/* ---------- Halloween market ticker ---------- */
.ticker {
  position: sticky; top: 0; z-index: 20; overflow: hidden;
  background: var(--ink); border-bottom: 2px solid var(--sun);
  font: 700 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em;
}
.ticker-track { display: flex; width: max-content; animation: ticker 50s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-copy { display: flex; gap: 34px; padding: 10px 17px; white-space: nowrap; }
.tick { color: var(--surf-2); }
.tick b { color: var(--white); margin-right: 4px; }
.tick.up { color: #5DDFA0; }
.tick.down { color: #FF7A80; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- top bar ---------- */
.topbar { background: var(--white); border-bottom: 4px solid var(--surf); padding: 12px 16px; display: flex; justify-content: center; }
.topbar-logo img { height: 52px; display: block; }

/* ---------- hero ---------- */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 56px 16px 40px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center;
}
.label {
  display: inline-block; background: var(--ink); color: var(--white);
  font: 700 13px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px;
}
.hero h1 {
  font-size: clamp(64px, 11vw, 132px); margin: 14px 0 18px; color: var(--abyss);
}
.hero h1::after {
  content: ""; display: block; width: 120px; height: 10px; background: var(--surf); margin-top: 14px;
}
.tagline { font-size: clamp(16px, 2vw, 19px); color: var(--ink); max-width: 560px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-hero { font-size: 22px; padding: 20px 44px; border-radius: 10px; box-shadow: 0 6px 20px rgba(217, 163, 21, .35); min-width: min(100%, 360px); }
.btn-hero:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(217, 163, 21, .45); }
.hero-art { width: 100%; max-width: 520px; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero-mark { margin: 0; width: 100%; }
.hero-mark img { width: 100%; display: block; animation: swim 7s ease-in-out infinite; }
.hero-mark figcaption, .hero-clip figcaption { margin-top: 8px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-clip { margin: 0; width: 100%; }
.hero-clip video { width: 100%; display: block; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); background: var(--ink); aspect-ratio: 600 / 338; }
@keyframes swim { 50% { transform: translate(-10px, -8px) rotate(-1.5deg); } }

.countdown { margin-top: 28px; font-size: 14px; color: var(--muted); }
.cd-label { margin: 0 0 8px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--abyss); }
.cd-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-deadline { margin: 10px 0 0; color: var(--ink); }
.cd-deadline strong { color: var(--abyss); }
.cd { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; text-align: center; min-width: 54px; }
.cd b { display: block; font: 400 26px/1 var(--display); color: var(--abyss); font-variant-numeric: tabular-nums; }
.cd small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; padding: 13px 22px; font-weight: 700; border: 2px solid transparent;
  text-decoration: none; transition: background .15s, transform .1s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sun); color: var(--ink); }
.btn-primary:hover { background: var(--sun-2); }
.btn-ghost { background: transparent; border-color: var(--abyss); color: var(--abyss); }
.btn-ghost:hover { background: var(--surf-tint); }
.btn-wide { width: 100%; margin-top: 6px; }
.linkish { background: none; border: 0; padding: 0; text-align: left; }

/* ---------- podium ---------- */
.podium { background: var(--abyss); color: var(--white); padding: 40px 16px; text-align: center; }
.podium h2 { font-size: clamp(36px, 6vw, 56px); margin: 0 0 24px; color: var(--sun); }
.podium-row { display: flex; gap: 12px; align-items: flex-end; justify-content: center; max-width: 760px; margin: 0 auto; }
.step { flex: 1; max-width: 220px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--white); }
.step .muted { color: var(--surf-2); font-size: 13px; }
.medal { font-size: 40px; }
.plinth {
  width: 100%; margin-top: 8px; background: var(--abyss-2); border-top: 6px solid var(--surf);
  font: 400 44px/1 var(--display); display: grid; place-items: center; color: var(--surf-2);
}
.step-1 .plinth { height: 130px; border-top-color: var(--sun); color: var(--sun); }
.step-2 .plinth { height: 95px; }
.step-3 .plinth { height: 70px; }

/* ---------- gallery ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; }
.gallery-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 2px solid var(--abyss); padding-top: 24px; }
.gallery-head h2 { font-size: clamp(40px, 6vw, 56px); margin: 0; color: var(--abyss); }
.sort { display: flex; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.sort button { background: none; border: 0; padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sort button.active { background: var(--abyss); color: var(--white); }
.gallery-sub { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 20px; font-size: 14px; color: var(--muted); }
.gallery-sub p { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  animation: rise .4s both; animation-delay: calc(var(--i) * 30ms);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--surf); box-shadow: 0 10px 30px rgba(14, 74, 83, .12); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card-media { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; background: var(--ink); overflow: hidden; display: block; width: 100%; }
/* contain, not cover: landscape photos get bars top and bottom instead of being cropped */
.card-media img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s; }
.card:hover .card-media img, .card:hover .art span { transform: scale(1.05); }
.badge-video, .rank { position: absolute; top: 10px; font-size: 12px; font-weight: 700; padding: 5px 9px; }
.badge-video { right: 10px; background: var(--ink); color: var(--white); }
.badge-demo { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; background: var(--white); color: var(--ink); border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.card-demo { border: 1px dashed var(--muted); }
/* The illustrations have transparent backgrounds and dark outlines: show them on paper, not the dark tile. */
.card-demo .card-media { background: var(--paper); }
.card-demo .card-media img { padding: 8%; }
.demo-divider { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 18px; padding-top: 16px; border-top: 2px dashed var(--muted); color: var(--muted); font-size: 14px; }
.demo-divider strong { color: var(--ink); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.rank { left: 10px; background: var(--sun); color: var(--ink); font: 400 20px/1 var(--display); padding: 6px 9px 4px; }
.card-body { display: flex; gap: 10px; padding: 12px; align-items: center; }
.card-text { min-width: 0; flex: 1; }
.card-text h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.25; }
.card-text h3 .linkish:hover { color: var(--surf); }
.card-text p { margin: 0; font-size: 13px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--muted); }

/* placeholder art for seeded entries */
.art { width: 100%; height: 100%; display: grid; place-items: center; background: var(--c); position: relative; }
.art::after {
  content: ""; position: absolute; inset: 0;
  background: url("../assets/icon-white.png") no-repeat 110% 105% / 70%; opacity: .14;
}
.art span { font-size: 88px; position: relative; z-index: 1; transition: transform .4s; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); }
.art-big { aspect-ratio: 9 / 16; max-height: 78vh; }
.art-big span { font-size: 150px; }
.art-video span { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px); } }

/* ---------- vote button ---------- */
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  background: var(--white); border: 2px solid var(--abyss); color: var(--abyss);
  border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s;
}
.vote-btn:hover:not(:disabled) { background: var(--abyss); color: var(--white); }
.vote-btn .vote-label { display: none; }
.vote-btn .vote-count { font-variant-numeric: tabular-nums; }
.vote-btn.on { background: var(--surf); border-color: var(--surf); color: var(--white); cursor: default; }
.vote-btn:disabled:not(.on) { opacity: .45; cursor: not-allowed; }
.vote-lg { padding: 12px 18px; font-size: 16px; }
.vote-lg .vote-label { display: inline; }
.vote-lg .vote-count { margin-left: 6px; padding-left: 10px; border-left: 1px solid currentColor; }

/* ---------- modals ---------- */
.modal {
  border: 0; border-radius: 14px; padding: 0; color: var(--text);
  background: var(--white); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 30px 80px rgba(8, 44, 50, .35); overflow: auto;
}
.modal::backdrop { background: rgba(8, 44, 50, .6); }
.modal[open] { animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }
.modal-small { width: min(420px, calc(100vw - 24px)); }
.close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
}
.close:hover { background: var(--surf-tint); }

.enter-form, .vote-form { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.enter-form h2, .vote-form h2 { font-size: 40px; margin: 0; color: var(--abyss); padding-right: 40px; }
.enter-form > p, .vote-form > p { margin: 0; font-size: 14px; }
.enter-form label, .vote-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; }
.field-row { display: flex; gap: 12px; }
input, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--surf); outline-offset: 0; border-color: var(--surf); }
.check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--abyss); flex: none; }
.check a, .fine a { color: var(--abyss); font-weight: 600; }
.privacy { font-size: 13px !important; background: var(--surf-tint); border-left: 4px solid var(--surf); padding: 10px 12px; }
.fine { font-size: 12px !important; color: var(--muted); }
.field-error { margin: 0; color: var(--coral); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Cloudflare Turnstile: invisible unless Cloudflare asks the visitor to click. */
.ts-box { display: flex; justify-content: center; }
.ts-box:has(iframe) { margin: 12px 0; }
.ts-float { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; }

.drop { border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--surf); background: var(--surf-tint); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop-empty { padding: 26px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; font-weight: 400; }
.drop-empty strong { font-size: 15px; }
.drop-empty .muted { font-size: 12px; }
.drop-icon { width: 72px; opacity: .85; margin-bottom: 6px; }
.drop-preview { position: relative; background: var(--ink); display: flex; justify-content: center; }
.drop-preview img, .drop-preview video { max-height: 280px; max-width: 100%; display: block; }
.drop-preview .meta, .drop-preview .swap { position: absolute; bottom: 8px; font-size: 12px; font-weight: 600; background: rgba(8,44,50,.85); color: var(--white); padding: 4px 10px; border-radius: 6px; }
.drop-preview .meta { left: 8px; }
.drop-preview .swap { right: 8px; color: var(--sun-2); }

.processing { padding: 48px 28px; text-align: center; }
.swim { width: 120px; animation: swim 1.6s ease-in-out infinite; }
.stages { list-style: none; padding: 0; margin: 24px auto 0; text-align: left; max-width: 320px; display: flex; flex-direction: column; gap: 12px; }
.stages li { color: var(--muted); opacity: .55; padding-left: 30px; position: relative; }
.stages li::before { content: "○"; position: absolute; left: 4px; }
.stages li.active { opacity: 1; color: var(--ink); font-weight: 600; }
.stages li.active::before { content: "◐"; color: var(--surf); animation: spin 1s linear infinite; display: inline-block; }
.stages li.done { opacity: 1; }
.stages li.done::before { content: "✓"; color: var(--surf); font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { padding: 40px 28px 32px; text-align: center; }
.result-mark { width: 200px; }
.result-icon { font-size: 56px; }
.result h2 { font-size: 48px; margin: 12px 0 8px; color: var(--abyss); }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* entry modal */
.modal-entry { width: min(900px, calc(100vw - 24px)); }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.entry-media { background: var(--ink); display: grid; place-items: center; min-height: 360px; }
.entry-media-demo { background: var(--paper); padding: 24px; }
.entry-media img, .entry-media video { width: 100%; max-height: 82vh; object-fit: contain; display: block; }
.entry-media .art-big { max-height: 82vh; }
.entry-side { padding: 32px 24px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.entry-side h2 { font-size: 44px; margin: 0; padding-right: 40px; color: var(--abyss); }
.byline { margin: 0 0 8px; color: var(--muted); font-size: 14px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100;
  background: var(--ink); color: var(--white); padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.footer { background: var(--abyss); color: var(--surf-tint); text-align: center; font-size: 13px; padding: 28px 16px 36px; }
.footer p { margin: 4px 0; }
.footer a { color: var(--sun-2); }
.footer .footer-joke { font-style: italic; color: var(--surf-2); }
.footer .btn-contact { margin: 10px 0 6px; padding: 10px 18px; font-size: 14px; color: var(--white); border-color: var(--surf-2); background: transparent; }
.footer .btn-contact:hover { background: var(--abyss-2); }
.footer-icon { width: 56px; filter: brightness(0) invert(1); opacity: .7; margin-bottom: 8px; }

/* ---------- rules / privacy page ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; font-size: 16px; }
.legal h1 { font-size: clamp(44px, 8vw, 64px); color: var(--abyss); margin: 16px 0 4px; }
.legal h2 { font-family: var(--font); text-transform: none; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--abyss); margin: 32px 0 8px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal .lede { font-size: 18px; font-weight: 600; margin: 0; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.legal .caps { background: var(--surf-tint); border-left: 4px solid var(--surf); padding: 12px 14px; }
.legal .toc { font-size: 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.legal .toc a { font-weight: 600; }
.legal .back { font-size: 14px; text-decoration: none; color: var(--muted); }
.legal #privacy { margin-top: 56px; padding-top: 24px; border-top: 2px solid var(--abyss); }
.legal mark { background: #FBEBC0; color: var(--ink); padding: 0 3px; border-radius: 3px; }
.draft-note { background: #FBF0D2; border: 1px solid var(--sun); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 8px; }
  /* Let the unicorn and the clip place separately: unicorn on top, clip after the text. */
  .hero-art { display: contents; }
  .hero-mark { order: -1; max-width: 300px; justify-self: center; margin-bottom: 12px; }
  .hero-clip { max-width: 520px; justify-self: center; margin-top: 24px; }
}
@media (max-width: 760px) {
  .entry-layout { grid-template-columns: 1fr; }
  .entry-media { min-height: 0; }
  .entry-media img, .entry-media video, .entry-media .art-big { max-height: 60vh; }
  .entry-side h2 { font-size: 36px; }
}
@media (max-width: 520px) {
  .topbar-logo img { height: 40px; }
  .field-row { flex-direction: column; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { flex-direction: column; align-items: stretch; padding: 10px; }
  .vote-btn { justify-content: center; }
  .art span { font-size: 60px; }
  .modal { width: 100vw; max-height: 100vh; border-radius: 0; margin: 0; height: 100%; }
  .modal-small { height: auto; margin: auto; border-radius: 14px; width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ticker-track { animation: none !important; }
  .ticker { overflow-x: auto; }
}
