/* Chaffline homepage -----------------------------------------------------
   The hero, the mock Discord window and the homepage sections. The palette,
   type, buttons, top bar and footer are the whole site's and live in
   site.css; this sheet loads after it, and every rule is scoped to `.night`
   on <body> so none of it reaches another page.

   The mock window keeps its own greys (--dc-*): it is drawn to Discord's
   proportions, tinted into the page's indigo, and it is the one place on the
   site that is a picture of somewhere else.
   -------------------------------------------------------------------------- */

.night {
  --dc-rail: #12152B;
  --dc-side: #1A1E3A;
  --dc-chat: #222745;
  --dc-deep: #1B1F3C;
  --dc-text: #DDDCEC;
  --dc-mute: #9A9DBE;
}

.night .shell { width: min(1280px, 100% - 2rem); }

/* Speaker colours. One class carries both the avatar fill and the name, so a
   member reads as the same person in the sidebar and in the channel. */
.night .u1 { --u: #8FC9F2; }
.night .u2 { --u: #C7B8FF; }
.night .u3 { --u: #8EE3B5; }
.night .u4 { --u: #FFD18A; }
.night .u5 { --u: #F3A6A0; }
.night .u6 { --u: #B5E08E; }
.night .u7 { --u: #FFB8D9; }
.night .u8 { --u: #A5F0EC; }

/* Hero --------------------------------------------------------------------- */

.night .hero { position: relative; overflow: hidden; padding-block: 4rem 12rem; }

.night .sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 520px at 78% -10%, #2B2F63 0%, transparent 60%),
    radial-gradient(600px 400px at 8% 110%, #221B44 0%, transparent 70%);
}

.night .moon {
  position: absolute;
  right: 1.5%;
  top: 26px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  box-shadow: inset -20px 9px 0 0 var(--moon);
  opacity: .85;
  transform: rotate(-20deg);
  filter: drop-shadow(0 0 40px rgba(236, 233, 247, .25));
}

.night .hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, .78fr) minmax(0, 1.22fr);
  gap: 3.5rem;
  align-items: center;
}

.night .hero-copy h1 {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: .98;
  font-weight: 750;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -.02em;
}
.night .hero-copy h1 .dim { display: block; color: var(--moon-2); }

.night .lede { line-height: 1.55; margin-top: 1.6rem; max-width: 30em; color: var(--moon-3); font-size: 1.06rem; }
.night .cta-row { display: flex; flex-wrap: wrap; margin-top: 2.1rem; gap: .75rem; }

/* The channel -------------------------------------------------------------
   A mock of the place the product actually works, built to the shape Discord
   uses: server rail, channel list, messages, member list. The window is
   decorative - it is announced to a screen reader once, by the label on .dc,
   and everything inside it is hidden from the accessibility tree. */

.night .dc {
  display: grid;
  grid-template-columns: 52px 156px minmax(0, 1fr) 140px;
  background: var(--dc-chat);
  border: 1px solid #0D0F20;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 90px -34px rgba(0, 0, 0, .75);
}

.night .rail {
  background: var(--dc-rail);
  padding: .6rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
}
.night .guild {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: #0E1022;
  background: var(--u, var(--moon-2));
  position: relative;
}
.night .guild.is-here { background: var(--lamp); }
.night .guild.is-here::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--moon);
}
.night .rail hr { width: 24px; border: 0; border-top: 1px solid #262B4C; margin: .2rem 0; }

.night .side { background: var(--dc-side); display: flex; flex-direction: column; min-width: 0; }
.night .side-head {
  padding: .8rem .9rem;
  font-weight: 700;
  font-size: .88rem;
  color: var(--dc-text);
  border-bottom: 1px solid #12152B;
}
.night .side-body { padding: .75rem .5rem; display: grid; gap: 2px; align-content: start; }
.night .grp {
  font-size: .68rem;
  font-weight: 700;
  color: var(--dc-mute);
  padding: .6rem .5rem .25rem;
  letter-spacing: .04em;
}
.night .ch {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .5rem;
  border-radius: 6px;
  color: var(--dc-mute);
  font-size: .88rem;
}
.night .ch .hash { opacity: .7; }
.night .ch.is-here { background: #2C325C; color: #fff; }
.night .ch.is-unread { color: var(--dc-text); font-weight: 700; }
.night .pip {
  margin-inline-start: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--flag);
  color: #2A1210;
  font-size: .62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.night .chat { display: flex; flex-direction: column; min-width: 0; }
.night .chat-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--dc-side);
  font-size: .95rem;
  font-weight: 700;
  color: var(--dc-text);
}
.night .chat-head .hash { color: var(--dc-mute); font-weight: 400; }
.night .chat-head .topic {
  display: none;
  font-weight: 400;
  font-size: .82rem;
  color: var(--dc-mute);
  border-inline-start: 1px solid #333863;
  padding-inline-start: .6rem;
}
@media (min-width: 1240px) { .night .chat-head .topic { display: block; } }

.night .feed {
  height: 548px;
  padding: .6rem 1rem 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .85rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 56px);
}
.night .m {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: .7rem;
  animation: night-arrive .4s ease-out both;
}
.night .av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--night);
  background: var(--u, var(--moon-2));
}
.night .m-head { display: flex; align-items: baseline; gap: .5rem; }
.night .nm { font-weight: 700; font-size: .93rem; color: var(--u, var(--dc-text)); }
.night .tag {
  font-size: .62rem;
  font-weight: 700;
  background: #5C63C8;
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  position: relative;
  top: -1px;
}
.night .ts { font-size: .68rem; color: var(--dc-mute); }
.night .say { font-size: .93rem; line-height: 1.45; color: var(--dc-text); overflow-wrap: anywhere; }
.night .m.is-gone .say {
  color: var(--dc-mute);
  text-decoration: line-through;
  text-decoration-color: var(--flag);
}

.night .embed {
  margin-top: .5rem;
  border-inline-start: 4px solid var(--lamp);
  background: var(--dc-deep);
  border-radius: 4px;
  padding: .6rem .75rem;
  max-width: 420px;
  animation: night-arrive .35s ease-out both;
}
.night .embed .et { font-weight: 700; font-size: .88rem; color: var(--lamp); }
.night .embed .eq { font-size: .82rem; color: var(--dc-text); margin-top: .2rem; }

.night .compose {
  margin: 0 1rem .9rem;
  background: var(--dc-deep);
  border-radius: 8px;
  padding: .62rem .9rem;
  font-size: .88rem;
  color: var(--dc-mute);
}

.night .mem { background: var(--dc-side); padding: .75rem .6rem; border-inline-start: 1px solid #12152B; }
.night .mem h2 {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: .68rem;
  font-weight: 700;
  color: var(--dc-mute);
  letter-spacing: .04em;
  margin: .5rem .4rem;
}
.night .mem ul { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .5rem; }
.night .mem li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .15rem .4rem;
  font-size: .88rem;
  color: var(--dc-mute);
}
.night .mem li.is-up { color: var(--dc-text); }
.night .pic {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
  background: var(--u, var(--moon-2));
}
.night .pic::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2.5px solid var(--dc-side);
  background: #F0B232;            /* idle, which is what a sleeping mod looks like */
}
.night .pic.is-on::after { background: #23A55A; }
.night .pic.is-off::after { background: #80848E; }

@keyframes night-arrive { from { opacity: 0; transform: translateY(8px); } }

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

.night .sec { padding-block: 6.5rem; border-top: 1px solid var(--edge); }
.night .sec h2 { font-size: clamp(2.1rem, 4vw, 3.25rem); line-height: 1.05; font-weight: 700; }
.night .sec-intro { margin-top: 1.1rem; max-width: 34em; color: var(--moon-3); }

.night .catches { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 4.5rem; align-items: start; }

.night .toggles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.night .toggles li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: var(--night-2);
  border: 1px solid var(--edge);
  font-size: .95rem;
}
.night .toggles li.is-off { color: var(--moon-2); background: transparent; }
.night .sw {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--lamp);
  position: relative;
  flex: none;
}
.night .sw::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lamp-ink);
}
.night .is-off .sw { background: var(--night-3); }
.night .is-off .sw::after { right: auto; left: 3px; background: var(--moon-2); }

