/* savegas.app: the one stylesheet. No external fonts, images or scripts (the CSP in _headers allows only this
   site). Colours are the app's Palette tokens (GasFinder/Shared/Theme/Palette.swift), light and dark. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f6f8;
  --ink: #1f2328;
  --body: #3a414a;
  --muted: #4d5560;
  --accent: #1d5fd1;
  --on-accent: #ffffff;
  --hairline: #d0d5db;
  --green: #1a7f37;
  --ph-fill: #fff1e5;
  --ph-ink: #7a3800;
  --ph-border: #e7b98f;
  --radius: 14px;
  --gutter: 16px;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101316;
    --surface: #181c21;
    --ink: #e9ecef;
    --body: #c9cfd6;
    --muted: #a7afb8;
    --accent: #6fa3f7;
    --on-accent: #0a1b36;
    --hairline: #2f353c;
    --green: #4cc26a;
    --ph-fill: #3a2412;
    --ph-ink: #ffb98a;
    --ph-border: #8a5a30;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 800; letter-spacing: -0.01em; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.3rem; font-weight: 750; margin: 2.25rem 0 0.5rem; scroll-margin-top: 1rem; }
h3 { font-size: 1.08rem; font-weight: 700; margin: 1.5rem 0 0.25rem; scroll-margin-top: 1rem; }
p, ul, ol { margin: 0.6rem 0; }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.3rem 0; }
strong { color: var(--ink); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

/* Header and footer */
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--bg); padding: 0.4rem 0.7rem; z-index: 1; }

.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.25rem 1rem; padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--ink); font-weight: 800; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.01em;
}
.brand-mark {
  width: 1.5rem; height: 1.5rem; border-radius: 0.45rem; background: var(--green);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0.55rem; height: 0.55rem;
  margin: -0.2rem 0 0 -0.275rem; background: var(--bg); border-radius: 0 50% 50% 50%; transform: rotate(45deg);
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.98rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 0.35rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

main { padding-bottom: 2rem; }

.site-footer { border-top: 1px solid var(--hairline); margin-top: 2rem; padding: 1.5rem 0 2.5rem; font-size: 0.92rem; color: var(--muted); }
.site-footer p { margin: 0.5rem 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin-bottom: 0.75rem; }

/* Landing */
.hero { padding: 2.5rem 0 1rem; }
.eyebrow { color: var(--green); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }
.lead { font-size: 1.18rem; color: var(--body); max-width: 38rem; }
.cta { margin: 1.4rem 0 0.4rem; color: var(--ink); font-weight: 700; }

.features { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.features li { margin: 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1rem 1.1rem; }
.features h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.features p { margin: 0; font-size: 0.98rem; }

.links { list-style: none; padding: 0; }
.links li { margin: 0.5rem 0; }
.links a { font-weight: 650; }

/* Documents */
.doc-meta { color: var(--muted); font-size: 0.95rem; margin-top: 0; }
.summary, .callout {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 0.5rem 1.1rem; margin: 1.25rem 0;
}
.summary h2 { margin-top: 0.75rem; }
.toc { border-left: 3px solid var(--hairline); padding: 0.1rem 0 0.1rem 1rem; margin: 1.25rem 0; font-size: 0.97rem; }
.toc p { margin: 0 0 0.25rem; font-weight: 700; color: var(--ink); }
.toc ol, .toc ul { margin: 0; }
.toc li { margin: 0.15rem 0; }

/* Tables become one card per row on a phone */
.table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--hairline); }
.table th { color: var(--ink); font-weight: 700; background: var(--surface); }

@media (max-width: 40rem) {
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table tr { border: 1px solid var(--hairline); border-radius: var(--radius); margin: 0 0 0.75rem; padding: 0.25rem 0; background: var(--surface); }
  .table td { border: 0; padding: 0.35rem 0.9rem; }
  .table td::before { content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
  .site-header .wrap { padding-top: 0.75rem; padding-bottom: 0.75rem; }
}

/* Placeholders Oscar still fills in: never subtle */
.ph {
  background: var(--ph-fill); color: var(--ph-ink); border: 1px dashed var(--ph-border);
  border-radius: 6px; padding: 0 0.3em; font-weight: 700; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.source { color: var(--muted); font-size: 0.95rem; }

@media print {
  .site-header nav, .skip, .cta { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; }
}
