/* =====================================================================
   Home hub – the front door
   The desktop layout is drawn directly over images/Home Page/background.png
   (3171 × 2050), so every element keeps the position it has in the Figma
   frame. Below the art the dark honeycomb body tile continues the page.
   On phones the same elements stack over a bright honeycomb tile.
   ===================================================================== */
body.home-hub {
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  color: var(--brown);
}

/* The background must stay aligned with the sub-page header honeycomb, so it
   uses the same --u grid.  At the design width (3172 px) the image is 4219u
   wide / 2111u tall, offset −230u to the left and pinned to the bottom.
   On narrow viewports 4219u shrinks below the viewport height, so we use
   max() to bump the width until the image (aspect ≈ 2:1) is tall enough to
   cover 100dvh.  2173/4342 ≈ 0.5004, so width ≥ 100dvh / 0.5004 ≈ 200dvh. */
.hub {
  position: relative;
  width: 100%;
  height: 100%;
  background-image: url("../images/Home Page/background.png");
  background-size: max(calc(4219 * var(--u)), 200dvh) auto;
  background-position: calc(-230 * var(--u)) bottom;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* The content lives on a fixed 3171 × 2050 canvas (so it lines up with the
   background art) but is scaled down to always fit the viewport height, so the
   home page never scrolls. The background itself stays at full width. The
   scale factor is computed in js/home.js (set as --hub-scale) so it works the
   same in every browser. */
.hub-stage {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  aspect-ratio: 3171 / 2050;
  transform: translateX(-50%) scale(var(--hub-scale, 1));
  transform-origin: top center;
}

/* The footer sits at the bottom of the static stage (no page scroll). */
.home-hub .site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 8px 16px;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------- mailbox */
.mailbox-card {
  position: absolute;
  left: 3.1%;
  top: -0.4%;
  width: 27.4%;
  aspect-ratio: 894 / 657;
  display: block;
  text-decoration: none;
  filter: drop-shadow(0 12px 18px rgba(74, 43, 0, 0.18));
  transition: transform 0.3s ease, filter 0.3s ease;
}
.mailbox-card img { width: 100%; height: 100%; object-fit: contain; }
.mailbox-card:hover,
.mailbox-card:focus-visible {
  transform: translateY(-4px) rotate(-0.5deg);
  filter: brightness(1.03) drop-shadow(0 20px 26px rgba(74, 43, 0, 0.26));
  outline: none;
}
.mailbox-card:focus-visible { outline: 4px solid #fff3b8; outline-offset: 6px; border-radius: 20px; }

/* ---------------------------------------------------------------- logo */
.hub-logo {
  position: absolute;
  left: 50%;
  top: -4.8%;
  width: 32.7%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 16px 22px rgba(74, 43, 0, 0.28));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}
.hub-logo img { width: 100%; height: 100%; object-fit: contain; }
.hub-logo:hover,
.hub-logo:focus-visible {
  transform: translateX(-50%) rotate(-3deg) scale(1.04);
  filter: drop-shadow(0 22px 30px rgba(74, 43, 0, 0.36)) contrast(1.08);
  outline: none;
}
.hub-logo:focus-visible { outline: 4px solid #fff3b8; outline-offset: 8px; border-radius: 50%; }

/* ---------------------------------------------------------------- next stream */
.stream-card {
  position: absolute;
  left: 68.8%;
  top: 4.4%;
  width: 27%;
  aspect-ratio: 862 / 578;
  display: block;
  background: url("../images/Home Page/DailyStreamInfo.png") center / 100% 100% no-repeat;
  color: var(--brown);
  text-decoration: none;
  filter: drop-shadow(0 12px 18px rgba(74, 43, 0, 0.18));
  transition: transform 0.3s ease, filter 0.3s ease;
}
.stream-card:hover,
.stream-card:focus-visible { transform: translateY(-4px) rotate(0.4deg); filter: brightness(1.03) drop-shadow(0 20px 26px rgba(74, 43, 0, 0.26)); outline: none; }
.stream-card:focus-visible { outline: 4px solid #fff3b8; outline-offset: 6px; border-radius: 24px; }

.stream-card-date {
  position: absolute;
  left: 4%;
  top: 3.2%;
  max-width: 55%;
  color: #f7e7a0;
  font-weight: 800;
  font-size: clamp(11px, 1.95vw, 38px);
  line-height: 1.15;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stream-card-body {
  position: absolute;
  left: 8%;
  right: 5%;
  top: 19%;
  bottom: 8%;
  display: flex;
  align-items: stretch;
  gap: 6%;
}
.stream-card-thumb {
  flex: 0 0 30%;
  align-self: flex-start;
  aspect-ratio: 2 / 3;
  border-radius: 8%;
  overflow: hidden;
  background: linear-gradient(180deg, #8a5a12, #4a2b00);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), inset 0 -8px 18px rgba(0, 0, 0, 0.18);
}
.stream-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stream-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  min-width: 0;
  flex: 1;
}
.stream-card-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(12px, 1.75vw, 34px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.stream-card-desc {
  font-size: clamp(10px, 1.15vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.stream-card-time {
  margin-top: auto;
  font-weight: 800;
  font-size: clamp(10px, 1.15vw, 22px);
  text-align: right;
}

/* ---------------------------------------------------------------- social links
   Each row is the link; the honey-coloured SVG is the button and the icon sits
   just outside it. Labels use Holtwood One SC, whose lowercase letters render
   as small capitals – exactly the "all caps, smaller lowercase" look in Figma. */
.hub-links {
  position: absolute;
  left: 50%;
  top: 41.6%;
  width: 40%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2.2vw;
}
.hub-link-row {
  display: flex;
  align-items: center;
  gap: 2%;
  width: 100%;
  color: var(--cream);
  text-decoration: none;
  filter: drop-shadow(0 10px 14px rgba(74, 43, 0, 0.3));
  transition: transform 0.25s ease, filter 0.25s ease;
}
.hub-link-row:hover,
.hub-link-row:focus-visible { transform: translateY(-2px) scale(1.01); filter: brightness(1.08) drop-shadow(0 14px 20px rgba(74, 43, 0, 0.38)); outline: none; }
.hub-link-row:focus-visible .hub-link { box-shadow: 0 0 0 4px #fff3b8; }
.hub-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5.2 / 1;
  padding: 0 5%;
  background: url("../images/Home Page/button.svg") center / 100% 100% no-repeat;
  color: var(--cream);
  text-align: center;
  transition: box-shadow 0.2s ease;
}
.hub-link-label {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(18px, 3.1vw, 62px);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-shadow: 0 2px 3px rgba(61, 35, 0, 0.35);
}
.hub-link-icon {
  flex: 0 0 15%;
  width: 15%;
  aspect-ratio: 1;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(74, 43, 0, 0.32));
  transition: transform 0.25s ease;
}
.hub-link-icon img { width: 100%; height: 100%; object-fit: contain; }
.hub-link-row:hover .hub-link-icon,
.hub-link-row:focus-visible .hub-link-icon { transform: scale(1.08) rotate(-3deg); }

/* ---------------------------------------------------------------- phones */
@media (max-width: 900px) {
  body.home-hub {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
    background-color: #f7d03c;
    background-image: url("../images/honeycomb-bright.svg");
    background-size: calc(245 * var(--u)) calc(424.6 * var(--u));
    background-position: 50% 0;
    color: var(--brown);
  }
  .hub {
    height: auto;
    min-height: 100dvh;
    padding: 18px 16px 44px;
    background-image: none;
  }
  .hub-stage {
    position: static;
    aspect-ratio: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
  }
  .hub-logo {
    position: static;
    order: 1;
    width: min(58vw, 280px);
    transform: none;
  }
  .hub-logo:hover,
  .hub-logo:focus-visible { transform: rotate(-3deg) scale(1.04); }
  /* socials come first, then mailbox + stream preview below them */
  .hub-links {
    position: static;
    order: 2;
    width: min(92vw, 430px);
    transform: none;
    gap: 12px;
    margin-top: 4px;
  }
  .mailbox-card {
    position: static;
    order: 3;
    width: min(92vw, 430px);
  }
  .stream-card {
    position: relative;   /* provides a containing block for its absolute children */
    left: auto;
    top: auto;
    order: 4;
    width: min(92vw, 430px);
  }
  .stream-card-date { font-size: clamp(13px, 4vw, 22px); }
  .stream-card-title { font-size: clamp(14px, 4.2vw, 22px); }
  .stream-card-desc,
  .stream-card-time { font-size: clamp(11px, 3.2vw, 16px); }
  .hub-link-label { font-size: clamp(18px, 6.2vw, 34px); }
  .home-hub .site-footer {
    position: static;
    background: none;
    text-shadow: none;
    color: var(--brown);
    opacity: 0.78;
  }
}

@media (max-width: 480px) {
  .hub { padding-inline: 12px; }
  .hub-links { width: min(94vw, 390px); }
  .hub-link { padding-inline: 4%; }
}
