/* The look every HackTheFamily coming-soon page shares: Apple-style
   layout (big tight headlines, full-height dark hero, rounded tiles, a
   frosted top bar) in the "HackTheFamily — Branding collection" palette
   (docs/brand/). A page picks its colors with a brand class on <body>
   (brand-self, brand-physical, brand-psyche, brand-spirit); a brand
   tile on the HackTheSelf page carries its own class. Each site's Cloudflare build copies everything in shared/ into its
   public/ folder (coming-soon/README.md). */

/* Brand palettes, from the PDF's color system (Dark / Accent / Light).
   --glow and --accent-text are derived: a lighter accent for glowing
   on dark, a deeper one for reading on light. --pill-* keep the button
   text readable (4.5:1). */
.brand-self     { --dark: #061522; --accent: #168BFF; --glow: #4DA8FF; --light: #F4F7FA; --accent-text: #0B6FD6; --pill-bg: #0B6FD6; --pill-fg: #fff; --land: url(/brand/land-self.jpg); }
.brand-physical { --dark: #062D25; --accent: #159D79; --glow: #2DC49A; --light: #E8F4EE; --accent-text: #0F7D5C; --pill-bg: #0F7D5C; --pill-fg: #fff; --land: url(/brand/land-physical.jpg); }
.brand-psyche   { --dark: #20113F; --accent: #8445EF; --glow: #A57BFF; --light: #F0E9FC; --accent-text: #6A2FD6; --pill-bg: #6A2FD6; --pill-fg: #fff; --land: url(/brand/land-psyche.jpg); }
.brand-spirit   { --dark: #432506; --accent: #F3A11B; --glow: #FFB940; --light: #FFF2D8; --accent-text: #8F5300; --pill-bg: #F3A11B; --pill-fg: #2B1704; --land: url(/brand/land-spirit.jpg); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--dark);
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1024px) / 2));
  background: color-mix(in srgb, var(--dark) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}
.nav .wordmark { font-size: 17px; text-decoration: none; }
.nav .status { color: rgba(255, 255, 255, 0.72); }

.wordmark { font-weight: 800; letter-spacing: -0.025em; color: #fff; }
.wordmark span { color: var(--glow); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 92px 22px 24px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 45% at 50% 38%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    var(--dark);
}
/* Keeps hero text crisp where it sits over the landscape */
.hero .display, .hero .tagline, .hero .sub { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.hero .horizon {
  position: absolute; inset: auto 0 0 0; z-index: -1;
  height: 42%;
  background: var(--land) center 60% / cover no-repeat;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 65%);
  mask-image: linear-gradient(to bottom, transparent, #000 65%);
  filter: saturate(1.1);
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.display {
  margin: 0;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.display span { color: var(--glow); }
.tagline {
  margin: 18px 0 0;
  font-size: clamp(13px, 1.6vw, 15px); font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.sub {
  margin: 22px auto 0; max-width: 30em;
  font-size: clamp(19px, 2.4vw, 24px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.78);
}
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px; padding: 12px 22px;
  border-radius: 980px;
  background: var(--pill-bg);
  color: var(--pill-fg); font-size: 16px; font-weight: 600; text-decoration: none;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--accent) 45%, transparent);
}
.pill.quiet { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.18); }
a.pill:hover { filter: brightness(1.08); }

/* The luminous app icon, its square background faded into the page */
.glowmark {
  width: min(64vw, 340px, 42vh); width: min(64vw, 340px, 42svh); aspect-ratio: 1;
  margin: 8px auto 28px;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  animation: float 7s ease-in-out infinite;
}
.hero-art { margin-top: 32px; width: min(86vw, 500px, 46vh); width: min(86vw, 500px, 46svh); }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 12vw, 140px) 22px; text-align: center; }
.section.light { background: var(--light); color: var(--dark); }
.section.black { background: #000; }
.headline {
  margin: 0 auto; max-width: 14em;
  font-size: clamp(36px, 6vw, 64px); line-height: 1.05; font-weight: 800; letter-spacing: -0.04em;
  text-wrap: balance;
}
.headline span { color: var(--accent-text); }
.section:not(.light) .headline span { color: var(--glow); }
.intro {
  margin: 20px auto 0; max-width: 34em;
  font-size: clamp(18px, 2.2vw, 21px); line-height: 1.45;
  color: color-mix(in srgb, currentColor 72%, transparent);
}

.tiles {
  list-style: none; padding: 0;
  margin: clamp(48px, 7vw, 72px) auto 0; max-width: 1024px;
  display: grid; gap: 16px;
  text-align: left;
}
.tile {
  border-radius: 28px;
  padding: 34px 30px;
  background: #fff;
  color: var(--dark);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.05);
}
.tile .num { font-size: 15px; font-weight: 700; color: var(--accent-text); letter-spacing: 0.04em; }
.tile h3 { margin: 10px 0 8px; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; }
.tile p { margin: 0; font-size: 17px; color: color-mix(in srgb, var(--dark) 70%, transparent); }

/* Brand tiles (the family grid): each in its own brand colors */
.brand-tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border-radius: 28px;
  padding: 40px 24px 36px;
  min-height: 460px;
  color: #fff; text-decoration: none;
  background:
    radial-gradient(70% 50% at 50% 34%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 72%),
    var(--dark);
}
.brand-tile .horizon {
  position: absolute; inset: auto 0 0 0; z-index: -1; height: 46%;
  background: var(--land) center / cover no-repeat;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 70%);
  mask-image: linear-gradient(to bottom, transparent, #000 70%);
}
.brand-tile img {
  width: 190px; height: 190px;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand-tile h3 { margin: 8px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.brand-tile h3 span { color: var(--glow); }
.brand-tile p { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.brand-tile .when {
  margin-top: auto; padding: 7px 16px; border-radius: 980px;
  font-size: 14px; font-weight: 600;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
a.brand-tile .when { background: var(--pill-bg); color: var(--pill-fg); border-color: transparent; }
a.brand-tile:hover img { transform: scale(1.06) translateY(-4px); }

/* The family strip on pillar pages */
.family {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 28px;
  margin: 40px auto 0; padding: 0; list-style: none;
}
.family a, .family span { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; font-size: 14px; font-weight: 600; }
.family img { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); transition: transform 0.4s; }
.family a:hover img { transform: translateY(-4px); }
.family .here img { outline: 2px solid var(--glow); outline-offset: 4px; }

/* ---------- Footer ---------- */
footer {
  padding: 28px 22px 44px;
  font-size: 13px; color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--dark);
}
footer .inner { max-width: 1024px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
footer p { margin: 0; }
footer a { color: rgba(255, 255, 255, 0.85); }

/* ---------- Motion ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes drift-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(5px, -9px); } }
@keyframes drift-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-9px, 6px); } }
@keyframes drift-c { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, 7px); } }
@keyframes pulse { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }

.venn { overflow: visible; animation: float 8s ease-in-out infinite; }
.venn .ring { mix-blend-mode: screen; transform-box: fill-box; transform-origin: center; }
.venn .a { animation: drift-a 9s ease-in-out infinite; }
.venn .b { animation: drift-b 11s ease-in-out infinite; }
.venn .c { animation: drift-c 10s ease-in-out infinite; }
.venn .core { transform-box: fill-box; transform-origin: center; animation: pulse 4s ease-in-out infinite; }
.venn .orbit { transform-box: view-box; transform-origin: 200px 200px; animation: spin 60s linear infinite; }

/* Scroll reveal: only when the script runs, so nothing hides without it */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (min-width: 734px) {
  .tiles.three { grid-template-columns: repeat(3, 1fr); }
  .tiles.two { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
