
/* ===== Reset & Base ===== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: #0b1220;
  color: #e5eef7;
  line-height: 1.6; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  color: #e5eef7;
  line-height: 1.6;
}

/* Fluid type */
:root{
  --maxw: 1120px;
  --gap: clamp(16px, 2.4vw, 28px);
  --radius: 18px;
  --shadow: 0 10px 35px rgba(0,0,0,.35);
  --card: rgba(15, 23, 42, .75);
  --card-border: rgba(148, 163, 184, .15);
  --ink: #e5eef7;
  --muted: #9fb2c7;
  --accent: #ef4444;
  --accent-2: #2563eb;
  --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent) 55%, var(--accent-2) 100%);
}

/* Containers */
.container, main, .wrap {
  width: min(100% - 2rem, var(--maxw));
  margin-inline: auto;
}
section { padding: clamp(24px, 4vw, 56px) 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(11,18,32,.9), rgba(11,18,32,.6));
  border-bottom: 1px solid var(--card-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.logo { font-weight: 800; letter-spacing: .3px; font-size: clamp(18px, 2vw, 22px); }
nav a {
  color: var(--muted); text-decoration: none; margin-left: 18px; font-weight: 600;
}
nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  padding: clamp(36px, 6vw, 96px) 0 clamp(16px, 3vw, 32px);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: var(--gap);
}
@media (max-width: 900px){
  .hero .container { grid-template-columns: 1fr; }
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: .2px;
}
.hero p.lede {
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 20px);
  max-width: 60ch;
}
.hero-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3.2vw, 28px);
}

/* Pills / quick toggles */
.pillbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 0;
}
.pillbar .pill, .pillbar button {
  background: rgba(148,163,184,.14);
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}
.pillbar .pill[aria-pressed="true"], .pillbar .pill.active {
  background: var(--accent-grad);
  color: #00111a;
  border-color: transparent;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
}
.card--wide { padding: clamp(20px, 3.6vw, 32px); }
.card + .card { margin-top: var(--gap); }

.card h2, .card h3, .card h4 { margin-top: 0; letter-spacing: .2px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Grids */
.grid, .feature-grid, .grid-3, .centered-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.centered-grid, .feature-grid, .grid-3 { justify-items: center; }
.centered-grid > .card, .feature-grid > .card, .grid-3 > .card {
  width: 100%;
  max-width: 540px;
  text-align: left;
}

/* Forms & Inputs */
label { display: block; font-weight: 700; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: #0b1324;
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,.15); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--card-border); text-align: left; }
thead th { position: sticky; top: 0; background: rgba(15,23,42,.9); }

/* Buttons */
.btn, button, .actions a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--accent-grad);
  color: #06121c;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
.btn.secondary {
  background: rgba(148,163,184,.14);
  color: var(--ink);
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Utility */
.nowrap { white-space: nowrap; }
.center { text-align: center; }
section .center { margin-inline: auto; }

/* Footer */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(11,18,32,.8), rgba(11,18,32,1));
}
.site-footer .container {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 28px 0;
}
.site-footer h4 { margin: 0 0 8px; }
.site-footer a { color: var(--ink); opacity: .9; text-decoration: none; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }

/* Hero tool alignment: keep tool untouched, but center following cards */
.hero + section .container,
.hero + .container {
  display: grid;
  gap: var(--gap);
}
/* Ensure cards under the tool are centered site-wide */
.container:has(> .card),
section:has(> .card) {
  justify-items: center;
}
.container > .card { width: 100%; max-width: 920px; }

/* Animations */
@keyframes floatIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.card, .hero-card, .site-footer { animation: floatIn .45s ease both; }

