/* The Breaking Signal — homepage: hero, five-field menu, masthead, how it works, footer. */

.home { background-image: none; }

/* ---------- 1 · Hero banner ---------- */
.home { --hero-gap: 28px; }
/* the same gap above the banner as below it */
.hero { position: relative; margin-top: var(--hero-gap); background: #000; }
.hero picture, .hero-img { display: block; width: 100%; }
/* 75% of the artwork's natural height; the trim comes off top and bottom
   (a little more from the dark bottom edge) so the baked-in headline stays whole. */
.hero-img {
  aspect-ratio: 2000 / 533;
  height: auto;
  max-height: 570px;
  object-fit: cover;
  object-position: left 40%;
}
@media (max-width: 699px) {
  .hero-img { aspect-ratio: 900 / 428; }
}
/* animated wave: a looping video laid exactly over the still, faded in once it plays */
.hero-video {
  position: absolute; inset: 0; z-index: 0;
  clip-path: inset(0);              /* keep the GPU video layer inside the banner box */
  width: 100%; height: 100%;
  object-fit: cover; object-position: left 40%;
  opacity: 0; pointer-events: none;
  transition: opacity 800ms var(--ease);
}
.hero-video.is-playing { opacity: 1; }
.hero-motion {
  position: absolute; right: var(--nav-pad, 24px); bottom: 18px; z-index: 2;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%;
  background: rgba(1, 17, 33, .55); color: var(--text);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer; opacity: .65;
  transition: opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.hero-motion:hover, .hero-motion:focus-visible { opacity: 1; background: rgba(1, 17, 33, .8); }
.hero-motion svg { width: 16px; height: 16px; }
.hero-motion .hm-play, .hero-motion[aria-pressed="true"] .hm-pause { display: none; }
.hero-motion[aria-pressed="true"] .hm-play { display: block; }
@media (max-width: 699px), (prefers-reduced-motion: reduce) {
  .hero-video, .hero-motion { display: none !important; }
}
/* The fade runs 2px past the banner's bottom edge and ends in solid background, so a video or image
   layer that the browser rounds up by a device pixel can never show as a bright line. */
.hero::after {
  z-index: 1;
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 58px;
  background: linear-gradient(to bottom, transparent, var(--bg) calc(100% - 4px));
  pointer-events: none;
}

/* ---------- shared section header ---------- */
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 6px 16px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
/* section titles: white and bold */
.section-head .label {
  font-weight: 700;
  font-size: clamp(1.125rem, 0.95rem + 0.5vw, 1.375rem);
  letter-spacing: .14em;
  color: var(--text);
}
.section-meta { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--text-2); }

/* ---------- 2 · Menu strip: five field buttons side by side ---------- */
.fields { position: relative; padding-top: var(--hero-gap); outline: none; }
.field-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 232px;
  gap: 12px;
  /* phones and tablets: the strip scrolls sideways inside itself, never the page */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding: 8px var(--gutter) 18px;
  scrollbar-width: none;
}
.field-list::-webkit-scrollbar { display: none; }
.field-list > li { scroll-snap-align: start; }

.field {
  --lift: 0px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 324px;
  padding: 16px 16px 48px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  color: var(--text);
  text-decoration: none;
  transform: translateY(var(--lift));
  box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.9);
  transition:
    transform 260ms var(--ease),
    box-shadow 320ms var(--ease),
    border-color 260ms var(--ease),
    opacity 260ms var(--ease),
    filter 260ms var(--ease);
}

/* layers */
.f-bg { position: absolute; inset: 0; z-index: -3; }
.f-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 28% center;
  filter: saturate(0.9) brightness(0.8);
  transform: scale(1.02);
  transition: transform 900ms var(--ease), filter 400ms var(--ease);
}
.f-shade {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(1, 17, 33, 0.25) 0%, rgba(1, 17, 33, 0.05) 30%, rgba(1, 17, 33, 0.82) 62%, rgba(1, 17, 33, 0.97) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--f-accent) 32%, transparent), transparent 55%);
  transition: opacity 400ms var(--ease);
}
.f-sheen {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--f-accent) 38%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}
.f-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--f-accent);
  transform: scaleX(0.18); transform-origin: left;
  transition: transform 420ms var(--ease);
}

