/* ==========================================================================
   AwareFlow – Site Styles
   Source of truth for layout, colors, and components.
   ========================================================================== */

:root {
  /* Brand + color system */
  --brand-primary: #5a7dff;
  --brand-primary-2: #7aa2ff;
  --brand-accent: #aa3000;
  --brand-accent-hover: #8a2600;
  --hero-start: #697dff;
  --hero-end: #4f5fdd;
  --border-subtle: #e5e7eb;
  --border-subtle-hover: #cbd5e1;
  --bg-subtle-hover: #f8fafc;
  --diagram-bg-inner: #f5f7ff;
  --diagram-bg-outer: #e4e8ff;
  --nav-link: #fdfbff;
  --nav-link-active: #ffe5cf;

  /* Ink / text */
  --ink-900: #0b0b0c;
  --ink-800: #1a1b1e;
  --ink-700: #2a2c30;
  --ink-600: #3d4046;
  --ink-500: #545862;
  --ink-400: #707684;

  /* Surfaces */
  --bg-page: #f7f8fc;
  --bg-card: #ffffff;

  /* Focus + radii */
  --focus: #ffb14d;
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 8px;

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(12, 18, 28, 0.08);
  --shadow-md: 0 6px 18px rgba(12, 18, 28, 0.10);
  --shadow-diagram: 0 3px 8px rgba(15, 23, 42, 0.08);

  /* Layout */
  --container-max: 880px;
}

/* Dark mode --------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink-900: #ffffff;
    --ink-800: #f5f7ff;
    --ink-700: #e6e9f8;
    --ink-600: #cdd3ee;
    --ink-500: #b4bde3;
    --ink-400: #94a0d4;

    --bg-page: #0e1116;
    --bg-card: #111521;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);

    --brand-accent: #ff6a2a;
    --brand-accent-hover: #e1571f;
  }
}

/* Base -------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink-800);
  background-color: var(--bg-page);
  line-height: 1.7;
  letter-spacing: 0.02em;
  word-spacing: 0.12em;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  color: var(--ink-900);
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.5rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
}

p {
  margin: 0.75rem 0 1rem;
  color: var(--ink-800);
}

main p{
   max-width: 68ch;             /* keep paragraphs readable */
}

ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

li {
  margin: 0.35rem 0;
}

/* Links & focus ----------------------------------------------------------- */

a {
  color: var(--brand-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
.button-link:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 45%, transparent);
  border-radius: var(--radius-md);
  outline-offset: 2px;
}

a[href^="mailto:"] {
  font-weight: 600;
}

/* Text helpers ------------------------------------------------------------ */

blockquote {
  font-style: italic;
  color: var(--ink-600);
  border-left: 4px solid var(--brand-accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
}

.bulleted {
  padding-left: 1.25rem;
}

.bulleted li {
  margin: 0.35rem 0;
}

/* Generic section intro (small label + one line of copy) ------------------ */

.section-intro {
  text-align: center;
  max-width: 720px;
  margin: 1.75rem auto 2.25rem;
}

.section-intro .section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink-500);
  margin: 0 0 0.25rem;
}

.section-intro p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.95rem;
}

/* -------------------------------------------------------------------------
Hero (legacy)
   ------------------------------------------------------------------------- */

.af-hero {
  background: linear-gradient(180deg, var(--hero-start) 0%, var(--hero-end) 100%);
  padding: 4rem 2rem 5rem;
  text-align: center;
  color: var(--bg-card);
}

.af-hero h1 {
  margin-top: 0.5rem;
  font-size: 2.4rem;
}

.af-hero p {
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* Main card --------------------------------------------------------------- */

main {
  padding: 2rem;
  max-width: var(--container-max);
  margin: -1.2rem auto 1.5rem;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--ink-500) 10%, transparent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

section.box {
  margin-bottom: 2.5rem;
}

/* Keep list text from running super wide */
section.box ul {
  max-width: 68ch;
}

.content-container {
  padding-bottom: 4rem;
}

/* Card-level page hero (inside the white main card) */
.page-hero {
  text-align: center;
  padding: 2.5rem 2rem 2.25rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, var(--hero-start) 0%, var(--hero-end) 100%);
  color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.page-hero .logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.page-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  color: var(--bg-card);
}

.page-hero .subtitle {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  color: rgba(244, 247, 255, 0.96);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1.0625rem;
}

.btn-primary {
  background: var(--brand-accent);
  color: var(--bg-card);
  border-color: color-mix(in srgb, var(--brand-accent) 85%, var(--ink-900) 15%);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--brand-accent-hover);
  text-decoration: none;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-accent) 40%, var(--ink-900) 60%);
}

.btn-primary[aria-disabled="true"],
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-800);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--border-subtle-hover);
  background: var(--bg-subtle-hover);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 420px) {
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row .btn {
    width: 100%;
  }
}

/* Button-like links ------------------------------------------------------ */

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-sans);
  color: var(--bg-card) !important;
  background: var(--brand-accent);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.08s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.button-link:hover {
  background: var(--brand-accent-hover);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(170, 48, 0, 0.32);
}

.button-link:active {
  transform: translateY(1px);
}

/* Footer ------------------------------------------------------------------ */

footer {
  margin-top: 2.5rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-500);
}

.footer-nav {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.8;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--ink-700);
  margin: 0 8px;
}

.footer-nav a:hover {
  color: var(--brand-accent);
}

.footer-small {
  font-size: 0.85rem;
  color: var(--ink-500);
  max-width: var(--container-max);
  margin: 0.5rem auto 0;
}

/* Images / hover ---------------------------------------------------------- */

.zoom-hover {
  display: inline-block;
  cursor: zoom-in;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zoom-hover:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(90, 125, 255, 0.28);
}

/* High-contrast mode ------------------------------------------------------ */

