/*
 * Rootiest site styles. Catppuccin Latte (light) and Mocha (dark), following
 * the system setting, to match status.rootiest.dev and support.rootiest.dev.
 */
:root {
  --brand: #ff004c;
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --text: #4c4f69;
  --subtext: #5c5f77;
  --muted: #6c6f85;
  --accent: #d20f39;
  --link: #1e66f5;
  --green: #40a02b;
  --yellow: #df8e1d;
  --blue: #1e66f5;
  --mauve: #8839ef;
  --peach: #fe640b;
  --sky: #04a5e5;
  --lavender: #7287fd;
  --shadow: rgb(76 79 105 / 12%);
  --mono: "Rootiest Iosevka", "Iosevka", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --base: #1e1e2e;
    --mantle: #181825;
    --crust: #11111b;
    --surface0: #313244;
    --surface1: #45475a;
    --text: #cdd6f4;
    --subtext: #bac2de;
    --muted: #a6adc8;
    --accent: #f38ba8;
    --link: #89b4fa;
    --green: #a6e3a1;
    --yellow: #f9e2af;
    --blue: #89b4fa;
    --mauve: #cba6f7;
    --peach: #fab387;
    --sky: #89dceb;
    --lavender: #b4befe;
    --shadow: rgb(0 0 0 / 35%);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
}

img {
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--base) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface0);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.925rem;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--mantle);
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero.compact {
  padding: 3rem 0 1.5rem;
}

.hero-logo {
  width: 7rem;
  height: 7rem;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 12px 32px rgb(255 0 76 / 25%));
}

.hero.compact .hero-logo {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero.compact h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.hero h1 .accent {
  color: var(--brand);
}

.lede {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--subtext);
  font-size: 1.1rem;
}

.status-badge {
  display: inline-block;
  margin-top: 1.5rem;
}

.status-badge img {
  display: block;
  height: 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--surface0);
  border-radius: 0.6rem;
  background: var(--mantle);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: var(--surface1);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

/* Notes */
.note {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  padding: 0.9rem 1.1rem;
  border-left: 0.3rem solid var(--brand);
  border-radius: 0.5rem;
  background: var(--mantle);
  color: var(--subtext);
  font-size: 0.95rem;
  text-align: left;
}

/* Sections */
.section {
  padding: 2rem 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head a {
  font-size: 0.9rem;
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.75rem;
}

.card {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--surface0);
  border-radius: 0.75rem;
  background: var(--mantle);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--hue, var(--brand)) 55%, var(--surface0));
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.card p {
  margin: 0;
  color: var(--subtext);
  font-size: 0.9rem;
  line-height: 1.5;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.tile {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--hue) 16%, var(--base));
  color: var(--hue);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 28%, transparent);
}

.tile .glyph {
  width: 1.5rem;
  height: 1.5rem;
}

/* Small Rootiest mark on hosted-service tiles */
.tile .badge {
  position: absolute;
  right: -0.35rem;
  bottom: -0.35rem;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0.15rem;
  border-radius: 50%;
  background: var(--base);
  box-shadow: 0 0 0 1px var(--surface0);
}

/* Category hues (Catppuccin) */
.grid,
.hue-red { --hue: var(--accent); }
.hue-yellow { --hue: var(--yellow); }
.hue-blue { --hue: var(--blue); }
.hue-green { --hue: var(--green); }
.hue-mauve { --hue: var(--mauve); }
.hue-peach { --hue: var(--peach); }
.hue-sky { --hue: var(--sky); }
.hue-lavender { --hue: var(--lavender); }

.pill {
  --hue: var(--green);
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Contribution snake */
.snake {
  display: block;
  padding: 1rem;
  border: 1px solid var(--surface0);
  border-radius: 0.75rem;
  background: var(--mantle);
}

.snake img {
  display: block;
  width: 100%;
  height: auto;
}

/* Contact extras */
.discord-banner {
  display: block;
  max-width: 36rem;
  margin: 0 auto;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--surface0);
}

.discord-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.fingerprint {
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* Legal pages */
.legal {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  border: 1px solid var(--surface0);
  border-radius: 0.75rem;
  background: var(--mantle);
  color: var(--subtext);
  font-size: 0.975rem;
  overflow-wrap: anywhere;
}

.legal h2 {
  margin: 2rem 0 0.6rem;
  color: var(--text);
  font-size: 1.25rem;
}

.legal h3 {
  margin: 1.5rem 0 0.4rem;
  color: var(--text);
  font-size: 1.05rem;
}

.legal p,
.legal li {
  line-height: 1.7;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal .intro {
  color: var(--text);
  font-size: 1.05rem;
}

.legal strong {
  color: var(--text);
}

/* Termly output carries inline colours and fonts; bring them onto the theme. */
.legal [data-custom-class],
.legal [data-custom-class] *,
.legal span,
.legal bdt,
.legal li,
.legal td {
  color: inherit !important;
  font-family: inherit !important;
  background: transparent !important;
}

.legal [data-custom-class="body_text"],
.legal [data-custom-class="body_text"] * {
  font-size: 0.975rem !important;
}

.legal [data-custom-class="title"] {
  display: none;
}

.legal [data-custom-class="subtitle"],
.legal [data-custom-class="subtitle"] * {
  color: var(--muted) !important;
  font-size: 0.9rem !important;
}

.legal [data-custom-class="heading_1"],
.legal [data-custom-class="heading_1"] * {
  color: var(--text) !important;
  font-size: 1.25rem !important;
}

.legal [data-custom-class="heading_2"],
.legal [data-custom-class="heading_2"] * {
  color: var(--text) !important;
  font-size: 1.05rem !important;
}

.legal a,
.legal a *,
.legal [data-custom-class="link"],
.legal [data-custom-class="link"] * {
  color: var(--link) !important;
}

.legal table,
.legal th,
.legal td {
  border-color: var(--surface1) !important;
}

.legal-credit {
  max-width: 48rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--surface0);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badges img {
  display: block;
  height: 28px;
}

.badges.small img {
  height: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin: 1.25rem 0 0.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 40rem) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .nav {
    margin-left: -0.65rem;
  }

  .site-header {
    position: static;
  }

  .hero {
    padding: 3rem 0 2rem;
  }
}

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

  .card,
  .btn {
    transition: none;
  }

  .card:hover,
  .btn:hover {
    transform: none;
  }
}
