/* ================================================================
   berliney · site styles
   Consumes tokens.css only — no raw hex below this line.
   ================================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--color-bg-ink-mode);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--rose-500);
  color: var(--noir-950);
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
}

/* on rose surfaces the rose ring would vanish — switch to ink there
   (covers buttons, links and the dialog close; inputs are ink already) */
.signup-dialog :focus-visible,
.signup-card :focus-visible,
body.page-light :focus-visible {
  outline-color: var(--noir-950);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── backdrop (fixed video layer; content scrolls over it) ──
   --scroll-p (0→1 over the first ~¾ viewport of scroll) is set by
   js/site.js and drives the depth effect. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--color-bg-ink-mode);
}

.backdrop__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.backdrop__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--noir-950) 55%, transparent) 0%,
    color-mix(in srgb, var(--noir-950) 25%, transparent) 30%,
    color-mix(in srgb, var(--noir-950) 25%, transparent) 70%,
    color-mix(in srgb, var(--noir-950) 60%, transparent) 100%
  );
}

/* deepens as the manifesto arrives — heavier on the right where the
   text sits, lighter on the left so the video stays visible */
.backdrop__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--noir-950) 30%, transparent) 0%,
    color-mix(in srgb, var(--noir-950) 55%, transparent) 42%,
    color-mix(in srgb, var(--noir-950) 88%, transparent) 68%,
    color-mix(in srgb, var(--noir-950) 88%, transparent) 100%
  );
  opacity: var(--scroll-p, 0);
}

@media (prefers-reduced-motion: no-preference) {
  .backdrop__video {
    /* recedes slightly as you scroll — the depth cue */
    transform: scale(calc(1 + var(--scroll-p, 0) * 0.07));
  }
}

main {
  position: relative;
  z-index: 1;
}

/* ── top ribbon (the band itself is the CTA) ──
   Brand hot pink (rose-500) per design direction. Ink label on
   rose-500 measures 3.97:1 — AA for large text only. On hover the
   band deepens to rose-600 with a paper label (5:1). */

.ribbon-cta {
  --ribbon-h: 44px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--ribbon-h);
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  background: var(--rose-500);
  color: var(--noir-950);
  border: none;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out);
}

.ribbon-cta__label {
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: var(--text-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--duration-base) var(--ease-out);
}

.ribbon-cta__ticker {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.ribbon-cta__track {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose-100);
}

@media (prefers-reduced-motion: no-preference) {
  .ribbon-cta__track {
    animation: ribbon-ticker 26s linear infinite;
  }

  .ribbon-cta__ticker--reverse .ribbon-cta__track {
    animation-direction: reverse;
  }
}

@keyframes ribbon-ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.ribbon-cta:hover,
.ribbon-cta:active {
  background: var(--rose-600);
}

.ribbon-cta:hover .ribbon-cta__label,
.ribbon-cta:active .ribbon-cta__label {
  color: var(--color-surface-raised);
}

.ribbon-cta:focus-visible {
  outline: 2px solid var(--noir-950);
  outline-offset: -5px;
}

/* ── hero ── */

.hero {
  /* band texts render at the DS H4 step (tags stay h1/p for SEO) */
  --hero-text-size: var(--text-h4);
  position: relative;
  height: 100dvh;
}

.hero__content {
  position: absolute;
  inset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__content {
    /* lifts away faster than the scroll and fades — foreground plane */
    transform: translateY(calc(var(--scroll-p, 0) * -18vh)) scale(calc(1 - var(--scroll-p, 0) * 0.04));
    opacity: calc(1 - var(--scroll-p, 0) * 1.4);
  }
}

.hero__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* dead center of the hero */
}

.hero__logo a {
  display: block;
}

.hero__logo-img {
  width: clamp(130px, 15vw, 200px);
  height: auto;
}

.hero__band {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  padding: 0 clamp(var(--space-5), 6vw, var(--space-8));
}

.hero__edition,
.hero__claim {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--hero-text-size);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-inverse);
}

.hero__claim {
  text-align: right;
}

/* ── scroll affordance ── */

.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--color-text-inverse);
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: calc(0.8 - var(--scroll-p, 0) * 2.5);
  pointer-events: none;
}

