/* ==========================================================
   refoundspace.com — one full-width card per site.
   Same look as InfiniteBlogs (colours, fonts, buttons).
   ========================================================== */

:root {
  --bg: #050608;
  --text: #f3f4f8;
  --text-soft: #a3aabd;
  --blue: #1f6fd6;          /* main buttons */
  --blue-hover: #2a82ea;

  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;

  --fade-end: 63%;          /* where the dark fade on the left ends */
  --edge-fade: 0.55;        /* how dark the top/bottom edges get when cards stack */
  --top-fade: 60px;         /* dark fade at the top of the card under the banner */

  /* banner colours: orange glow on the left, blue on the right */
  --banner-from: 255, 122, 61;
  --banner-to: 31, 111, 214;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* hide scrollbars (scrolling still works) */
html, * { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- banner at the top (delete the <a class="banner"> in index.html to hide it) ---------- */
.banner {
  position: relative;
  isolation: isolate;       /* keeps the glow behind the words */
  flex-shrink: 0;
  height: 64px;
  padding: 0 32px 19px;     /* text sits in the top part, the glow fades out below it */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
/* the glow: orange left, blue right, fading to dark at the bottom */
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 160% at 20% 0%, rgba(var(--banner-from), 1) 0%, rgba(var(--banner-from), 0) 70%),
    radial-gradient(ellipse 55% 160% at 80% 0%, rgba(var(--banner-to), 1) 0%, rgba(var(--banner-to), 0) 70%),
    linear-gradient(90deg, rgba(var(--banner-from), 0.35), rgba(var(--banner-to), 0.35));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
}
/* thin line along the very top */
.banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(var(--banner-from), 0) 0%, rgb(var(--banner-from)) 30%, rgb(var(--banner-to)) 70%, rgba(var(--banner-to), 0) 100%);
}
.banner-cta { display: inline-flex; align-items: center; gap: 8px; }
.banner svg { transition: transform 0.2s var(--ease); }
.banner:hover svg { transform: translateX(4px); }
.banner:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

/* ---------- the stack of cards ----------
   Together they fill the screen: 1 card = whole screen, 2 = half each… */
.sites {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.site {
  position: relative;
  isolation: isolate;       /* keeps the picture layers behind the text */
  flex: 1 1 0;
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* galaxy picture */
.site-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.site:hover .site-bg { transform: scale(1.03); }

/* dark → see-through fade on the left */
.site::before {
  --side-fade: linear-gradient(90deg,
    rgba(5, 6, 8, 1) 0%,
    rgba(5, 6, 8, 0.9) calc(var(--fade-end) / 2),
    rgba(5, 6, 8, 0) var(--fade-end));
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--side-fade);
}
/* the card right under the banner fades into the dark at its top */
.banner + .sites .site:first-child::before {
  background:
    linear-gradient(180deg,
      rgba(5, 6, 8, 1) 0,
      rgba(5, 6, 8, 0.75) calc(var(--top-fade) * 0.3),
      rgba(5, 6, 8, 0) var(--top-fade)),
    var(--side-fade);
}

/* soft top/bottom edges so stacked cards blend together (only when there are 2+) */
.sites:has(.site + .site) .site::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(5, 6, 8, var(--edge-fade)) 0%,
    rgba(5, 6, 8, 0) 12%,
    rgba(5, 6, 8, 0) 88%,
    rgba(5, 6, 8, var(--edge-fade)) 100%);
}

/* the site's logo on the right */
.site-mark {
  position: absolute;
  right: 8%;
  top: 50%;
  z-index: -1;
  width: clamp(240px, 32vw, 470px);
  transform: translateY(-50%);
  opacity: 0.92;
  pointer-events: none;
}

.sites:has(.site + .site) .site-mark { width: clamp(220px, 26vw, 368px); }

/* ---------- text + button ---------- */
.site-body {
  width: min(720px, 100%);
  padding: 64px 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  animation: fade-up 0.7s var(--ease) backwards;
}
.site + .site .site-body { animation-delay: 0.08s; }

.site h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 72px;
  line-height: 1.02;
  letter-spacing: -1.5px;
  color: #fff;
}
/* smaller titles once cards share the screen */
.sites:has(.site + .site) .site h2 { font-size: 56px; }

.site p {
  margin: 0;
  max-width: 500px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-soft);
}

.btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.2s ease;
}
/* the whole card is clickable, not just the button
   (so never put a transform on .btn — it would shrink this back to the button) */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
}
.btn svg { transition: transform 0.2s var(--ease); }
.site:hover .btn {
  background: var(--blue-hover);
  box-shadow: 0 8px 24px rgba(31, 111, 214, 0.35);
}
.site:hover .btn svg { transform: translateX(4px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- phones: text at the bottom, fade from below ---------- */
@media (max-width: 720px) {
  :root { --top-fade: 140px; }

  /* banner: two short centred lines instead of one long one */
  .banner {
    height: auto;
    padding: 12px 16px 24px;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
  }
  .banner-cta { font-size: 13px; color: rgba(255, 255, 255, 0.82); }
  .site {
    min-height: 620px;
    align-items: flex-end;
  }
  .site-bg { object-position: 12% center; }
  .site::before {
    --side-fade: linear-gradient(0deg,
      rgba(5, 6, 8, 1) 0%,
      rgba(5, 6, 8, 0.9) 36%,
      rgba(5, 6, 8, 0) 66%);
  }
  .site-mark {
    right: auto;
    left: 50%;
    top: 18%;
    width: 260px;
    transform: translateX(-50%);
  }
  .site-body { padding: 0 20px 40px; gap: 14px; }
  .site h2,
  .sites:has(.site + .site) .site h2 { font-size: 42px; letter-spacing: -1px; }
  .site p { font-size: 16px; line-height: 1.55; }
  .btn { align-self: stretch; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
