@font-face {
  font-family: 'PolySans';
  src: url('/fonts/PolySans-Neutral.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PolySans';
  src: url('/fonts/PolySans-Median.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg:          #101010;
  --bg-mid:      #232323;
  --bg-raised:   #2B2B2B;
  --text:        #FFFFFF;
  --text-muted:  #8E8E8E;
  --accent:      #FB591B;
  --accent-soft: #F2A58E;
  --radius-lg:   28px;
  --page:        1120px;  /* content column shared by nav, hero and footer */
  --gutter:      48px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'PolySans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  background: linear-gradient(180deg, #212121 0%, var(--bg) 100svh) no-repeat, var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────── NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  /* Align nav content with the centred page column, not the window edges. */
  padding: 20px max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background 0.5s ease, backdrop-filter 0.5s ease, border-color 0.5s ease;
}

.nav.scrolled {
  background: rgba(16, 16, 16, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255,255,255,0.05);
}

.nav-logo img { height: 17px; width: auto; display: block; }

.nav-pill {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-pill:hover { color: var(--accent); }

/* ─────────────────────────────────────────────────────── HERO */
/* Home only: faint photo behind the hero, faded out toward the bottom. */
.home--photo { position: relative; isolation: isolate; overflow: hidden; }
.home--photo::before {
  content: "";
  /* Whole photo, full height, shifted left so the couple and their phone sit beside the headline. */
  position: absolute;
  top: 0; bottom: 0; left: -10vw;
  aspect-ratio: 3 / 2;
  z-index: -1;
  background: url("/img/hero-couple.jpg") center / cover no-repeat;
  opacity: 0.12;
  filter: grayscale(1);
  /* Fade out the right and bottom edges so the photo has no hard border. */
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent), linear-gradient(to bottom, #000 75%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 70%, transparent), linear-gradient(to bottom, #000 75%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}

.home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: clamp(48px, 8vw, 120px);
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 120px var(--gutter) 48px;
}

.hero h1 {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 24px;
}

.hero h1 span { color: var(--accent); }

.hero-sub {
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.65;
  color: #CFCFCF;
  max-width: 400px;
  margin-bottom: 40px;
}

.app-store-badge {
  display: inline-block;
  transition: opacity 0.2s;
}
.app-store-badge:hover { opacity: 0.8; }
.app-store-badge img { height: 48px; width: auto; display: block; }

.hero-phone {
  display: flex;
  justify-content: flex-end;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  /* Shows the top 80% of the screen; the cut bottom edge fades out. */
  aspect-ratio: 1125 / 1949;
  box-sizing: content-box;
  border: 9px solid #1E1E1E;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 46px 46px 0 0;
  border-bottom-width: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
  background: #000;
  overflow: hidden;
}

.phone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.phone img.is-active { opacity: 1; }

.home-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 22px var(--gutter) 28px;
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  border-top: none;
}
/* Divider spans the text width only, not the gutters. */
.home-foot::before {
  content: "";
  position: absolute;
  top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.home-foot nav { display: flex; gap: 24px; }

.home-foot a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.home-foot a:hover { color: var(--text); }

/* ──────────────────────────────────────────────── FOOTER */
footer {
  border-top: 1px solid rgba(255,255,255,0.055);
  padding: 44px 48px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.footer-logo img { height: 22px; width: auto; opacity: 0.6; display: block; }

.footer-nav {
  display: flex;
  gap: 32px;
  list-style: none;
}

.footer-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom a:hover { color: var(--text); }

/* ────────────────────────────────────────────── RESPONSIVE */
/* Desktop: the whole home page (nav, hero, footer) fits in one viewport; the phone scales with height. */
@media (min-width: 861px) {
  .home { height: 100svh; min-height: 560px; }
  .hero { min-height: 0; padding-top: 70px; padding-bottom: 38px; }  /* equal gaps: nav ↔ phone ↔ footer */
  /* Desktop shows the whole phone: no crop or fade. */
  .phone {
    width: auto; max-width: none;
    aspect-ratio: 1125 / 2436;
    height: clamp(360px, calc(100svh - 200px), 640px);
    border-bottom-width: 9px;
    border-radius: 46px;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 860px) {
  :root { --gutter: 24px; }
  /* Stacked layout is tall, so fit the photo to the width at the top instead of the full height. */
  .home--photo::before { bottom: auto; left: 0; width: 100%; }
  .nav-logo img { height: 14px; }
  .nav { padding: 16px var(--gutter); }

  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 104px 24px 32px;
    text-align: center;
  }

  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-phone { justify-content: center; }
  /* Home on mobile: title, then phone, then subtext and badge. */
  .hero-copy { display: contents; }
  .hero-copy h1 { order: 1; margin-bottom: 0; }
  .hero-phone:has(.phone) { order: 2; }
  .hero-copy .hero-sub { order: 3; margin-bottom: 0; }
  .hero-copy .app-store-badge { order: 4; justify-self: center; margin-top: -20px; }
  .phone { max-width: 220px; border-width: 7px 7px 0; border-radius: 36px 36px 0 0; }

  .home-foot {
    flex-direction: column;
    align-items: center;
    padding: 24px;
  }

  footer { padding: 36px 24px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ─────────────────────────────────────────────────────── JOIN */
.join { max-width: 560px; grid-template-columns: 1fr; text-align: center; }
.join .hero-sub { margin-left: auto; margin-right: auto; }

.join-code {
  display: inline-block;
  margin-bottom: 40px;
  padding: 18px 28px;
  border-radius: 16px;
  background: var(--bg-raised);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--text);
  user-select: all;
}

.join-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.join-open {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.join-open:hover { opacity: 0.85; }
