/* ============================================================================
   Simple Apps — shared design tokens + base components (navy / light house style).
   Locked visual direction, approved 2026-06-30 (see DESIGN.md + prototype/*.html):
   navy chrome header + footer, light catalog body over bg.svg, single blue accent
   (#2f6df0 — green/teal rejected), E&S serif monogram, shaking amber Tip Jar.

   Every landing + app-shell links this as styles.css via
   <!-- @@include partials/head-common.html -->. Per-page pages add only their own
   page-specific sections on top. The hub keeps its own catalog-only CSS inline.
   ============================================================================ */

/* Self-hosted fonts — latin subset, variable weight. Relative paths resolve from
   each app's own directory, where the build drops a fonts/ copy beside the page. */
@font-face {
  font-family: 'Public Sans';
  font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('fonts/public-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('fonts/space-grotesk.woff2') format('woff2');
}

:root {
  /* Light catalog surfaces */
  --bg: #eef1f6;
  --surface: #ffffff;
  --line: #e6e8ec;
  --line-strong: #d6d9df;
  --text: #14171f;
  --muted: #61687a;
  --faint: #8a91a3;
  /* Accent — the blue wheel only. Green/teal was rejected. */
  --accent: #2f6df0;
  --accent2: #4a84f5;
  --accent-soft: #eaf1ff;
  --amber: #ed8336;          /* brand-mark warm accent + Tip Jar */
  --good: #1ca463;
  --radius: 14px;
  /* Chrome — navy header + footer */
  --chrome: #161b2e;
  --chrome-2: #1e2440;
  --chrome-line: #2c3354;
  --chrome-text: #eef1fb;
  --chrome-muted: #a4adca;
  --shadow: 0 1px 2px rgba(16,22,40,.05), 0 6px 16px rgba(16,22,40,.07);
  --shadow-hover: 0 4px 8px rgba(16,22,40,.08), 0 18px 38px rgba(16,22,40,.16);
  --maxw: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Public Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased;
  background-color: #cfe4fb;
  /* Flowing-wave + halftone backdrop, fixed & cover so it fills the viewport behind
     the scrolling page. The build drops bg.svg beside every page (dropSharedChrome). */
  background-image: url('bg.svg');
  background-size: cover; background-position: center;
  background-attachment: fixed; background-repeat: no-repeat;
}
/* App shells opt into a sticky footer: <body class="shell">. */
body.shell { min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, .brand-name { font-family: "Space Grotesk", system-ui, sans-serif; letter-spacing: -.3px; }
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }

/* ---------- Navy sticky header ---------- */
header {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, var(--chrome-2), var(--chrome));
  border-bottom: 1px solid var(--chrome-line);
  box-shadow: 0 6px 24px rgba(16,22,40,.18);
}
.nav { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* Toolbox mascot — sits to the left of the E&S monogram. Shared root asset
   (/mascot.png), referenced by every page that pulls in the shared header. */
.brand-mascot { height: 40px; width: auto; display: block; flex-shrink: 0; }
/* E&S brand mark — open ring + serif monogram, vector so it stays crisp at any size.
   Light strokes read cleanly on the navy header. */
.brand-mark { height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { height: 36px; width: auto; display: block; }
.brand-name { font-size: 17px; font-weight: 600; color: var(--chrome-text); }
.brand-name span { color: var(--accent); }
.brand-name a { color: inherit; }
/* App-shell page label sitting beside the brand (e.g. "Image Compressor"). */
.app-title { color: var(--chrome-muted); font-size: 13px; font-weight: 600; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--chrome-line); }

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.nav-links a { color: var(--chrome-muted); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47,109,240,.5); }

