/* ==========================================================
   Dear 2050 — stylesheet
   Night-sky look: near-black blue background, soft color fades further
   down the page, heavy film grain, white text. All art is drawn in CSS/SVG.
   To retune the colors, change the variables in :root.
   ========================================================== */

:root {
  /* Background */
  --night: #06070f;        /* page background, near black */

  /* Text */
  --text: #f7f5fb;         /* main text, soft white */
  --muted: #b3b6d3;        /* secondary text */
  --cream: #ffeecb;        /* warm highlight (flyer's cream yellow) */

  /* Glow colors */
  --peach: #ffb98f;
  --coral: #ff9a8b;
  --pink: #f48bb8;
  --violet: #a58cff;

  --rule: rgba(247, 245, 251, 0.16);

  /* Film grain strength (0 = off) */
  --grain-specks: 0.09;
  --grain-stipple: 0.45;

  --display: "Fraunces", "Didot", "Bodoni MT", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 72rem;
  --gutter: 1.25rem;
}

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

html {
  position: relative;   /* so the grain layer (html::after) spans the whole page */
  scroll-behavior: smooth;
  scroll-padding-top: 5.75rem;
  background: var(--night);
  color-scheme: dark;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* Keep the footer at the bottom of short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; position: relative; }

/* Page background: near-black, with big, very soft fades of color down the
   sides further along the page and a dusk fade at the very bottom. */
body::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 50rem at 112% 42%, rgba(196, 120, 190, 0.13), transparent 72%),
    radial-gradient(60rem 50rem at -14% 60%, rgba(96, 108, 236, 0.17), transparent 72%),
    radial-gradient(56rem 44rem at 108% 80%, rgba(236, 160, 150, 0.09), transparent 72%),
    linear-gradient(to bottom, transparent calc(100% - 38rem), rgba(64, 70, 160, 0.45) calc(100% - 10rem), rgba(122, 130, 214, 0.6) 100%);
}

/* Film grain over the whole page, like last year's artwork. Two layers of
   the same generated noise: light specks that show on the dark areas, and
   an "overlay" blend that stipples the colored glows. White text is not
   affected. To make it stronger or weaker, change the two opacity values
   (--grain-specks, --grain-stipple) in :root. */
