/* ==========================================================================
   base.css — PromptingPress Design Foundation
   Design tokens, reset, typography, and base element styles.
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   Change these values to retheme the entire site.
   See ai-instructions/retheme.md for the full retheme workflow.
   ========================================================================== */

:root {
  /* Color — change all 8 to retheme */
  --color-bg:           #fcfdff;  /* color: Page background */
  --color-surface:      #f4f7fb;  /* color: Card / component backgrounds */
  --color-text:         #101828;  /* color: Primary text */
  --color-muted:        #5e6677;  /* color: Secondary text, captions, placeholders */
  --color-border:       #d9e0eb;  /* color: Dividers, outlines */
  --color-accent:       #3157f4;  /* color: Primary action — WCAG AA 4.7:1 on white */
  --color-accent-hover: #2447df;  /* color: Hover / active state for accent */
  --color-bg-inverted:  #0f172a;  /* color: Section variant: inverted bg (semantic opposite of --color-bg) */

  /* Derived colors — computed from the 8 above, used for premium treatments */
  --color-text-secondary:   #2d3648;  /* color: Body descriptions, slightly lighter than text */
  --color-accent-strong:    #2744b7;  /* color: Button gradient dark stop, strong accent borders */
  --color-border-accent:    #9dafee;  /* color: Accent-tinted borders for featured elements */
  --color-surface-accent:   #e8ecfe;  /* color: Accent-washed backgrounds, eyebrows */

  /* Spacing — the layout scale */
  --space-xs:  0.25rem;   /* length: 4px */
  --space-sm:  0.5rem;    /* length: 8px */
  --space-md:  1rem;      /* length: 16px */
  --space-lg:  2rem;      /* length: 32px */
  --space-xl:  4rem;      /* length: 64px */
  --space-2xl: 7rem;      /* length: 112px */
  --space-3xl: 10rem;     /* length: 160px */

  /* Typography — replace both to change fonts */
  --font-body:    system-ui, sans-serif;  /* font-family: Body text */
  --font-heading: system-ui, sans-serif;  /* font-family: All headings */
  --font-weight-heading: 650;     /* number: Heading font weight */
  --line-height-body:    1.6;     /* number: Body text line height */
  --line-height-heading: 1.2;     /* number: Heading line height */

  /* Button rhythm */
  --btn-padding-y: var(--space-sm);  /* length: Button vertical padding */
  --btn-padding-x: var(--space-lg);  /* length: Button horizontal padding */
  --btn-radius: 4px;                 /* length: Button corner radius — the authorable button shape; override to pill a CTA (e.g. 100px) without rounding cards, which follow --radius */

  /* Shape & motion */
  --radius:     0.375rem;   /* length: 6px — increase for rounder corners */
  --max-width:  72rem;      /* length: 1152px — content column max width */
  --measure-body:      70ch;      /* length: Text body measure — section content, readable prose */
  --measure-body-wide: 75ch;      /* length: Wider measure — standalone text sections, centered intros */
  --measure-centered:  56rem;     /* length: Centered section body — preserves current layout width */
  --transition: 150ms ease; /* raw: Default transition for interactive states */
  --overlay-bg: rgba(0, 0, 0, 0.55); /* color: Dark scrim over background images for text readability */

  /* Elevation — presets for the bounded `shadow` style-slot type */
  --shadow-none: none;                              /* shadow: No elevation */
  --shadow-sm:   0 1px 2px rgba(16, 24, 40, 0.06);  /* shadow: Subtle lift (cards, inputs) */
  --shadow-md:   0 4px 12px rgba(16, 24, 40, 0.10); /* shadow: Standard elevation (raised sections) */
  --shadow-lg:   0 12px 32px rgba(16, 24, 40, 0.16);/* shadow: Strong elevation (modals, hero callouts) */

  /* Typography roles — technical/secondary text surfaces beyond body/heading */
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace; /* font-family: Mono / code text */
  --text-meta-size:      0.8125rem;        /* length: Meta text (timestamps, captions) */
  --text-meta-color:     var(--color-muted); /* color: Meta text color */
  --text-label-size:     0.8125rem;        /* length: Label text */
  --text-label-weight:   600;              /* number: Label font weight */
  --text-label-spacing:  0.01em;           /* length: Label letter spacing */
  --text-kicker-size:    0.75rem;          /* length: Kicker / eyebrow text */
  --text-kicker-weight:  700;              /* number: Kicker font weight */
  --text-kicker-spacing: 0.08em;           /* length: Kicker letter spacing */
  --text-kicker-color:   var(--color-accent); /* color: Kicker text color */
}

/* Responsive breakpoints (reference — use in media queries):
   --breakpoint-sm: 640px   single-column stacking, nav collapses
   --breakpoint-md: 768px   2-col grid, nav links visible
   --breakpoint-lg: 1024px  full 3-col grid, full nav
   --breakpoint-xl: 1280px  max-width kicks in
*/

/* ==========================================================================
   2. CSS Reset
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

/* ==========================================================================
   3. Base Typography
   Modular scale: base 1rem, ratio ~1.25
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  color: var(--color-text);
  text-wrap: balance;
  letter-spacing: -0.03em;
}

h1 { font-size: 2.375rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

blockquote {
  margin: 0 0 var(--space-md);
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-accent);
  color: var(--color-muted);
  font-style: italic;
}

blockquote:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   4. Links
   ========================================================================== */

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* ==========================================================================
   5. Focus Ring
   Applied via :focus-visible — only shown for keyboard navigation.
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Remove default outline when :focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   6. Screen Reader Only utility
   Visually hidden, but accessible to assistive technology.
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   7. Skip Link
   Visually hidden until focused — keyboard users see it, mouse users don't.
   ========================================================================== */

.skip-link.screen-reader-text {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 999;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
  clip: rect(0, 0, 0, 0);
}

.skip-link.screen-reader-text:focus {
  top: 0;
  clip: auto;
}

/* ==========================================================================
   8. Responsive breakpoint reference (CSS custom media — documentation only)

   Use standard @media queries in component / utility CSS:
     @media (min-width: 640px)  { ... }   sm
     @media (min-width: 768px)  { ... }   md
     @media (min-width: 1024px) { ... }   lg
     @media (min-width: 1280px) { ... }   xl
   ========================================================================== */
