@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #05090a;
  --deep: #072d32;
  --teal: #0098a5;
  --teal-bright: #08c0cb;
  --ice: #bce9ec;
  --paper: #f5f2e9;
  --muted: #8fb9bc;
  --orange: #ff4b27;
  --line: #1d6970;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  font: 16px/1.5 'DM Sans', sans-serif;
  background:
    radial-gradient(circle at 15% 20%, #00a6b21a 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    linear-gradient(135deg, #061215 0%, var(--ink) 52%, #071c20 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .2;
  background: repeating-linear-gradient(112deg, transparent 0 28px, #13aeba12 29px 30px);
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

header {
  min-height: 106px;
  padding: 8px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 5px solid var(--ink);
  background: var(--teal);
  box-shadow: 0 3px 0 var(--ice);
}

.brand {
  display: block;
  width: min(330px, 52vw);
  height: 88px;
  overflow: hidden;
  text-decoration: none;
}

.brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(3px 4px 0 #041012);
}

.header-note,
.eyebrow {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.header-note {
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 7px 11px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}

main {
  max-width: 1440px;
  margin: auto;
  padding: 0 6%;
}

.intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 70px;
  align-items: center;
  padding: 74px 0 68px;
}

.intro::after {
  content: '';
  position: absolute;
  left: -8vw;
  right: 35%;
  bottom: 28px;
  height: 10px;
  transform: rotate(-1deg);
  background: var(--teal);
  clip-path: polygon(0 32%, 100% 0, 96% 100%, 3% 70%);
}

.hero-copy { position: relative; }
.eyebrow { margin: 0 0 14px; color: var(--teal-bright); }

h1, h2, h3 { font-family: 'Bebas Neue', Impact, sans-serif; }

h1 {
  max-width: 820px;
  margin: 0 0 18px;
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 400;
  line-height: .91;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--deep);
}

h1 span {
  color: var(--ice);
  -webkit-text-stroke: 1px var(--teal);
}

.description { max-width: 510px; margin: 0; color: var(--muted); }

.timer-panel {
  position: relative;
  padding: 25px 26px 23px;
  color: var(--ink);
  background: var(--teal);
  border: 3px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ice);
  transform: rotate(1deg);
}

.timer-panel::before {
  content: 'AUTO';
  position: absolute;
  top: -16px;
  right: 14px;
  padding: 3px 10px;
  background: var(--orange);
  border: 2px solid var(--ink);
  font: 20px/1 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
}

.timer-label { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 12px; letter-spacing: 1.5px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #ff4b2730; }

#countdown {
  margin: 4px 0 7px;
  font: 78px/.95 'Bebas Neue', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.track { height: 5px; background: #04525a; border: 1px solid var(--ink); }
#progress { height: 100%; width: 0; background: var(--paper); }
.timer-panel p { margin: 12px 0 0; color: #042f33; font-size: 13px; font-weight: 700; }

.feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}

.feed-heading .eyebrow { margin-bottom: 5px; }

h2 {
  margin: 0;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

#count {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px 2px;
  vertical-align: middle;
  color: var(--ink);
  background: var(--teal);
  border: 2px solid var(--ice);
  font: 20px/1 'Bebas Neue', sans-serif;
}

#period,
.status-line { font-size: 14px; color: var(--muted); }

#period {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #061619;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0 23px;
  border-top: 2px solid var(--teal);
}

#status { color: var(--ice); }
#like-status { min-height: 21px; margin: 0 0 16px; color: var(--teal-bright); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
}

.card {
  display: block;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--teal);
  transition: transform .18s, box-shadow .18s;
}

.card:nth-child(even) { transform: rotate(.35deg); }
.card:hover { transform: translate(-2px, -4px) rotate(0); box-shadow: 10px 11px 0 var(--teal); }
.card:focus-within { outline: 3px solid var(--ice); outline-offset: 5px; }

.clip-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.thumbnail,
.card-body,
.creator,
.clip-title { display: block; }

.thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--deep);
  border-bottom: 3px solid var(--ink);
}

.thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, #00a6b224, transparent 50%, #04101255);
}

.thumbnail img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.08); }
.play { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: var(--paper); font-size: 34px; text-shadow: 3px 3px 0 var(--ink); }
.duration { position: absolute; z-index: 2; right: 10px; bottom: 9px; padding: 3px 8px; color: var(--paper); background: var(--ink); border: 1px solid var(--teal); font-size: 12px; font-weight: 700; }
.card-body { padding: 17px 17px 14px; }
.creator { margin: 0 0 5px; color: #007781; font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.card .clip-title { margin: 0 0 15px; font: 24px/1.08 'Bebas Neue', sans-serif; letter-spacing: .5px; overflow-wrap: anywhere; }
.meta { display: flex; justify-content: space-between; gap: 8px; color: #4b5d5e; font-size: 13px; }
.clip-actions { padding: 0 17px 17px; }

.like-button {
  padding: 8px 13px;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--teal);
  font: 700 14px/1.2 'DM Sans', sans-serif;
  cursor: pointer;
}

.like-button:hover { color: var(--ink); background: var(--teal); }
.like-button[aria-pressed='true'] { color: var(--ink); background: var(--orange); box-shadow: 3px 3px 0 var(--ink); }
.like-button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink);
  background: var(--teal);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ice);
}

.empty[hidden] { display: none; }
.empty-icon { display: inline-block; color: var(--ink); font-size: 38px; }
.empty h3 { margin: 8px 0; font-size: 32px; font-weight: 400; letter-spacing: 1px; }
.empty p { max-width: 560px; margin: auto; color: #06363a; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 66px;
  padding: 26px 0 34px;
  color: var(--muted);
  border-top: 4px solid var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#player-dialog {
  width: min(960px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--paper);
  background: var(--ink);
  border: 4px solid var(--teal);
  box-shadow: 12px 12px 0 var(--ice);
}

#player-dialog::backdrop { background: #001316e8; }
body:has(#player-dialog[open]) { overflow: hidden; }
.player-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 21px 22px; background: var(--deep); border-bottom: 3px solid var(--teal); }
.player-heading > div { min-width: 0; }
.player-heading h2 { font-size: 31px; overflow-wrap: anywhere; }
#player-close { flex-shrink: 0; padding: 9px 14px; color: var(--ink); background: var(--teal); border: 2px solid var(--paper); font: 700 14px 'DM Sans', sans-serif; cursor: pointer; }
.player-scroll { overflow-x: auto; }
#player-mount { min-width: 400px; min-height: 300px; aspect-ratio: 16/9; background: #000; }
#player-mount iframe { display: block; width: 100%; height: 100%; min-height: 300px; border: 0; }
#player-help { margin: 0; padding: 15px 22px; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr 285px; gap: 34px; }
  #countdown { font-size: 66px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  header { min-height: 84px; padding-block: 5px; }
  .brand { width: 190px; height: 72px; }
  .header-note { display: none; }
  .intro { grid-template-columns: 1fr; gap: 38px; padding: 50px 0 60px; }
  .intro::after { right: 0; bottom: 29px; }
  .timer-panel { transform: none; box-shadow: 7px 7px 0 var(--ice); }
  .feed-heading, .status-line { align-items: start; flex-direction: column; gap: 8px; }
  .grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 6px; }
}

@media (max-width: 460px) {
  h1 { font-size: 45px; }
  .player-heading { flex-wrap: wrap; padding: 16px; }
  .player-heading h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