body::after {
  content: "";
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='2 0 0 0 -0.5  2 0 0 0 -0.5  2 0 0 0 -0.5  0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: var(--grain-stipple);
}
html::after {
  content: "";
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  2.4 0 0 0 -0.95'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-specks);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration-color: var(--coral); text-underline-offset: 0.2em; }
a:hover { color: var(--peach); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0 0 0.5em; }
h1, h2 { line-height: 1.1; }
h3 { line-height: 1.25; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.medium { max-width: 56rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--cream); color: var(--night); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #14101f;
  /* soft sunset fade: peach, pink, lavender (pale, so the dark text stays readable) */
  background: linear-gradient(100deg, #ffe3cf, #f9c6de 40%, #d3c8ff 75%, #c3bbff) 0% 50% / 160% 100%;
  transition: background-position 0.3s;
  position: relative; z-index: 6;   /* sits above the page grain layers, so the button stays clean */
  border-radius: 999px;
  padding: 0.6em 1.3em;
}
.btn:hover { color: #14101f; background-position: 100% 50%; }   /* the fade slides a little toward lavender; color stops the text turning peach like other links */
.btn-small { font-size: 0.9rem; padding: 0.45em 1.15em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(6, 7, 15, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 2rem; min-height: 4rem; padding-top: 0.75rem; }   /* padding-top: extra room above the menu */

/* At the very top of the page the header bar is clear, so the top of the page
   is one clean dark field; it turns into the dark bar as you start scrolling.
   (Browsers without scroll-driven animations just show the dark bar.) */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-solid linear both;
    animation-timeline: scroll(root);
    animation-range: 0 10rem;
  }
}
@keyframes header-solid {
  from { background-color: rgba(6, 7, 15, 0); border-bottom-color: transparent; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
  to { background-color: rgba(6, 7, 15, 0.78); border-bottom-color: var(--rule); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}

.wordmark {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--text);
  text-decoration: none;
}
.wordmark em { font-style: italic; }
.wordmark:hover { color: var(--peach); }

.site-nav { display: flex; gap: 1.75rem; margin-left: auto; }
.site-nav a {
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--text);
  padding: 0.3rem 0;
}
.site-nav a:hover { color: var(--peach); }

/* ---------- Hero ----------
   Title, subtitle, then date / time / address beside the RSVP button, centered
   over a uniform grid of faint dots on the dark, grainy background. */

.hero {
  --header-h: 4.75rem;   /* height of the header bar above */
  --dot: rgba(160, 166, 235, 0.2);   /* the grid dots */
  --dot-pitch: 14px;     /* distance between dots */
  position: relative;
  text-align: center;
  min-height: min(52rem, calc(100vh - var(--header-h)));
  display: flex;
  align-items: center;
  padding: 3rem 0 5.5rem;
}
.hero::before {
  /* uniform grid of faint dots behind the title; to change it, edit --dot
     (color / strength) and --dot-pitch (spacing) on .hero */
  content: "";
  position: absolute; z-index: -1;
  left: 0; right: 0; bottom: 0;
  top: calc(-1 * var(--header-h));   /* runs up behind the header */
  pointer-events: none;
  background: radial-gradient(circle, var(--dot) 1.5px, transparent 2px) 50% 0 / var(--dot-pitch) var(--dot-pitch);
  /* fade the grid out at the bottom of the hero */
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.hero-inner { width: 100%; }
.hero-inner::before {
  /* brighter dots in vertical lines hanging from the top of the page, on the
     same grid as the faint dots: short above the title, longer toward the
     sides, peach on the left through pink to lavender on the right. The picture is
     assets/img/hero-accents.svg, made by tools/make-hero-accents.py. */
  content: "";
  position: absolute; z-index: -3;
  left: 0; right: 0; bottom: 0;
  top: calc(-1 * var(--header-h));
  pointer-events: none;
  background: url("../img/hero-accents.svg") 50% 0 / 2800px 980px no-repeat;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

.hero-title {
  font-size: clamp(4.5rem, 13vw, 11.9rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-title em { font-style: italic; }
/* A patch of the background color behind the title, soft at the edges. It
   sits above the brighter dots and below the faint grid, so the brighter
   dots never show behind "Dear 2050". */
.hero-title { position: relative; width: fit-content; margin-inline: auto; }
.hero-title::before {
  content: "";
  position: absolute; z-index: -2;
  inset: -0.1em -0.15em;
  background: var(--night);
  box-shadow: 0 0 1.25rem 1.25rem var(--night);
}

.hero-sub {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  max-width: 39rem;
  margin: 1.75rem auto 0;
  text-wrap: balance;
}

/* Date / time / address on the left, RSVP button on the right; they stack on phones */
.hero-details {
  margin-top: 3.5rem;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 1.5rem 2.5rem;
}
.hero-facts { margin: 0; text-align: left; }
.hero-facts span { display: block; }
/* date, time and address: one font, one size */
.fact-date,
.fact-time,
.fact-venue { font-family: var(--body); font-size: 1.4rem; line-height: 1.4; }

.hero-actions { margin: 0; }
.hero-actions .btn { font-size: 1.05rem; letter-spacing: 0.16em; padding: 1em 3em; }

/* ---------- Sections ---------- */

.section { padding: 2.25rem 0; }
.hero + .section { padding-top: 2.5rem; }
.section.flush-top { padding-top: 0; }

/* Section heading with a sunset-colored rule underneath */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  padding-bottom: 0.55rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--peach), var(--pink) 30%, var(--violet) 60%, rgba(111, 125, 255, 0)) bottom left / 100% 1px no-repeat;
}

/* Questions list in "About the conference" */
.questions { margin: 1.25em 0; padding-left: 1.25em; }
.questions li { margin: 0 0 0.4em; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.links a { font-weight: 600; }
.links a::after { content: " \2192"; color: var(--peach); }

.subhead { font-size: 1.45rem; margin: 0.75rem 0 0.6rem; }

/* ---------- Speakers ---------- */

/* Headshots, once added as <img class="avatar"> */
.avatar {
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.speakers {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem 1.5rem;
}
.speaker .avatar { width: 100%; margin-bottom: 1rem; }
.speaker h3 { font-size: 1.4rem; margin-bottom: 0.35rem; }
.speaker .role { font-size: 0.9rem; line-height: 1.5; color: var(--muted); margin: 0; }
.speaker .bio { font-size: 0.92rem; margin: 0.75rem 0 0; }

/* ---------- Program ---------- */

.schedule { list-style: none; padding: 0; margin: 2rem 0 1rem; }
.slot {
  display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; align-items: baseline;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}
.slot:last-child { border-bottom: 1px solid var(--rule); }
.slot .time {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--peach);
}
.slot .what { font-family: var(--display); font-size: 1.35rem; line-height: 1.3; }

/* ---------- Venue ---------- */

.address { font-size: 1.2rem; line-height: 1.55; }
.address strong { font-family: var(--display); font-weight: 500; font-size: 1.45rem; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 3rem; padding: 2.5rem 0 1.75rem; font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.footer-inner p { margin: 0; }
.footer-contact p + p { margin-top: 0.3rem; }
.site-footer a { text-decoration-color: var(--cream); }
.copyright { font-size: 0.85rem; color: rgba(247, 245, 251, 0.75); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .speakers { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  /* On phones the header is just the menu: the "Dear 2050" wordmark and the
     RSVP button are hidden (both are in the hero right below). */
  .wordmark, .header-inner .btn-small { display: none; }
  .header-inner { min-height: 3.25rem; padding-top: 0; }
  .site-nav {
    width: 100%; margin: 0;
    justify-content: space-between;
    gap: 1rem;
  }
  .site-nav a { white-space: nowrap; }
  html { scroll-padding-top: 4.5rem; }
  .hero { --header-h: 3.3rem; }
}

@media (max-width: 560px) {
  .hero { padding: 2.5rem 0 3.5rem; }
  .hero-details { margin-top: 2.5rem; flex-direction: column; align-items: stretch; }
  .hero-facts { text-align: center; }
  .section { padding: 1.75rem 0; }
  .hero-actions .btn { display: block; text-align: center; }
  .slot { grid-template-columns: 1fr; gap: 0.25rem; }
}
