/* Fluid Reliability Framework - Theme */

:root {
  --primary: #1a365d;
  --primary-light: #2b4c7e;
  --accent: #2b6cb0;
  --accent-light: #63b3ed;
  --warm: #c6953b;
  --warm-light: #d4af37;
  --text: #1a202c;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-warm: #fefcf8;
  --border: #e2e8f0;
  --success: #2f855a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #93c5fd;
    --primary-light: #60a5fa;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --warm: #fbbf24;
    --warm-light: #f6c35b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-warm: rgba(251,191,36,0.04);
    --border: #334155;
    --success: #4ade80;
  }
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }
[id] { scroll-margin-top: 4.5rem; }
::selection { background: rgba(43,108,176,0.15); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Navigation ── */
.site-nav {
  background: rgba(26,54,93,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  border-bottom: 3px solid var(--warm);
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (prefers-color-scheme: dark) {
  .site-nav { background: rgba(15,23,42,0.95); }
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.75rem 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--warm-light);
}

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

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  border-radius: 6px;
}

.nav-links a:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.1);
}

.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* ── Landing Intro ── */
.landing-intro {
  background:
    radial-gradient(ellipse at 25% 50%, rgba(43,108,176,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 50%, rgba(198,149,59,0.08) 0%, transparent 50%),
    linear-gradient(165deg, #0f1930 0%, var(--primary) 40%, var(--primary-light) 100%);
  color: #fff;
  padding: 2.5rem 2rem 2.2rem;
  margin: 0 -2rem 2rem;
  border-radius: 0 0 8px 8px;
}

@media (prefers-color-scheme: dark) {
  .landing-intro {
    background: linear-gradient(165deg, #060a14 0%, #0f172a 40%, #1e293b 100%);
  }
}

.landing-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 0 0 0.5rem;
  color: rgba(255,255,255,0.92);
}

.landing-lead strong {
  color: #fff;
}

.landing-sub {
  font-size: 1rem;
  color: var(--warm-light);
  margin: 0;
  font-style: italic;
}

/* ── Main Content ── */
.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

/* ── Section Navigation ── */
.section-nav {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section-nav-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.section-nav a {
  color: var(--text-light);
  text-decoration: none;
  margin-right: 1rem;
  white-space: nowrap;
  transition: color 0.15s;
}

.section-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Back to top ── */
.back-to-top {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-light);
  text-decoration: none;
  margin-top: 0.5rem;
}

.back-to-top:hover { color: var(--accent); }

/* ── Typography ── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
  position: relative;
}

h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--warm);
  border-radius: 1px;
  margin-top: 0.4rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p { margin-bottom: 1rem; max-width: 65ch; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-light);
}

strong { color: var(--primary); }

em img + em,
.content > p > em:only-child {
  display: block;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 0.5rem 0 0.5rem;
  transition: box-shadow 0.25s;
}

img:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,0.14);
}

/* Sisyphus: float right */
.img-aside {
  float: right;
  max-width: 220px;
  margin: 0 0 1rem 1.5rem;
  shape-outside: margin-box;
}

.img-aside img {
  max-width: 100%;
}

/* ── Lists ── */
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

th, td {
  padding: 0.7rem 0.9rem;
  text-align: left;
}

th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

@media (prefers-color-scheme: dark) {
  th { background: #1e3a5f; }
}

td { border-top: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--bg-alt); }
tr { transition: background 0.15s; }
tr:hover td { background: rgba(43,108,176,0.04); }

/* ── Code ── */
code {
  font-family: "SF Mono", "Monaco", monospace;
  font-size: 0.85rem;
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--primary);
}

pre {
  background: var(--primary);
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.25rem 0;
}

@media (prefers-color-scheme: dark) {
  pre { background: #0c1322; border: 1px solid var(--border); }
}

pre code { background: none; padding: 0; color: inherit; }

/* ── Blockquotes ── */
blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-warm);
  border-left: 3px solid var(--warm);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  position: relative;
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: 0.25rem;
  left: 0.6rem;
  font-size: 3rem;
  font-family: Georgia, serif;
  color: var(--warm);
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}

blockquote p { max-width: none; }
blockquote p:last-child { margin-bottom: 0; }

/* ── Horizontal rule ── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--warm-light), transparent);
  margin: 2.5rem 0;
}

/* ── CTA Buttons ── */
.cta {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 14px 32px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.25s;
  border: 2px solid var(--primary);
}

.cta:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,54,93,0.2);
}

.cta:active { transform: translateY(0); }

@media (prefers-color-scheme: dark) {
  .cta { background: var(--accent); border-color: var(--accent); color: #0f172a; }
  .cta:hover { background: var(--accent-light); border-color: var(--accent-light); color: #0f172a; }
}

.cta-success {
  background: var(--success);
  border-color: var(--success);
}

.cta-success:hover {
  background: #276749;
  border-color: #276749;
}

.cta-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cta-outline:hover {
  background: var(--primary);
  color: #fff;
}

.cta-center {
  text-align: center;
  margin: 2rem 0;
}

/* ── Video embed wrapper ── */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: var(--bg-alt);
}

footer p {
  margin: 0.3rem 0;
  max-width: none;
}

footer a { color: var(--text-light); transition: color 0.15s; }
footer a:hover { color: var(--text); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-inner { padding: 0 1rem; }
  .nav-brand { font-size: 0.95rem; }
  .nav-links a { padding: 0.5rem 0.5rem; font-size: 0.8rem; }

  .landing-intro { margin: 0 -1rem 1.5rem; padding: 1.5rem 1rem; }
  .landing-lead { font-size: 1.05rem; }

  .content { padding: 1.5rem 1rem; }
  h1 { font-size: 1.5rem; }
  blockquote { font-size: 1rem; margin-left: 0; padding-left: 1rem; }
  blockquote::before { font-size: 2.5rem; }
  .cta { padding: 12px 24px; font-size: 1rem; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table th, table td { min-width: 100px; }

  .img-aside {
    float: none;
    max-width: 180px;
    margin: 0 auto 1rem;
    display: block;
  }

  .section-nav a { display: inline-block; margin-bottom: 0.3rem; }
}

@media (max-width: 480px) {
  .nav-brand { font-size: 0.85rem; }
  .nav-links a { padding: 0.5rem 0.35rem; font-size: 0.75rem; }
  .content { padding: 1rem 0.75rem; }
  h2 { font-size: 1.2rem; }
  .cta { display: block; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-nav { display: none; }
  footer { display: none; }
  .landing-intro { background: #1a365d; }
  img { max-width: 250px; box-shadow: none; }
}
