/* ==========================================================================
   Risklytics — static stylesheet
   ========================================================================== */

:root {
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --bg: #faf9f6;
  --bg-alt: #f1efe9;
  --surface: #ffffff;
  --text: #15181c;
  --text-muted: #51565d;
  --border: #e1ddd3;
  --accent: #8a5a2b;
  --accent-ink: #5c3b1b;
  --focus: #1b6e78;

  --max-width: 1120px;
  --radius: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #15181d;
    --surface: #15181d;
    --text: #ecebe8;
    --text-muted: #a3a8ae;
    --border: #2a2e34;
    --accent: #d1a05c;
    --accent-ink: #e8c48a;
    --focus: #5fd0dc;
  }
}


* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1em;
  color: var(--text-muted);
  max-width: 68ch;
}

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

.section-narrow p,
.section-narrow h2,
.section-narrow h1 {
  max-width: 62ch;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.primary-nav {
  display: flex;
  gap: 32px;
}

.primary-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--text);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 96px 0;
}

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

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--accent-ink);
  font-weight: 600;
  margin: 0 0 1em;
}

.section h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}

/* Hero */

.hero {
  padding: 140px 0 110px;
}

.hero-inner {
  max-width: 760px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5em;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.5em;
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 56ch;
  margin-bottom: 2em;
}

/* Buttons */

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-ink);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    background: var(--accent);
    color: #15181d;
  }
  .btn-primary:hover {
    background: var(--accent-ink);
    color: #15181d;
  }
}

/* Topics grid */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.topic {
  background: var(--surface);
  padding: 32px;
}

.topic h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.topic p {
  font-size: 0.95rem;
  margin: 0;
  padding-left: 14px;
}

/* Status */

.status-updated {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Contact */

.contact-note {
  font-size: 0.9rem;
  min-height: 1.4em;
  margin-top: 1em;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0 0 0.4em;
  color: var(--text);
}

.footer-brand p {
  margin: 0 0 0.3em;
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.footer-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid transparent;
}

.footer-nav a:hover {
  border-bottom-color: var(--accent);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .primary-nav--static {
    position: static;
    display: flex;
    border: none;
    padding: 0;
  }

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

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 560px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

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

  * {
    transition: none !important;
    animation: none !important;
  }
}