@media (forced-colors: active) {
  a,
  .button-link,
  .btn {
    border: 1px solid CanvasText;
  }

  a:focus-visible,
  .button-link:focus-visible,
  .btn:focus-visible {
    outline: 2px solid Highlight;
  }
}

/* RTL support ------------------------------------------------------------- */

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] ul {
  padding-right: 1.25rem;
  padding-left: 0;
}

html[dir="rtl"] blockquote {
  border-right: 4px solid var(--brand-accent);
  border-left: none;
  padding-right: 1rem;
  text-align: right;
}

/* Reduced motion ---------------------------------------------------------- */

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

/* Skip link --------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--brand-primary);
  border-radius: 8px;
  color: var(--ink-900);
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

/* CTA bar ----------------------------------------------------------------- */

.cta-bar {
  max-width: var(--container-max);
  margin: 0 auto 1.5rem;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
  border-radius: var(--radius-lg);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .cta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Story layout ------------------------------------------------------------ */

.story-center {
  text-align: center;
  margin: 3rem auto;
}

.story-figure {
  display: inline-block;
  margin: 0;
}

.story-portrait {
  max-width: 240px;
  height: auto;
}

.quote-muted {
  color: var(--ink-600);
  font-style: italic;
}

/* -------------------------------------------------------------------------
   How AwareFlow Works layout
   ------------------------------------------------------------------------- */

.af-card {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--ink-500) 10%, transparent);
}

.af-how-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
}

.af-how-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
}

.af-how-steps {
  display: grid;
  gap: 1.25rem;
}

af-overline {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: rgba(245, 247, 255, 0.6);
  margin-bottom: 0.5rem;
}

.af-subtitle {
  font-size: 1rem;
  color: rgba(245, 247, 255, 0.72);
}

/* Diagram card */
.af-how-diagram {
  display: flex;
  flex-direction: column;
}

.af-diagram-title {
  font-size: 1.05rem;
  margin: 0 0 1rem 0;
}

.af-diagram {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.af-diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Base chip node --------------------------------------------------------- */

.af-diagram-node {
  min-width: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink-400) 18%, transparent);
  background: radial-gradient(
    circle at top left,
    var(--diagram-bg-inner),
    var(--diagram-bg-outer)
  );
  color: var(--ink-800);
  box-shadow: var(--shadow-diagram);  text-align: center;
}

.af-diagram-wide {
  border-radius: 12px;
  width: 100%;
}

/* Subtle emphasis for final “Aware Insights” node ------------------------ */

.af-diagram-highlight {
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--bg-card) 60%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--brand-primary) 28%, transparent),
    0 8px 18px rgba(90, 125, 255, 0.25);
}

.af-diagram-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.af-diagram-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--ink-600);
}

.af-diagram-arrow {
  font-size: 1.1rem;
  color: var(--ink-500);
}

.af-diagram-arrow-down {
  margin: 0.1rem 0;
}

.af-diagram-footer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--ink-600);
}

/* Responsive for How It Works */
@media (max-width: 900px) {
  .af-how-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .af-how-diagram {
    order: -1; /* show diagram first on mobile */
  }
}

/* Header ------------------------------------------------------------------ */

.site-header {
  background: linear-gradient(
    90deg,
    var(--brand-primary) 0%,
    var(--brand-primary-2) 100%
  );
  color: var(--bg-card);
  text-align: center;
  padding: 2.6rem 1.5rem 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-header .logo {
  max-width: 260px;
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.22));
}

.site-header .title,
.site-header .subtitle {
  margin: 0;
  color: var(--bg-card);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.25),
    0 6px 24px rgba(0, 0, 0, 0.18);
}

.site-header .title {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  letter-spacing: 0.4px;
}

.site-header .subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  opacity: 0.95;
}

/* -------------------------------------------------------------------------- */
/* Main Navigation (header)                                                   */
/* -------------------------------------------------------------------------- */

.main-nav {
  margin: 1rem 0 2rem;
}

/* Default header link appearance */
.site-header nav a {
  color: #fdfbff;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

/* Active / current page */
.site-header nav a[aria-current="page"] {
  color: #ffe5cf;
  font-weight: 600;
  border-bottom: 2px solid #ffe5cf;
}

/* Hover state */
.site-header nav a:hover {
  color: #ffe5cf;
  text-decoration: none;
}

/* Ensure nav links don’t inherit default underlines ---------------------- */

nav[aria-label="Main navigation"] a,
nav[aria-label="Primary"] a {
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   Navigation toggle (mobile)
   ------------------------------------------------------------------------- */

/* Hide toggle on larger screens */
.nav-toggle {
  display: none;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: #fdfbff;         /* high contrast on blue header */
  border-radius: 999px;
}

/* Basic focus ring */
.nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent);
}

@media (max-width: 640px) {
  .site-header .title {
    font-size: clamp(1.6rem, 7vw, 1.9rem);
  }

  main {
    padding: 1.2rem;
    margin-top: -1rem;
  }

  .site-header nav {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
  }
}

/* Small screens: use hamburger */

@media (max-width: 720px) {
  .site-header {
    align-items: stretch;
  }

  .site-brand {
    text-align: center;
  }

  .nav-toggle {
    display: inline-flex;
    align-self: center;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 1rem;
  }

  .main-nav.main-nav--open {
    display: flex;
  }
}

/* Larger screens: keep existing flex row nav */
@media (min-width: 721px) {
  .main-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0 2rem;
  }
}

/* Responsive tweaks ------------------------------------------------------- */

@media (max-width: 640px) {
  .site-header .title {
    font-size: clamp(1.6rem, 7vw, 1.9rem);
  }

  main {
    padding: 1.2rem;
    margin-top: -1rem;
  }

  nav {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
  }
}