.hero__scroll-hint i {
  display: block;
  width: 1.5px;
  height: 26px;
  background: currentColor;
  transform-origin: top;
  animation: scroll-hint-pulse 2.2s var(--ease-out) infinite;
}

@keyframes scroll-hint-pulse {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  70% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* ── manifesto ── */

.manifesto {
  position: relative;
  padding: 24vh 0 22vh;
  color: var(--color-text-inverse);
}

/* block anchored right, type ragged-left — the video keeps the left */
.manifesto__inner {
  max-width: 800px;
  margin-left: auto;
  margin-right: clamp(var(--space-5), 10vw, var(--space-10));
  padding: 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  text-align: left;
}

.manifesto__lede {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 400;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

/* direct children only — paragraphs inside nested components
   (signup card, field errors) keep their own styles */
.manifesto__inner > p {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: 1.7;
  color: color-mix(in srgb, var(--color-text-inverse) 90%, transparent);
}

/* caps lines share the lede's face and size — simple, no effects */
.manifesto p.manifesto__accent,
.manifesto p.manifesto__close {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-inverse);
}

.manifesto p.manifesto__close {
  margin-top: var(--space-4);
}

/* ── inline signup card (hot pink) ── */

.signup-card {
  background: var(--rose-500);
  color: var(--noir-950);
  border-radius: var(--radius-small); /* sharp, poster-like */
  padding: var(--space-6); /* symmetrical */
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.signup-card__title {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 400;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.signup-card .signup-form__success {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--noir-950);
}

/* ── scroll reveals (js adds .in; hidden state only when js runs) ── */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.99);
    filter: blur(6px);
    transition:
      opacity var(--duration-slower) var(--ease-out),
      transform var(--duration-slower) var(--ease-out),
      filter var(--duration-slower) var(--ease-out);
  }

  .js .reveal.in {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ── signup dialog ── */

.signup-dialog {
  margin: auto;
  border: none;
  background: var(--rose-500);
  color: var(--noir-950);
  padding: var(--space-8) var(--space-6) var(--space-6);
  width: min(440px, calc(100vw - 2 * var(--space-4)));
  border-radius: var(--radius-small); /* sharp, poster-like */
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out),
    overlay var(--duration-slow) allow-discrete,
    display var(--duration-slow) allow-discrete;
}

.signup-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .signup-dialog[open] {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

.signup-dialog::backdrop {
  background: color-mix(in srgb, var(--noir-950) 55%, transparent);
}

.signup-dialog__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  font-family: var(--font-body);
  font-size: 26px;
  background: none;
  border: none;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.signup-dialog__close:hover {
  opacity: 1;
}

.signup-dialog__title {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-4);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.signup-form__nope {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup-form__consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-small);
  line-height: 1.5;
  cursor: pointer;
}

.signup-form__consent .checkbox {
  margin-top: 2px;
}

.signup-form .btn {
  align-self: flex-start;
}

.signup-form__status {
  align-self: flex-start;
  font-size: var(--text-small);
  font-weight: 500;
  min-height: 1.2em;
}

/* when it carries a message, it gets the same paper chip as field errors */
.signup-form__status:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--field-bg);
  color: var(--field-error-text);
  padding: 3px 8px;
  border-radius: var(--field-radius);
}

.signup-form__status:not(:empty)::before {
  content: '';
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%239C1F00'/%3E%3Crect x='7' y='3.5' width='2' height='6' rx='1' fill='%23fff'/%3E%3Crect x='7' y='11' width='2' height='2' rx='1' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
}

