/* ==========================================================================
   base.css — design tokens, reset, and base element styles
   The Folio Studios. Values mirror the homepage design mockup:
   cream paper, near-black ink, blue accent used sparingly.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700&family=Work+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color — surfaces */
  --color-bg: #fbfaf7;
  --color-panel: #f4f3ef;
  --color-surface-dark: #16181d;
  --color-surface-darker: #1b1c20;

  /* Color — text */
  --color-text: #16181d;      /* primary / near-black */
  --color-text-secondary: #4b4d54;
  --color-text-muted: #8d8d84;
  --color-text-faint: #9a9a90; /* eyebrows, labels, disabled */
  --color-text-on-dark: #fbfaf7;

  /* Color — lines */
  --color-border: #e6e4dc;     /* primary hairline */
  --color-border-light: #edece7;

  /* Color — accent (used sparingly: links, CTAs, active states) */
  --color-accent: #2a4dff;

  /* Color — status */
  --color-success: #2f7d4f;
  --color-success-bg: #e5f3ea;
  --color-error: #b23b3b;
  --color-highlight-bg: #fbf6e3;
  --color-highlight-border: #d8b23c;

  /* Typography — families */
  --font-heading: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', 'Menlo', monospace;

  /* Typography — weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Typography — type scale (1rem = 16px). Headings sit ~1.6–2.2x body:
     present but never shouting. Body holds at 16px for comfortable reading
     next to the trimmed-down headings. */
  --fs-eyebrow: 0.75rem;   /* 12px     — eyebrows / mono labels */
  --fs-xs: 0.8125rem;      /* 13px     — fine print, nav, chrome */
  --fs-sm: 0.9375rem;      /* 15px     — buttons, small body */
  --fs-base: 1rem;         /* 16px     — body copy */
  --fs-md: 1.05rem;        /* ~16.8px  — lead paragraphs */
  --fs-lg: 1.2rem;         /* ~19px    — h3 / sub-headings */
  --fs-xl: 1.4rem;         /* ~22px    — h2 (small) */
  --fs-2xl: 1.7rem;        /* ~27px    — section headings */
  --fs-3xl: 2.1rem;        /* ~34px    — hero heading */

  /* Typography — line heights & tracking */
  --lh-tight: 1.18;
  --lh-heading: 1.25;
  --lh-body: 1.65;
  --tracking-label: 0.12em;  /* uppercase eyebrows */
  --tracking-tight: -0.01em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;   /* 4  */
  --space-2: 0.5rem;    /* 8  */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 3rem;      /* 48 */
  --space-8: 4rem;      /* 64 */
  --space-9: 6rem;      /* 96 */
  --space-10: 8rem;     /* 128 */

  /* Border radius scale */
  --radius-sm: 3px;
  --radius: 4px;        /* default — buttons, cards */
  --radius-md: 6px;
  --radius-lg: 14px;    /* large panels, laptop shell */
  --radius-pill: 999px;

  /* Layout */
  --container-max: 1180px;
  --container-pad: 48px;

  /* Effects */
  --shadow-panel: 0 40px 70px -30px rgba(20, 20, 25, 0.4);
  --transition-fast: 150ms ease;
  --transition: 600ms ease;   /* deliberate section / stage transitions */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth; /* "Back to top"; forced back to auto below under reduced motion */
}

html,
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   Base elements
   -------------------------------------------------------------------------- */
body {
  min-height: 100vh;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--weight-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Full-page paper texture: a fine 1px dot-grid fixed behind all content.
     Faint enough to read as texture, not pattern. Sections with their own
     background (panel, dark) simply cover it. */
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, rgba(22, 24, 29, 0.09) 0.8px, transparent 0.9px);
  background-size: 24px 24px;
  background-position: 0 0;
  background-attachment: fixed;
}

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

h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); font-weight: var(--weight-semibold); }
h4 { font-size: var(--fs-md); font-weight: var(--weight-semibold); }

p {
  color: var(--color-text-secondary);
  max-width: 62ch;
}

p + p {
  margin-top: var(--space-4);
}

a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

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

strong,
b {
  font-weight: var(--weight-semibold);
}

small {
  font-size: var(--fs-xs);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-7) 0;
}

::selection {
  background: var(--color-accent);
  color: var(--color-text-on-dark);
}

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

/* Shared eyebrow / mono label — used across pages */
.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.mono {
  font-family: var(--font-mono);
}

/* Visually-hidden (skip links, a11y labels) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
