/* ==========================================================================
   style.css — Shared layout for SnapHabit & AwareFlow
   Copyright © 2025 SnapHabit LLC. All rights reserved.
   - Responsive, accessible (WCAG 2.1 AA), dark-mode aware
   - Minimal footprint; no frameworks; safe defaults
   ========================================================================== */

/* ---- CSS Custom Properties ------------------------------------------------ */
:root {
  /* Brand */
  --brand-accent: #2a7ae2;      /* primary links / accents */
  --brand-accent-dark: #1a4d8f; /* headings / section titles */

  /* Surface & text */
  --bg: #f9f9f9;
  --surface: #ffffff;
  --text: #222222;
  --muted: #666666;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);

  /* Layout */
  --content-max: 800px;
  --radius: 10px;
  --space: 24px;
  --space-sm: 14px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* Dark mode (auto) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --text: #e9e9ec;
    --muted: #a5a8b3;
    --shadow: 0 2px 10px rgba(0,0,0,0.5);
    --brand-accent: #8ab8ff;
    --brand-accent-dark: #c4d6ff;
  }
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: var(--space);
  line-height: 1.7;
  letter-spacing: 0.01em;
  word-break: break-word;
  hyphens: auto;
}

/* Content column */
.content-container {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ---- Type ----------------------------------------------------------------- */
h1, h2, h3 {
  line-height: 1.35;
  margin: 1.6em 0 0.6em;
  color: var(--brand-accent-dark);
}
h1 { font-size: clamp(1.9rem, 2.8vw, 2.3rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.7rem); }
h3 { font-size: clamp(1.2rem, 1.9vw, 1.45rem); }

p { margin: 0.8em 0; }

small, .muted { color: var(--muted); }

/* ---- Links & Focus -------------------------------------------------------- */
a {
  color: var(--brand-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px dashed var(--brand-accent);
  outline-offset: 3px;
}

/* ---- Sections / Cards ----------------------------------------------------- */
.box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: calc(var(--space) - 6px) var(--space);
  margin: 1.2em 0 1.4em;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-accent-dark);
  margin: 0 0 0.75em;
}

.info { margin-bottom: 0.9em; }
.label { font-weight: 700; }

/* ---- Lists ---------------------------------------------------------------- */
ul {
  margin: 0.5em 0 0.5em 1.4em;
  padding: 0;
}

li + li {
  margin-top: 0.35em;
}

li {
  line-height: 1.6;
}

/* ---- Header / Logo -------------------------------------------------------- */
.logo {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto 16px;
}
.title {
  text-align: center;
  margin: 0.2em 0 0.1em;
}
.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.2em;
}

/* ---- Nav ------------------------------------------------------------------ */
nav {
  text-align: center;
  margin: 0 0 1.2em;
}
nav a {
  margin: 0 10px;
  font-weight: 600;
}

/* ---- Buttons (utility) ---------------------------------------------------- */
.button,
.button-link {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--brand-accent);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.button:hover,
.button-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.button:focus-visible,
.button-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(42,122,226,0.45);
}

/* ---- Footer --------------------------------------------------------------- */
footer {
  margin-top: 2.2em;
  padding-top: 1.2em;
  border-top: 1px solid rgba(0,0,0,0.08);
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}
footer a { color: var(--brand-accent); }
footer a:hover { text-decoration: underline; }

/* ---- Images --------------------------------------------------------------- */
img { max-width: 100%; height: auto; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 600px) {
  body { padding: 18px; }
  .box { padding: var(--space-sm) var(--space); }
  nav a { display: inline-block; margin: 6px 8px; }
}

/* ---- Reduced Motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- Print ---------------------------------------------------------------- */
@media print {
  body {
    background: #fff;
    color: #000;
    font-family: "Times New Roman", Georgia, serif;
    line-height: 1.5;
    max-width: none;
    padding: 0;
  }
  .logo, nav, footer { display: none !important; }
  .box { box-shadow: none; border: 0; border-radius: 0; }
  a::after { content: " (" attr(href) ")"; font-size: 0.9em; }
}
