/*
 * SPDX-FileCopyrightText: 2026 Adrian PK
 * SPDX-License-Identifier: GPL-3.0-only
 *
 * This file is part of Ruru. See COPYING for license terms.
 */

/* Palette from the Ruru logo, on Tokyo Night's base. */
:root {
  --bg: #1a1b26;
  --bg-alt: #16161e;
  --surface: #1f2335;
  --line: #292e42;
  --text: #cbcfda;
  --text-strong: #e8e4d4;
  --muted: #9da9c5;
  --faint: #707fa9;
  --amber: #e4b25c;
  --violet: #bb9af7;
  --green: #9ece6a;
  --comment: #565f89;

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --max: 1080px;
  --gutter: 24px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--text-strong);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 20;
  background: var(--surface);
  padding: 6px 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(26 27 38 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 18px;
}

.wordmark:hover {
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
}

.site-header nav a {
  color: var(--muted);
}

.site-header nav a:hover {
  color: var(--text-strong);
  text-decoration: none;
}

.site-header nav .nav__source {
  color: var(--amber);
}

/* Hero */

.hero {
  padding: 72px 0 56px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: 20px;
}

.lede {
  font-size: 19px;
  color: var(--text);
  max-width: 34em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}

.hero__mark {
  margin: 0;
  justify-self: center;
  max-width: 340px;
}

.btn {
  display: inline-block;
  background: var(--amber);
  color: var(--bg);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 18px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.btn--sm {
  font-size: 14px;
  padding: 6px 14px;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.link {
  font-size: 15px;
}

/* Sections */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.section--alt {
  background: var(--bg-alt);
}

.section__grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}

.section__num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 8px;
}

.section__head h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
}

.section__body {
  max-width: 720px;
}

.section__body > p:first-child {
  font-size: 18px;
}

.facts {
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}

.facts > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--violet);
  padding-top: 2px;
}

.facts dd {
  margin: 0;
}

/* Code */

.code {
  margin: 28px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.code figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}

.code pre code {
  font-size: inherit;
  color: inherit;
}

.code .k { color: var(--violet); }
.code .c { color: #7dcfff; }
.code .f { color: #7aa2f7; }
.code .s { color: var(--green); }
.code .i { color: var(--text); }
.code .y { color: var(--amber); }
.code .p { color: var(--faint); user-select: none; }

.points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.points li {
  padding-left: 18px;
  position: relative;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--faint);
}

.points strong {
  color: var(--text-strong);
  font-weight: 500;
}

.note {
  font-size: 15px;
  color: var(--muted);
}

/* Current state */

.state {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 28px;
}

.state h3 {
  margin-bottom: 12px;
}

.state ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.state li::marker {
  color: var(--faint);
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}

.tag--now {
  color: var(--green);
  background: rgb(158 206 106 / 0.1);
}

.tag--next {
  color: var(--amber);
  background: rgb(228 178 92 / 0.1);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 14px;
  color: var(--faint);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.site-footer p {
  margin: 0;
}

.site-footer__links {
  display: flex;
  gap: 20px;
}

/* Cookie banner */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
}

/* Narrow screens */

@media (max-width: 820px) {
  .hero {
    padding-top: 40px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__mark {
    order: -1;
    justify-self: start;
    max-width: 140px;
  }

  .section {
    padding: 52px 0;
  }

  .section__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .state {
    grid-template-columns: 1fr;
  }

  .site-header nav a:not(.nav__source) {
    display: none;
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 16px;
  }

  .facts > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
}