/* ---------- Tip Jar — shaking amber pill (partials/tipjar.html) ---------- */
.nav-links .ghost {
  background: linear-gradient(135deg, #f6b545, var(--amber));
  color: #2a1500; font-weight: 700; border: 1px solid transparent;
  box-shadow: 0 2px 12px rgba(237,131,54,.4);
}
.nav-links .ghost:hover { color: #2a1500; background: linear-gradient(135deg, #ffc25e, #f08c3c); transform: translateY(-1px); }
/* One gentle attention shake shortly after load: two shakes, a 1s pause between,
   once only. Reduced-motion users get none. */
@keyframes tip-shake {
  0%  { transform: rotate(0); }
  3%  { transform: rotate(-7deg); }
  7%  { transform: rotate(6deg); }
  10% { transform: rotate(-5deg); }
  13% { transform: rotate(4deg); }
  17% { transform: rotate(-2deg); }
  20% { transform: rotate(0); }
  70% { transform: rotate(0); }
  73% { transform: rotate(-7deg); }
  77% { transform: rotate(6deg); }
  80% { transform: rotate(-5deg); }
  83% { transform: rotate(4deg); }
  87% { transform: rotate(-2deg); }
  90%, 100% { transform: rotate(0); }
}
.nav-links .ghost { animation: tip-shake 2s ease .9s 1 both; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .nav-links .ghost { animation: none; } }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 640px; margin: 18px auto 0; }

/* ---------- Buttons ---------- */
.cta-row { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px;
  border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid var(--line-strong); color: var(--text); background: #fff; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
/* Primary action — usage-first: the largest, brightest control so "Use it now"
   wins the eye over everything else. */
.btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; border-color: transparent; font-size: 17px; padding: 16px 30px;
  box-shadow: 0 6px 22px rgba(47,109,240,.35);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); }
.btn svg { width: 19px; height: 19px; }
.cta-sub { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---------- Trust chips ---------- */
.trust { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.trust span {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: #23499e; background: var(--accent-soft); border: 1px solid #c7dafb; padding: 6px 12px; border-radius: 7px;
}
.trust svg { width: 13px; height: 13px; color: var(--accent); }

/* ---------- Hero product shot ---------- */
.app-shot { margin: 38px auto 0; max-width: 940px; }
.app-shot img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-hover); }
.app-shot figcaption { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }

/* ---------- Screenshot gallery ("See it in action" — multiple captioned shots) ---------- */
.shots { display: grid; grid-template-columns: 1fr; gap: 22px; margin: 28px 0 8px; }
.shot { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; overflow: hidden; box-shadow: var(--shadow); }
.shot img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.shot figcaption { color: var(--muted); font-size: 14px; padding: 12px 8px 6px; }
.shot figcaption b { color: var(--text); font-weight: 600; }

/* ---------- Section heads ---------- */
.section-head { text-align: center; margin: 64px 0 8px; }
.section-head h2 { font-size: clamp(23px, 3.4vw, 30px); }
.section-head p { color: var(--muted); margin-top: 8px; }

/* ---------- Feature / info cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 28px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.card .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.card .ic svg { width: 20px; height: 20px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* ---------- How it works — numbered steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 28px 0; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.step .num {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ---------- FAQ ---------- */
.faq { margin: 28px 0; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; font-family: "Space Grotesk", sans-serif; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--muted); font-size: 14.5px; margin-top: 12px; }

.endcta { text-align: center; margin: 64px 0 24px; }

/* ---------- Sticky conversion bar (navy) — slides in once the hero scrolls away ---------- */
.stickybar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(24px, calc((100vw - var(--maxw)) / 2 + 24px));
  background: rgba(22,27,46,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--chrome-line);
  transform: translateY(-105%); transition: transform .25s ease;
}
.stickybar.show { transform: translateY(0); }
.stickybar .sb-brand { display: flex; align-items: center; gap: 9px; font-family: "Space Grotesk", sans-serif; font-weight: 600; color: var(--chrome-text); }
.stickybar .sb-brand span { color: var(--accent); }
.stickybar .btn-primary { padding: 9px 18px; font-size: 14px; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .stickybar { transition: none; } }

/* ---------- App-shell tool body ---------- */
main { flex: 0 0 auto; }
body.shell main { flex: 1; padding: 28px 0 44px; }
/* Screen-reader-only page <h1> for the app shells (visible chrome carries the brand). */
h1.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Boxed tool frame (Compressor app-shell = centered ~1180px card, owner-set). */
.appwrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.appframe { background: #0f1117; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.appframe img { display: block; width: 100%; height: auto; }

/* ---------- Navy footer ---------- */
footer {
  background: linear-gradient(180deg, var(--chrome), var(--chrome-2));
  border-top: 1px solid var(--chrome-line); margin-top: 56px; padding: 40px 0 56px;
  color: var(--chrome-muted); font-size: 13.5px;
  box-shadow: 0 -6px 24px rgba(16,22,40,.14);
}
body.shell footer { margin-top: 0; padding: 22px 0; }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.foot-copy { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--chrome-line); }
footer a { color: var(--chrome-muted); } footer a:hover { color: #fff; }
.foot-links { display: flex; gap: 18px; }

@media (max-width: 640px) {
  .nav-links a:not(.ghost) { display: none; }
  .app-title { display: none; }
}
