/* ============================================================
   The old site's footer (EU stars, drag-the-year timeline, ASCII
   skyline), on the new pages. Markup and behaviour come from
   /script.js (injectComponents, initFooterTimeline, initFooterScene,
   the newsletter form); the rules below are copied from /styles.css
   ("Footer" to "ASCII scene"), with the old site's colours, type and
   base rules scoped to the footer so they don't touch the page above.
   ============================================================ */

/* the old footer is sized in rem against a 20px root; the new pages use px */
html { font-size: 20px; }

footer {
  --bg: #050505;
  --fg: #fff;
  --muted: rgba(255,255,255,0.66);
  --muted-dim: rgba(255,255,255,0.45);
  --border: rgba(255,255,255,0.14);
  --border-strong: rgba(255,255,255,0.28);
  --secondary: #121214;
  --accent: #2f6fe0;
  --accent-soft: rgba(47,111,224,0.16);
  --max-w: 1400px;
  --radius: 4px;
  margin-top: clamp(96px, 12vw, 168px);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.0625rem;
  line-height: 1.65;
  isolation: isolate;
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { text-decoration: none; }
footer button { cursor: pointer; font-family: inherit; }
footer a:focus-visible, footer button:focus-visible, footer input:focus-visible {
  outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}

footer .btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875rem; font-weight: 500; letter-spacing: 0.04em;
  transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
}
footer .btn:hover { opacity: 0.85; border-color: var(--border-strong); transform: translateY(-1px); }

/* --- Footer --- */
footer { position: relative; overflow: hidden; border-top: 1px solid var(--border); }
footer::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-soft), transparent);
}
/* Deliberate EU-flag nod behind the star cluster: a soft diagonal wash
   into blue on the right side, not the tiled accent-glow system above —
   a one-shot gradient sized to the footer's own box, so it fades cleanly
   with no repeat/clip seam. */
footer::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 45%, var(--accent-soft) 100%);
  pointer-events: none;
  z-index: -2; /* behind .footer-stars (-1), not tinting the stars themselves */
}
.footer-stars {
  position: absolute;
  top: -70px; right: -70px;
  width: 320px; height: 320px;
  opacity: 0.85;
  pointer-events: none;
  z-index: -1;
}
/* Offset scales with size at the same ratio as the default (70/320 ≈
   0.219) so the same whole stars stay visible — just smaller, not
   re-clipped through different stars. */
@media (max-width: 899px) {
  .footer-stars { width: 165px; height: 165px; top: -36px; right: -36px; }
}
@media (max-width: 640px) {
  .footer-stars { width: 120px; height: 120px; top: -26px; right: -26px; }
}