.signup-form__success {
  font-family: var(--font-display);
  font-size: 24px;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ── footer ── */

.footer {
  position: relative;
  background: var(--noir-950);
  padding: var(--space-4) 0;
}

.footer__inner {
  width: 100%;
  padding: 0 var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}

.footer__brand {
  font-family: var(--font-body);
  font-size: var(--text-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--noir-400);
}

.footer__links {
  display: flex;
  gap: var(--space-5);
}

.footer__links a,
.footer__links button {
  font-family: var(--font-body);
  font-size: var(--text-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-inverse);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer__links a:hover,
.footer__links button:hover {
  color: var(--color-accent-on-dark);
}

/* ── cookie consent ── */

.consent {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 60;
  width: min(420px, calc(100vw - 2 * var(--space-4)));
  background: var(--noir-950);
  border: 1px solid var(--noir-700);
  border-radius: var(--radius-large);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  color: var(--color-text-inverse);
}

.consent[hidden] {
  display: none;
}

.consent__text {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--noir-100);
}

.consent__text a {
  color: var(--color-accent-on-dark);
}

.consent__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* compact buttons so all three actions sit on one line */
.consent__actions .btn {
  min-height: 36px;
  padding: 9px 18px 7px;
  white-space: nowrap;
}

.consent__settings {
  margin-right: auto;
  padding-left: 0;
}

/* narrow screens: stack — accept (primary) first and full width,
   reject beneath it, settings centered as a quiet last line */
@media (max-width: 480px) {
  .consent__actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .consent__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .consent__actions .btn.primary {
    order: -1;
  }

  .consent__actions .consent__settings {
    order: 1;
    width: auto;
    align-self: center;
    margin: var(--space-1) 0 0;
  }
}

.consent-prefs {
  margin: auto;
  border: 1px solid var(--noir-700);
  border-radius: var(--radius-large);
  background: var(--noir-950);
  color: var(--color-text-inverse);
  width: min(480px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-6);
}

.consent-prefs::backdrop {
  background: color-mix(in srgb, var(--noir-950) 55%, transparent);
}

.consent-prefs__title {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: 400;
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.consent-prefs__lede {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--noir-100);
  margin-bottom: var(--space-4);
}

.consent-prefs__lede a {
  color: var(--color-accent-on-dark);
}

.consent-prefs__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--noir-800);
}

.consent-prefs__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-body);
  margin-bottom: var(--space-1);
}

.consent-prefs__desc {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: 1.55;
  color: var(--noir-300);
}

.consent-prefs__always {
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--noir-400);
  flex-shrink: 0;
}

.consent-prefs__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--noir-800);
}

/* ── legal / plain pages — bold light-pink paper ── */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-9);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  color: var(--color-text-primary);
  min-height: 100dvh;
}

body.page-light {
  background: var(--rose-100); /* ink on rose-100: 11.3:1 */
}

.page__close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-5);
  z-index: 5;
  font-family: var(--font-accent);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1.5px solid color-mix(in srgb, var(--noir-950) 40%, transparent);
  padding-bottom: 2px;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.page__close:hover {
  color: var(--rose-700);
  border-color: var(--rose-700);
}

.page h1 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 400;
  text-transform: uppercase;
}

.page h2 {
  font-family: var(--font-accent);
  font-size: var(--text-h5);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-4);
}

.page p,
.page li {
  font-size: var(--text-body-lg);
  line-height: 1.75;
}

.page ul {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.page__updated {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

/* ── 404 ── */

.lost {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  text-align: center;
  padding: var(--space-5);
  color: var(--color-text-inverse);
}

.lost__code {
  font-family: var(--font-accent);
  font-size: var(--text-h5);
  letter-spacing: 0.3em;
  color: var(--color-accent-on-dark);
}

.lost h1 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}


/* ── mobile ── */

@media (max-width: 768px) {
  /* scale the band texts so each stays on one line on small screens */
  .hero {
    --hero-text-size: clamp(1rem, 5vw, 1.5rem);
  }

  /* push the texts toward top and bottom so the centered logo
     keeps clear air between them; both center-aligned on mobile */
  .hero__band {
    top: 0;
    bottom: 0;
    transform: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    padding-top: 16vh;
    padding-bottom: 18vh;
  }

  .hero__edition,
  .hero__claim {
    text-align: center;
  }

  /* footer stacks and centers */
  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3) var(--space-4);
  }

  /* narrow screens: no room for the right-anchor — full-width column,
     gutters come from the padding */
  .manifesto__inner {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  /* no room for the side tickers next to the label — label only,
     and the grid collapses to a centered flex row */
  .ribbon-cta {
    display: flex;
    justify-content: center;
  }

  .ribbon-cta__ticker {
    display: none;
  }
}