/* head: icon chip + code + name */
.f-head { display: flex; align-items: center; gap: 12px; }
.f-icon {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--f-accent);
  color: var(--f-fg);
  box-shadow: 0 6px 18px -6px var(--f-accent), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 260ms var(--ease);
}
.f-icon .i { width: 24px; height: 24px; stroke-width: 1.8; }
.f-name { display: grid; line-height: 1.02; }
.f-code {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; letter-spacing: .06em;
  color: color-mix(in srgb, var(--f-accent) 55%, #ffffff);
}
.f-label {
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: .03em; text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* this week's signal */
.f-now { margin-top: auto; height: 144px; display: grid; align-content: start; gap: 6px; }
.f-k { font-family: var(--font-display); font-weight: 600; font-size: 0.875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.field-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.18;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.18em * 2);
}
.field-title.is-loading { color: var(--text-3); }
.field-title.is-empty { color: var(--text-2); }
.field-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 0.875rem; color: var(--text-2); min-height: 1.4em; }
.m-state { color: color-mix(in srgb, var(--f-accent) 55%, #ffffff); font-weight: 600; }
.m-dir { display: inline-flex; align-items: center; gap: 4px; }
.field .dir-icon { width: 15px; height: 15px; stroke-width: 2.2; }

/* "Open board" slides in on rollover */
.f-go {
  position: absolute; left: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.875rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text);
  opacity: 0; transform: translateY(6px);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.go-icon { width: 16px; height: 16px; stroke-width: 2.2; color: var(--f-accent); transition: transform 260ms var(--ease); }

/* ---- rollover (mouse) and focus (keyboard) ---- */
.field:is(:hover, :focus-visible) {
  --lift: -6px;
  border-color: color-mix(in srgb, var(--f-accent) 80%, transparent);
  box-shadow: 0 22px 46px -18px var(--f-accent), 0 0 0 1px color-mix(in srgb, var(--f-accent) 50%, transparent);
}
.field:is(:hover, :focus-visible) .f-bg img { transform: scale(1.12); filter: saturate(1.15) brightness(1); }
.field:is(:hover, :focus-visible) .f-sheen { opacity: 1; }
.field:is(:hover, :focus-visible) .f-bar { transform: scaleX(1); }
.field:is(:hover, :focus-visible) .f-icon { transform: rotate(-6deg) scale(1.06); }
.field:is(:hover, :focus-visible) .f-go { opacity: 1; transform: none; }
.field:is(:hover, :focus-visible) .go-icon { transform: translateX(3px); }
.field:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
/* the others step back while one is in focus */
@media (hover: hover) {
  .field-list:has(.field:hover) .field:not(:hover) { opacity: 0.55; filter: saturate(0.6); }
}
/* touch screens have no rollover: show the call to action outright */
@media (hover: none) {
  .f-go { opacity: 1; transform: none; }
  .f-bar { transform: scaleX(1); }
}
/* press */
.field:active { --lift: -2px; transition-duration: 90ms; }
.field:active .f-icon { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  .field, .f-bg img, .f-icon, .f-go { transform: none !important; }
}

/* ---------- 3 · Masthead ---------- */
.masthead {
  display: grid; justify-items: center;
  padding-block: 88px 80px;
  text-align: center;
}
.mast-logo { width: min(560px, 86%); height: auto; }
.mast-eyebrow { margin-top: 28px; letter-spacing: .32em; color: var(--text-2); }
.mast-line {
  margin-top: 20px;
  max-width: 30ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.875rem, 1.1rem + 2.8vw, 3.25rem);
  line-height: 1.1;
  color: var(--text-3);
  text-wrap: balance;
}
.mast-line span { color: var(--text); }
@media (min-width: 900px) { .mast-line { max-width: none; } }
@media (max-width: 499px) { .mast-sub { letter-spacing: .16em; font-size: 0.875rem; } }
.mast-sub {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-2);
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 36px;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px -14px rgba(255, 255, 255, .5); }
.btn-arrow .i { width: 20px; height: 20px; stroke-width: 2.2; color: var(--brand-red); transition: transform var(--t-fast) var(--ease); }
.btn-primary:hover .btn-arrow .i { transform: translateX(3px); }

/* ---------- 4 · How it works ---------- */
.how { padding-bottom: 72px; }
.how-grid { display: grid; gap: var(--gap); }
.how-card { display: flex; flex-direction: column; gap: 12px; padding: calc(var(--pad) + 4px); }
.how-n { font-family: var(--font-mono); font-size: 1rem; font-weight: 500; color: var(--brand-red); filter: brightness(1.35); }
.how-card h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1.2rem + 0.8vw, 1.875rem); line-height: 1.12; }
.how-card p { color: var(--text-2); font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.25rem); line-height: 1.55; }
.how-formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.how-formats li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 1rem;
  color: var(--text-2);
}
.how-formats .i { width: 18px; height: 18px; }



/* ---------- ≥700px ---------- */
@media (min-width: 700px) {
  .home { --hero-gap: 36px; }
  .field-list { grid-auto-columns: 248px; }
  .how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- ≥900px: strip and this week's signal side by side ---------- */
@media (min-width: 900px) {
  .masthead { padding-block: 112px 96px; }
}

/* ---------- ≥1080px: all five side by side, no scrolling ---------- */
@media (min-width: 1080px) {
  .field-list {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .field { height: 340px; }
}
