/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900; /* one variable file covers the whole range */
  font-display: swap;
}

@font-face {
  font-family: "Pirulen";
  src: url("/assets/fonts/pirulen.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {
  --void: #120a0e;
  --panel: #1c1015;
  --rule: #35202a;
  --red: #ff4a52;
  --ember: #ff9a5c;
  --up: #3ecf8e;
  --text: #f5eaeb;
  --muted: #a5888e;

  --body: "Archivo", system-ui, sans-serif;
  --display: "Pirulen", "Archivo", system-ui, sans-serif;

  /* Page furniture spans the window; only running text is held to a measure. */
  --shell: 78rem;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --gap: clamp(3rem, 7vw, 6rem);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Stops the sticky bar covering the top of a section you jump to. */
[id] {
  scroll-margin-top: 5.5rem;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Rules and backgrounds run the full window width; this holds their contents. */
.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------------------------------------------------------------- header */

/* Follows the page down, so Discord stays one click away at any scroll depth. */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--rule);
  background: rgb(18 10 14 / 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Without blur support the translucency would let text collide underneath. */
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .bar {
    background: var(--void);
  }
}

.bar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.mark {
  margin-right: auto;
  color: var(--red);
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.bar-nav {
  display: flex;
  gap: 1.75rem;
}

.bar-nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.bar-nav a:hover,
.bar-nav a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

/* No room for text links beside the wordmark and the button on a phone. */
@media (max-width: 34rem) {
  .bar-nav {
    display: none;
  }
}

.bar-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 1.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.bar-discord:hover,
.bar-discord:focus-visible {
  border-color: var(--muted);
  background: var(--panel);
}

.discord-glyph {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}

/* ---------------------------------------------------------------- hero */

.hero-inner {
  padding-block: clamp(3rem, 8vw, 6.5rem) var(--gap);
}

/* Wide: the status chip sits top right, opposite the wordmark, so the right
   side is balanced by the h1 rather than left holding a lone strip. Below
   this the grid collapses and source order takes over. */
@media (min-width: 56rem) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: clamp(2rem, 5vw, 4rem);
  }

  .hero-inner > h1 {
    grid-area: 1 / 1;
  }

  .hero-inner > .readout {
    grid-area: 1 / 2;
    justify-self: end;
    margin-top: 0.9rem;
  }

  .hero-inner > .hook {
    grid-area: 2 / 1;
  }

  .hero-inner > .lede {
    grid-area: 3 / 1;
  }

  .hero-inner > .cta {
    grid-area: 4 / 1;
    /* Grid items stretch by default, which would widen the button to the
       whole column. inline-flex does not override that; justify-self does. */
    justify-self: start;
  }
}

h1 {
  margin: 0;
  font-family: var(--display);
  /* Two more glyphs than "SAETA", and Pirulen is a wide face - capped lower
     so it cannot outgrow the hero column and wrap mid-name. */
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 0.95;
  text-wrap: balance;
  text-transform: uppercase;
}

/* The bridge between the wordmark and the description: large enough to be
   read as a statement, set in the body face so Pirulen keeps its monopoly. */
.hook {
  max-width: 26ch;
  margin: 1.35rem 0 0;
  font-size: clamp(1.1875rem, 2.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lede {
  max-width: 46ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

/* ---------------------------------------------------------------- readout */

/* One line: state, build, release date. */
.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  width: fit-content;
  max-width: 100%;
  margin: 2rem 0 0;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-size: 0.9375rem;
}

.readout-status {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.readout-state {
  font-weight: 600;
}

.is-online .readout-state {
  color: var(--up);
}

.is-dev .readout-state {
  color: var(--ember);
}

.is-offline .readout-state {
  color: var(--red);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-0.05rem);
  /* one establishing pulse on load, then still */
  animation: establish 1.4s ease-out 1;
}

.is-online .dot {
  color: var(--up);
  --pulse: 62 207 142;
}

.is-dev .dot {
  color: var(--ember);
  --pulse: 255 154 92;
}

.is-offline .dot {
  color: var(--red);
  --pulse: 255 74 82;
}

@keyframes establish {
  from {
    box-shadow: 0 0 0 0 rgb(var(--pulse) / 0.55);
  }
  to {
    box-shadow: 0 0 0 0.7rem rgb(var(--pulse) / 0);
  }
}

/* ---------------------------------------------------------------- buttons */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.25rem;
  border-radius: 0.375rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--red);
  background: var(--red);
  color: #14090c;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.cta:hover,
.cta:focus-visible {
  background: #ff6a70;
  border-color: #ff6a70;
}

/* ---------------------------------------------------------------- sections */

.features,
.faq {
  border-top: 1px solid var(--rule);
}

.features > .shell,
.faq > .shell {
  padding-block: var(--gap);
}

h2 {
  margin: 0 0 2.25rem;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- features */

/* Holds the <symbol> the check marks reference; never rendered itself. */
.sprite {
  display: none;
}

/* Wide: the checklist on the left, a screenshot filling the space it leaves.
   Below that they stack and the image goes full width. */
@media (min-width: 56rem) {
  .features-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

/* A staggered collage: two columns, the second dropped so the images
   interlock rather than sitting in a grid. */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 56rem) {
  .shots {
    width: 34rem;
    margin-top: 0;
  }
}

.shots figure {
  margin: 0;
}

/* Two images: the second sits lower so they interlock rather than lining up. */
.shots .offset {
  margin-top: 2.5rem;
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
}

@media (max-width: 34rem) {
  .shots {
    grid-template-columns: minmax(0, 1fr);
  }

  .shots .offset {
    margin-top: 0;
  }
}

/* A single tight column: this reads as a checklist you scan, not as prose. */
.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: grid;
  grid-template-columns: 0.875rem 1fr;
  align-items: baseline;
  gap: 0.75rem;
  max-width: 60ch;
  padding-block: 0.15rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Not a shipped feature, so it carries no tick - it lines up with the text
   column instead and stays quieter than the items above it. */
.feature-more span {
  grid-column: 2;
  color: var(--muted);
  font-style: italic;
  opacity: 0.75;
}

.feature-more {
  margin-top: 0.5rem;
}

.check {
  width: 0.875rem;
  height: 0.875rem;
  /* Nudged off the baseline so the tick sits optically level with the text. */
  transform: translateY(0.15rem);
  color: var(--red);
}

/* ---------------------------------------------------------------- faq */

/* FAQ left, requirements right, once there is room for both. */
@media (min-width: 56rem) {
  .faq-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(17rem, 0.75fr);
    align-items: start;
    gap: clamp(3rem, 5vw, 5rem);
  }
}

.faq-list {
  border-top: 1px solid var(--rule);
  max-width: 68ch;
}

/* Same panel treatment as the status readout in the hero, so the two
   reference blocks on the page read as the same kind of object. */
.reqs {
  margin-top: 3rem;
  padding: 1.35rem 1.5rem 1.5rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--red);
  background: var(--panel);
}

@media (min-width: 56rem) {
  .reqs {
    /* Aligns the panel's top edge with the first FAQ rule, not the heading. */
    margin-top: 4.5rem;
  }
}

.reqs h3 {
  margin: 0 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reqs dl {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.reqs dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.reqs dd {
  margin: 0.1rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* A promise, not a requirement, so it sits below the rule and reads quieter. */
.reqs-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  padding-block: 1rem;
  cursor: pointer;
  font-weight: 600;
  /* The default triangle sits badly against the custom marker below. */
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that becomes a minus, drawn with the box rather than an icon font. */
.faq summary::after {
  content: "+";
  float: right;
  margin-left: 1rem;
  color: var(--red);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "−";
}

.faq summary:hover,
.faq summary:focus-visible {
  color: var(--red);
}

.faq details p {
  margin: 0;
  padding-bottom: 1.15rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--rule);
}

footer > .shell {
  padding-block: 2.25rem 3.5rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.foot-discord,
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.foot-discord:hover,
.foot-discord:focus-visible,
.to-top:hover,
.to-top:focus-visible {
  border-color: var(--muted);
  background: var(--panel);
}

.to-top {
  margin-left: auto;
  color: var(--muted);
}

.arrow-up {
  width: 0.875rem;
  height: 0.875rem;
  flex: none;
}

.legal {
  margin: 0;
  max-width: 100ch;
  color: var(--muted);
  font-size: 0.875rem;
}

.legal + .legal {
  margin-top: 0.85rem;
}

/* ---------------------------------------------------------------- a11y */

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