.night .aside { margin-top: 1.6rem; font-size: .93rem; color: var(--moon-2); max-width: 30em; }

.night .ctrl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 3.5rem; border-top: 1px solid var(--edge); }
.night .ctrl > div { padding: 1.75rem 1.75rem 0 0; }
.night .ctrl > div + div { padding-inline-start: 1.75rem; border-inline-start: 1px solid var(--edge); }
.night .ctrl dt { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.32rem; font-weight: 650; margin-bottom: .5rem; }
.night .ctrl dd { margin: 0; color: var(--moon-3); font-size: .98rem; }

/* Pricing ------------------------------------------------------------------ */

.night .tiers { margin-top: 3rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.night .tier {
  padding: 1.6rem 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.night .tier.is-featured { background: var(--night-2); border-color: var(--lamp); }
.night .tier h3 { font-size: 1.1rem; font-weight: 650; }
.night .tier .p {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.night .tier .p small { font-size: .92rem; color: var(--moon-2); font-weight: 400; letter-spacing: 0; }
.night .tier .yr { font-size: .85rem; color: var(--moon-2); }
.night .tier .al { margin-top: .7rem; font-weight: 700; }
.night .tier .nt { font-size: .93rem; color: var(--moon-3); }
.night .tiers-foot { margin-top: 1.1rem; color: var(--moon-2); font-size: .93rem; }
.night .tiers-foot a { text-underline-offset: 3px; }

/* Closer, and the sun coming up ------------------------------------------- */

.night .dawn {
  padding-block: 8rem 7.5rem;
  text-align: center;
  background: linear-gradient(to bottom, var(--night) 0%, #3A2E5C 55%, var(--dawn) 100%);
}
.night .dawn h2 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.02; font-weight: 750; }
.night .dawn .btn { margin-top: 1.9rem; }
.night .dawn p { margin-top: 1.1rem; color: #EFE4EE; font-size: .95rem; }

/* Footer -------------------------------------------------------------------
   The dawn section above has already brought the sky up, so here the footer
   skips its own lead-in and starts at dawn. */

.night .footer { background: var(--dawn); padding-top: 3.5rem; }

/* Narrow ------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .night .hero-grid,
  .night .catches { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .night .dc { grid-template-columns: 52px minmax(0, 1fr) 140px; }
  .night .side { display: none; }
  .night .ctrl { grid-template-columns: minmax(0, 1fr); }
  .night .ctrl > div { padding: 1.5rem 0; }
  .night .ctrl > div + div { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--edge); }
  .night .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .night .moon { width: 78px; height: 78px; top: 20px; }
}

@media (max-width: 760px) {
  /* nothing to light at this width: the window fills it, and the moon would
     land on the headline. */
  .night .moon { display: none; }
}

@media (max-width: 620px) {
  /* Two stacked buttons of nearly-equal width read as a mistake; match them. */
  .night .cta-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .night .cta-row .btn { text-align: center; }
  .night .dc { grid-template-columns: minmax(0, 1fr); }
  .night .rail,
  .night .mem { display: none; }
  .night .toggles,
  .night .tiers { grid-template-columns: minmax(0, 1fr); }
  .night .sec { padding-block: 4.5rem; }
  .night .feed { height: 380px; }
  .night .dawn { padding-block: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .night .m,
  .night .embed { animation: none; }
}