/* --- Newsletter signup (shared component) --- */
.newsletter { text-align: center; }
.newsletter-heading {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.015em;
  text-align: center;
  color: var(--fg);
  margin-bottom: 1rem;
}
.newsletter-form { width: 100%; }
.newsletter-field-row {
  display: flex; gap: 0.5rem; flex-wrap: nowrap; justify-content: center;
}
.newsletter-input {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}
.newsletter-input::placeholder { color: var(--muted); }
.newsletter-input:focus { outline: none; border-color: var(--accent); }
.newsletter-submit {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  transition: opacity 0.2s, transform 0.15s;
}
.newsletter-submit:hover { transform: translateY(-1px); }
.newsletter-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.newsletter-consent {
  margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted); line-height: 1.6;
}
.newsletter-status {
  margin-top: 0.5rem; font-size: 0.8125rem; min-height: 1.2em;
}
.newsletter-status--ok { color: var(--accent); }
.newsletter-status--error { color: #ff8a8a; }
/* Very narrow phones: stack the field above the button so the email stays readable. */
@media (max-width: 360px) {
  .newsletter-field-row { flex-direction: column; }
}
.footer-main {
  max-width: var(--max-w); margin: 0 auto; padding: 2.75rem 2rem 2rem;
  display: flex; flex-direction: column; gap: 2.5rem;
}
@media (min-width: 900px) {
  .footer-main { flex-direction: row; justify-content: space-between; padding-right: 15rem; }
}
.footer-logo img { height: 1.6rem; width: auto; display: block; }
.footer-links { display: flex; gap: 2.5rem 3.5rem; flex-wrap: wrap; align-items: flex-start; }
.footer-col { display: flex; flex-direction: column; gap: 0.85rem; }
.footer-col-title {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.24em;
  color: var(--muted-dim); margin-bottom: 0.4rem;
}
.footer-col a { font-size: 0.7rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-col--newsletter { width: 15rem; max-width: 100%; }
.footer-newsletter { width: 100%; }
.footer-newsletter .newsletter { text-align: left; }
.footer-newsletter .newsletter-field-row { justify-content: flex-start; }
.footer-newsletter .newsletter-input { padding: 0.5rem 0.65rem; font-size: 0.7rem; }
.footer-newsletter .newsletter-submit { padding: 0.5rem 0.8rem; font-size: 0.7rem; }
.footer-newsletter .newsletter-consent { margin-top: 0.5rem; font-size: 0.6rem; text-align: left; color: var(--muted-dim); }
.footer-newsletter .newsletter-status { font-size: 0.6rem; }

.footer-bottom { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem 1.25rem; }
.footer-social { display: flex; gap: 1.1rem; padding: 0 0 0.9rem; }
.footer-social a { color: var(--muted-dim); transition: color 0.2s; display: inline-flex; }
.footer-social a:hover { color: var(--fg); }
.footer-social svg { width: 0.75rem; height: 0.75rem; fill: currentColor; }
.footer-bottom-inner {
  border-top: 1px solid var(--border); padding-top: 0.75rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem;
}
.footer-bottom p { font-size: 0.6rem; letter-spacing: 0.04em; color: var(--muted-dim); }
.footer-legal { display: flex; gap: 1.25rem; }
.footer-legal a { font-size: 0.6rem; letter-spacing: 0.04em; color: var(--muted-dim); transition: color 0.2s; }
.footer-legal a:hover { color: var(--fg); }

/* Footer timeline: "drag the year" (see initFooterTimeline in script.js). */
.ts { margin-top: 1.75rem; width: 15rem; max-width: 100%; --p: 50%; }
.ts-era { display: block; font-size: 0.6rem; color: var(--muted-dim); }
.ts-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.15rem 0 0.4rem; }
.ts-year { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 1.3rem; font-variant-numeric: tabular-nums; min-width: 3.4em; }
.ts-play {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 1px solid var(--border-strong);
  background: none; color: var(--fg); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.2s;
}
.ts-play:hover { border-color: var(--fg); }
.ts-play svg { width: 0.7rem; height: 0.7rem; fill: currentColor; }
.ts-icon-pause, .ts.is-playing .ts-icon-play { display: none; }
.ts.is-playing .ts-icon-pause { display: inline; }
.ts-hint { font-size: 0.55rem; color: var(--muted-dim); }
/* Solid line up to the thumb, dotted after it. */
.ts-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; margin: 0;
  background:
    linear-gradient(var(--fg), var(--fg)) 0 50% / var(--p) 2px no-repeat,
    radial-gradient(circle, var(--muted-dim) 0.9px, transparent 1.3px) 0 50% / 5px 5px repeat-x;
  cursor: ew-resize;
}
.ts-range:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.ts-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 8px; height: 14px; border-radius: 2px;
  background: #cfe0ff; border: none; box-shadow: 0 0 10px rgba(47,111,224,0.6);
}
.ts-range::-moz-range-thumb {
  width: 8px; height: 14px; border-radius: 2px; background: #cfe0ff; border: none;
  box-shadow: 0 0 10px rgba(47,111,224,0.6);
}
.ts-range::-moz-range-track { background: transparent; }
.ts-ends { display: flex; justify-content: space-between; margin-top: 0.35rem; font-size: 0.55rem; color: var(--muted-dim); }

/* Phones: the time slider drops to the bottom of the footer, right above
   the skyline it controls. The wrappers dissolve so their children can be
   reordered as one column. */
@media (max-width: 899px) {
  footer { display: flex; flex-direction: column; }
  .footer-main, .footer-brand { display: contents; }
  .footer-logo { order: 1; align-self: flex-start; padding: 2.75rem 2rem 0; }
  .footer-links { order: 2; padding: 2.5rem 2rem 2.5rem; }
  .footer-bottom { order: 3; width: 100%; }
  .ts { order: 4; width: auto; max-width: none; margin: 1.5rem 2rem 0.75rem; }
  .footer-ascii { order: 5; }
}

/* ASCII scene along the very bottom (see initFooterScene in script.js). */
.footer-ascii {
  margin: 0; padding: 0; overflow: hidden; white-space: pre;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10px; line-height: 1.1; color: var(--muted-dim);
  user-select: none;
}
@media (max-width: 640px) { .footer-ascii { font-size: 8px; } }

/* ---- the new site's type in the footer ----
   Everything in the footer is JetBrains Mono, like the rest of the site. */
footer { --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
.footer-col-title, .ts-era, .ts-hint, .ts-ends, .footer-bottom p, .footer-legal a { font-family: var(--mono); }
.ts-year { font-family: var(--mono); font-size: 1.1rem; font-weight: 500; letter-spacing: -0.02em; }
.footer-ascii { font-family: var(--mono); }

/* the new site's rules: square corners like every other field and button, and on phones
   the same 20px edge as the page above */
footer { --radius: 0; }
.ts-play { position: relative; }
.ts-play::after { content: ""; position: absolute; inset: -12px; }  /* a finger-sized tap area */
@media (max-width: 899px) {
  .footer-logo { padding-inline: 20px; }
  .footer-links { padding-inline: 20px; }
  .footer-bottom { padding-inline: 20px; }
  .ts { margin-inline: 20px; }
}
