/* Home page (index.html): shorter hero + meetup timeline. Loaded after the theme's main.css. */

/* ---------- Hero ---------- */
/* Title + timer sit at the top over the wall; the photo is pinned to its bottom edge so the people
   fill the lower part. !important beats the theme's parallax script. */
#banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 86vh;
  background-image: url("/images/home/hero-2023.jpg?v=2");
  background-attachment: scroll !important;
  background-position: 50% 100% !important;
  background-size: cover;
}
#banner:before { display: none; }
/* Dark where the text is, lighter over the people */
#banner:after {
  background-image: linear-gradient(180deg,
    rgba(14, 15, 20, 0.9) 0%, rgba(14, 15, 20, 0.74) 24%, rgba(14, 15, 20, 0.32) 50%,
    rgba(14, 15, 20, 0.34) 80%, rgba(14, 15, 20, 0.82) 100%);
}
#banner .content {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: calc(var(--sn-h, 60px) + 4.5vh) 20px 0;
  text-align: center;
}
#banner .content header { display: block; }
#banner .content header h2 { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.6); }

.hero-tag {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8em;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

/* Live "how long the Discord has existed" counter: one glass panel, one row on every screen */
.hero-timer {
  display: inline-flex;
  align-items: flex-start;
  margin: 1.3em auto 0;
  padding: 0.75em 1.1em 0.65em;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(32, 33, 43, 0.78), rgba(14, 15, 20, 0.78));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: Roboto, Helvetica, Arial, sans-serif;
}
.ht-seg { display: flex; flex-direction: column; align-items: center; min-width: 2.5em; padding: 0 0.35em; }
.ht-num {
  display: block;
  color: #fff;
  font-size: 1.9em;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  line-height: 1;
}
.ht-s .ht-num { color: #ff6f86; }

/* Odometer digits (built by home.js): each digit is a 0-9 strip that rolls up to the new number */
.hero-timer { --dh: 1.08em; }
.ht-num { display: flex; justify-content: center; }
.ht-digit {
  display: inline-block;
  height: var(--dh);
  overflow: hidden;
  line-height: var(--dh);
  /* soft fade at the top and bottom of each digit window, so rolling digits glide in and out */
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.ht-strip { display: block; transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.ht-strip > span { display: block; height: var(--dh); text-align: center; }
.ht-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ht-lab {
  margin-top: 0.55em;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.48em;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}
.ht-div { align-self: stretch; width: 1px; margin: 0.15em 0.45em; background: rgba(255, 255, 255, 0.14); }
.ht-colon {
  color: rgba(255, 255, 255, 0.42);
  font-size: 1.9em;
  font-weight: 300;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) { .ht-strip { transition: none; } }

/* Shorter desktop screens (e.g. 1366x768, 1536x864): tighten so the title and timer clear the people's heads */
@media screen and (min-width: 737px) and (max-height: 880px) {
  #banner .content { padding-top: calc(var(--sn-h, 60px) + 2vh); }
  #banner .content header h2 { font-size: 2.1em; }
  .hero-tag { margin-top: 0.3em; }
  .hero-timer { margin-top: 0.9em; padding: 0.6em 1em 0.55em; }
  .ht-num, .ht-colon { font-size: 1.65em; }
}

/* ---------- Meetups section ---------- */
.hm {
  --hm-bg: #1c1d26;
  --hm-card: #272833;
  --hm-line: rgba(255, 255, 255, 0.1);
  position: relative;
  padding: 4.5em 0 3em;
  background: var(--hm-bg);
  font-family: Roboto, Helvetica, Arial, sans-serif;
}

.hm-head { margin: 0 auto 1.2em; padding: 0 24px; text-align: center; }
.hm-head h2 { margin: 0 0 0.25em; color: #fff; font-size: 2.2em; font-weight: 300; }
.hm-head p { margin: 0; color: rgba(255, 255, 255, 0.65); font-weight: 300; }

/* Year jump bar: pins under the site nav while you scroll the timeline */
.hm-years {
  position: sticky;
  top: var(--sn-h, 60px);
  z-index: 5;
  margin: 0 0 2.2em;
  padding: 12px 16px;
  background: var(--hm-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hm-years-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hm-years a {
  padding: 6px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.hm-years a:hover { border-color: var(--c); }
.hm-years a.is-current {
  border-color: var(--c);
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: #fff;
}

.hm-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- Timeline ---------- */
.hm-timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.hm-timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 47px;
  width: 2px;
  background: var(--hm-line);
}

.hm-entry {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0 26px;
  margin: 0 0 26px;
  padding: 0;
  scroll-margin-top: calc(var(--sn-h, 60px) + 72px);
}

.hm-year { position: relative; padding-top: 20px; text-align: center; }
.hm-year span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 4px 0;
  background: var(--hm-bg);
  color: var(--c);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}
.hm-year::after {
  content: "";
  position: relative;
  z-index: 1;
  display: block;
  width: 12px;
  height: 12px;
  margin: 6px auto 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 4px var(--hm-bg);
}

.hm-card {
  display: grid;
  /* Photo column sized to the photo's shape (about 270px tall), so it fills its side of the card */
  grid-template-columns: clamp(26%, calc(var(--hm-arn, 1.5) * 270px), 54%) minmax(0, 1fr);
  overflow: hidden;
  background: var(--hm-card);
  border: 1px solid var(--hm-line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease;
}
.hm-card:hover { border-color: var(--c); }

/* Photos are pre-cropped to the people and never cropped again here. If the frame is a different
   shape than the photo, the gap is filled with a blurred copy of the same photo. */
.hm-photo { position: relative; display: block; overflow: hidden; min-height: 240px; background: var(--hm-bg); border: 0; }
.hm-photo::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: var(--hm-img) center / cover no-repeat;
  filter: blur(22px) brightness(0.45);
}
.hm-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; }

.hm-body { padding: 24px 30px 26px; }
.hm-kicker {
  margin: 0 0 6px;
  color: var(--c);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}
.hm-body h3 { margin: 0 0 10px; color: #fff; font-size: 26px; font-weight: 300; letter-spacing: 0; line-height: 1.25; }
.hm-body p { margin: 0 0 14px; color: rgba(255, 255, 255, 0.8); font-size: 16px; font-weight: 300; line-height: 1.7; }
.hm-body p:last-child { margin-bottom: 0; }

.hm-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.hm-tags li {
  padding: 4px 12px;
  border: 1px solid var(--c);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.hm-link { border: 0; color: var(--c); font-size: 14px; font-weight: 500; }

/* Latest meetup: wide photo on top, full story underneath */
.hm-entry--feature .hm-card { grid-template-columns: 1fr; }
.hm-entry--feature .hm-photo,
.hm-entry--wide .hm-photo { min-height: 0; aspect-ratio: var(--hm-ar); }
.hm-entry--feature .hm-photo::before,
.hm-entry--wide .hm-photo::before { display: none; }
/* Panoramic group shots: photo across the top, text underneath */
.hm-entry--wide .hm-card { grid-template-columns: 1fr; }
.hm-entry--wide .hm-body { padding: 24px 32px 26px; }
.hm-entry--feature .hm-body { padding: 28px 36px 32px; }
.hm-entry--feature .hm-body h3 { font-size: 34px; }
.hm-entry--feature .hm-body p { max-width: 78ch; font-size: 17px; }

/* Text-only card (2017, where it started) */
.hm-entry--text .hm-card { grid-template-columns: 1fr; }
.hm-entry--text .hm-body { padding: 26px 32px 28px; }

/* Next year teaser */
.hm-entry--next .hm-card { display: block; background: transparent; border-style: dashed; box-shadow: none; }
.hm-entry--next .hm-body { padding: 18px 26px; }
.hm-entry--next .hm-body h3 { margin-bottom: 4px; font-size: 22px; }
.hm-entry--next .hm-body p { color: rgba(255, 255, 255, 0.65); font-size: 15px; }

.hm-thanks { margin: 0 0 1.4em; color: rgba(255, 255, 255, 0.75); font-weight: 300; }

/* ---------- Phones ---------- */
@media screen and (max-width: 736px) {
  /* The theme's overflow-x: hidden stops the year bar from pinning; clip blocks sideways scroll without that side effect */
  html, body { overflow-x: clip; }

  #banner { min-height: 80vh; }
  #banner:before { height: 80vh; }
  #banner .content { padding: calc(var(--sn-h, 56px) + 3.5vh) 12px 0; }
  /* Same single row, just smaller */
  .hero-timer { padding: 0.65em 0.6em 0.55em; border-radius: 14px; }
  .ht-seg { min-width: 0; padding: 0 0.28em; }
  .ht-num, .ht-colon { font-size: clamp(20px, 6.4vw, 28px); }
  .ht-lab { font-size: 8.5px; letter-spacing: 0.12em; }
  .ht-div { margin: 0.1em 0.3em; }

  .hm { padding-top: 3em; }
  .hm-head h2 { font-size: 1.8em; }
  .hm-years { margin-bottom: 1.6em; padding: 10px 12px; }
  .hm-years-inner { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .hm-years-inner::-webkit-scrollbar { display: none; }
  .hm-years a { flex: none; }
  .hm-inner { padding: 0 14px; }

  /* Year lives in the kicker on phones; drop the side rail */
  .hm-timeline::before { display: none; }
  .hm-entry { grid-template-columns: 1fr; margin-bottom: 18px; scroll-margin-top: calc(var(--sn-h, 56px) + 64px); }
  .hm-year { display: none; }
  .hm-card { grid-template-columns: 1fr; }
  .hm-photo { min-height: 0; aspect-ratio: var(--hm-ar); }
  .hm-photo::before { display: none; }
  .hm-body, .hm-entry--feature .hm-body { padding: 18px 18px 20px; }
  .hm-body h3 { font-size: 23px; }
  .hm-entry--feature .hm-body h3 { font-size: 27px; }
  .hm-body p, .hm-entry--feature .hm-body p { font-size: 15.5px; }
}