/* Blog */
.prose {
  max-width: 70ch;
}
.prose h1, .prose h2, .prose h3 { line-height: 1.15; }
.prose p { color: var(--ink); }
.prose a { color: #93c5fd; }

/* === Red-forward accents === */
a { color: #f87171; }              /* Red-400 for body links */
a:hover { color: #ef4444; }        /* Red-500 on hover */

strong, b { color: #fca5a5; }      /* Soft red for emphasis */

/* Headings get a subtle red underline accent */
h1, h2, h3, h4 {
  position: relative;
}
h1::after, h2::after, h3::after, h4::after {
  content: "";
  display: block;
  width: 64px; height: 3px;
  margin-top: 10px;
  background: var(--accent);
  border-radius: 999px;
  opacity: .85;
}

/* Buttons: primary uses red, secondary outlined with red */
.btn, button, .actions a.button {
  background: var(--accent-grad);
  color: #0b0f1a;
  border-color: rgba(239, 68, 68, .35);
}
.btn.secondary {
  background: rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .35);
  color: #fdecec;
}
.btn:hover { box-shadow: 0 8px 20px rgba(239, 68, 68, .25); }

/* Pills default slightly red and go full red when active */
.pillbar .pill, .pillbar button {
  background: rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .35);
}
.pillbar .pill[aria-pressed="true"], .pillbar .pill.active {
  background: var(--accent);
  color: #1b0a0a;
  border-color: transparent;
}

/* Inputs & focus rings with a red tone */
input, select, textarea {
  border-color: rgba(239, 68, 68, .25);
}
input:focus, select:focus, textarea:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .18);
}

/* Tables with red header accent */
thead th {
  background: rgba(239, 68, 68, .10);
  color: #fecaca;
}

/* Cards with faint red border glow */
.card, .hero-card {
  border-color: rgba(239, 68, 68, .28);
  box-shadow: 0 10px 35px rgba(239, 68, 68, .12), 0 10px 35px rgba(0,0,0,.22);
}

/* Footer links slightly warmer */
.site-footer a { color: #fca5a5; }
.site-footer a:hover { color: #fecaca; }

/* Selection color */
::selection { background: rgba(239, 68, 68, .35); color: white; }


/* ===== Mobile enhancements (<=640px) – desktop unaffected ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }
  body { line-height: 1.6; }
  .wrap, .container, .content, main, section, header, footer { 
    padding-left: 16px !important; 
    padding-right: 16px !important; 
  }
  /* Stack common two-column layouts */
  .grid, .row, .cols, .columns, .two-col, .split {
    display: block !important;
  }
  .grid > *, .row > *, .columns > *, .two-col > *, .split > * {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Cards and panels */
  .card { 
    border-radius: 16px; 
    padding: 16px !important; 
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    margin-bottom: 16px;
  }
  /* Headers & nav */
  header .nav, nav ul { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px;
  }
  header .nav a, nav a { 
    padding: 8px 10px; 
    border-radius: 8px; 
    display: inline-block;
  }
  /* Forms */
  input[type="text"], input[type="number"], input[type="email"], input[type="search"], select, textarea {
    width: 100% !important;
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 12px 14px !important;
    border-radius: 10px !important;
    margin-top: 6px; margin-bottom: 12px;
  }
  button, .btn, input[type="submit"] {
    width: 100%;
    padding: 14px 16px !important;
    border-radius: 12px !important;
    font-weight: 600;
  }
  /* Tables: make horizontally scrollable */
  table { display: block; width: 100% !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  thead, tbody, tr, th, td { white-space: nowrap; }
  /* Images & media */
  img, svg, video, canvas { max-width: 100%; height: auto; }
  /* Typography */
  h1 { font-size: 1.5rem !important; line-height: 1.2; }
  h2 { font-size: 1.25rem !important; }
  h3 { font-size: 1.1rem !important; }
  /* Spacing cleanup */
  .mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
  .mt-1 { margin-top: 4px !important; } .mb-1 { margin-bottom: 4px !important; }
  .mt-2 { margin-top: 8px !important; } .mb-2 { margin-bottom: 8px !important; }
  .mt-3 { margin-top: 12px !important; } .mb-3 { margin-bottom: 12px !important; }
  /* Breadcrumbs wrap */
  .breadcrumbs ol { flex-wrap: wrap; gap: 6px !important; }
  /* Blog cards grid fallback */
  .blog-grid, .cards { display: block !important; }
  .blog-grid > article, .cards > .card { width: 100% !important; }
  /* Prevent layout shift when images load */
  img[width][height] { height: auto; }
  /* Footer spacing */
  footer { margin-top: 24px; padding-top: 16px; }
}

