/* Design tokens, reset and base element styles.
   Files are loaded in filename order by `stylesheet_link_tag :app`, so the
   numeric prefixes are the cascade. */

:root {
  /* Brand — the legacy site's orange, cooled slightly and paired with slate. */
  --accent: #ef4b23;
  --accent-strong: #d13c15;
  --accent-soft: rgba(239, 75, 35, 0.11);
  --accent-contrast: #ffffff;

  --success: #17924e;
  --success-soft: rgba(23, 146, 78, 0.12);
  --danger: #d33a34;
  --danger-soft: rgba(211, 58, 52, 0.12);
  --info-soft: rgba(46, 105, 214, 0.12);
  --info: #2e69d6;

  /* Surfaces */
  --surface: #f6f6f7;
  --surface-raised: #ffffff;
  --surface-sunken: #eeeef1;
  --surface-inverse: #14171c;

  /* Text */
  --text: #14171c;
  --text-muted: #5d6470;
  --text-inverse: #f4f5f7;

  --border: rgba(15, 20, 30, 0.10);
  --border-strong: rgba(15, 20, 30, 0.18);

  --shadow-sm: 0 1px 2px rgba(15, 20, 30, 0.06);
  --shadow: 0 2px 4px rgba(15, 20, 30, 0.04), 0 8px 24px rgba(15, 20, 30, 0.06);
  --shadow-lg: 0 4px 8px rgba(15, 20, 30, 0.05), 0 20px 48px rgba(15, 20, 30, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --page-width: 1140px;
  --page-gutter: clamp(1rem, 4vw, 2rem);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff6337;
    --accent-strong: #ff794f;
    --accent-soft: rgba(255, 99, 55, 0.16);

    --success: #37c07a;
    --success-soft: rgba(55, 192, 122, 0.16);
    --danger: #f0625c;
    --danger-soft: rgba(240, 98, 92, 0.16);
    --info: #6c9bff;
    --info-soft: rgba(108, 155, 255, 0.16);

    --surface: #0d0f13;
    --surface-raised: #161a20;
    --surface-sunken: #090b0e;
    --surface-inverse: #f4f5f7;

    --text: #e9ebef;
    --text-muted: #98a0ad;
    --text-inverse: #14171c;

    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.20);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.3), 0 20px 48px rgba(0, 0, 0, 0.55);
  }
}

/* --- Reset --------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* --- Base elements ------------------------------------------------------- */

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-sunken);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

.icon {
  flex: none;
}

/* Component classes set an explicit `display`, which would otherwise win over
   the user agent's [hidden] rule and leave hidden elements on screen. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@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;
  }
}
