/* ==========================================================================
   Smashing Magazine — Shared Design System
   styles.css
   Single source of truth for every page: tokens, base type, layout,
   reusable components and the site chrome (header/nav/footer).
   Mobile-first: base styles target small screens, min-width queries scale up.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- Brand & accent palette ------------------------------------------- */
  --color-brand:        #d33a2c;   /* signature Smashing red */
  --color-brand-dark:   #b02a1e;
  --color-brand-soft:   #f5d9d4;
  --color-accent:       #f55700;   /* promo orange */
  --color-success:      #18a46f;
  --color-info:         #006fc6;   /* inline link blue */

  /* --- Neutrals --------------------------------------------------------- */
  --color-ink:          #333333;
  --color-text:         #444444;
  --color-muted:        #666666;
  --color-faint:        #999999;
  --color-border:       #dddddd;
  --color-hairline:     #e8e8e8;
  --color-surface:      #f6f3f2;
  --color-surface-2:    #eeeeee;
  --color-bg:           #ffffff;
  --color-bg-alt:       #faf8f7;
  --color-black:        #111111;
  --color-white:        #ffffff;

  /* --- Pastel content tints (guides / promos) --------------------------- */
  --tint-warm:          #fff2ea;
  --tint-orange:        #fef6f1;
  --tint-blue:          #f0f9fc;
  --tint-green:         #f2faf3;
  --tint-yellow:        #fff9e6;
  --tint-pink:          #fdeef2;

  /* --- Semantic roles --------------------------------------------------- */
  --bg-color:           var(--color-bg);
  --text-color:         var(--color-ink);
  --heading-color:      var(--color-ink);
  --link-color:         var(--color-brand);
  --link-color-hover:   var(--color-brand-dark);
  --link-inline:        var(--color-info);
  --focus-ring:         0 0 0 3px rgba(211, 58, 44, 0.35);

  /* --- Typography ------------------------------------------------------- */
  --font-display: "Elena", "Georgia", "Times New Roman", serif;
  --font-body:    "Mija", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-accent:  "DinMedium", "Mija", -apple-system, Arial, sans-serif;
  --font-mono:    "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Modular type scale (1.2 minor third -> 1.25 major third on wide) */
  --step--1: 0.875rem;  /* 14px small / captions      */
  --step-0:  1.0625rem; /* 17px body                  */
  --step-1:  1.25rem;   /* 20px lead / h4             */
  --step-2:  1.5rem;    /* 24px h3                    */
  --step-3:  1.875rem;  /* 30px h2                    */
  --step-4:  2.25rem;   /* 36px h1 compact            */
  --step-5:  2.75rem;   /* 44px hero                  */
  --step-6:  3.5rem;    /* 56px hero XL               */

  --leading-tight:  1.15;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.85;

  --tracking-tight: -0.02em;
  --tracking-wide:  0.08em;
  --tracking-caps:  0.14em;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    700;
  --weight-black:   800;

  /* --- Spacing scale (8px base) ----------------------------------------- */
  --space-3xs: 0.25rem;  /* 4px  */
  --space-2xs: 0.5rem;   /* 8px  */
  --space-xs:  0.75rem;  /* 12px */
  --space-sm:  1rem;     /* 16px */
  --space-md:  1.5rem;   /* 24px */
  --space-lg:  2rem;     /* 32px */
  --space-xl:  3rem;     /* 48px */
  --space-2xl: 4.5rem;   /* 72px */
  --space-3xl: 6.5rem;   /* 104px */

  /* --- Layout ----------------------------------------------------------- */
  --container-max: 1200px;
  --container-narrow: 760px;
  --container-wide: 1360px;
  --gutter: var(--space-md);
  --gap: var(--space-md);
  --stack-margin: 1rem;

  /* --- Radii ------------------------------------------------------------ */
  --radius-xs:  3px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* --- Shadows ---------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow-sm: 0 2px 6px rgba(17, 17, 17, 0.07);
  --shadow-md: 0 8px 22px rgba(17, 17, 17, 0.10);
  --shadow-lg: 0 18px 44px rgba(17, 17, 17, 0.14);
  --shadow-brand: 0 10px 26px rgba(211, 58, 44, 0.28);

  /* --- Motion ----------------------------------------------------------- */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.55, 0.06, 0.32, 0.94);
  --duration-fast:  180ms;
  --duration-base:  320ms;
  --duration-slow:  560ms;

  --header-height: 68px;
  --z-header: 100;
  --z-overlay: 200;
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

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

button { cursor: pointer; }

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

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

::selection {
  background: var(--color-brand);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--heading-color);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

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

small,
.text-small {
  font-size: var(--step--1);
  color: var(--color-muted);
}

.text-lead {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--color-muted);
}

.text-muted { color: var(--color-muted); }
.text-faint { color: var(--color-faint); }

.kicker,
.eyebrow {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-brand);
}

.prose {
  max-width: 68ch;
}

.prose a,
a.inline-link {
  color: var(--link-inline);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose a:hover,
a.inline-link:hover { color: var(--color-brand); }

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

code {
  background: var(--color-surface-2);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-xs);
}

pre {
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--leading-snug);
}

pre code { background: none; padding: 0; }

blockquote {
  border-left: 4px solid var(--color-brand);
  padding-left: var(--space-md);
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--color-ink);
}

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

/* --------------------------------------------------------------------------
   4. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }

.section {
  padding-block: var(--space-xl);
}

.section--tight { padding-block: var(--space-lg); }
.section--roomy { padding-block: var(--space-2xl); }

.section--alt { background: var(--color-bg-alt); }
.section--surface { background: var(--color-surface); }

.stack > * + * { margin-top: var(--stack-margin); }
.stack--sm > * + * { margin-top: var(--space-2xs); }
.stack--lg > * + * { margin-top: var(--space-lg); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}

.grid--2,
.grid--3,
.grid--4 { grid-template-columns: 1fr; }

.flow > * + * { margin-top: var(--space-md); }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-overlay);
  background: var(--color-brand);
  color: var(--color-white);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--color-ink);
  --btn-fg: var(--color-white);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 0.7em 1.35em;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-accent);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-bg: var(--color-brand);
  --btn-fg: var(--color-white);
}

.btn-primary:hover {
  --btn-bg: var(--color-brand-dark);
  box-shadow: var(--shadow-brand);
  color: var(--color-white);
}

.btn-secondary {
  --btn-bg: transparent;
  --btn-fg: var(--color-ink);
  --btn-border: var(--color-ink);
}

.btn-secondary:hover {
  --btn-bg: var(--color-ink);
  --btn-fg: var(--color-white);
  color: var(--color-white);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--color-brand);
  --btn-border: transparent;
  padding-inline: 0.4em;
}

.btn-ghost:hover { --btn-fg: var(--color-brand-dark); }

.btn-accent {
  --btn-bg: var(--color-accent);
  --btn-fg: var(--color-white);
}

.btn-lg { font-size: var(--step-0); padding: 0.85em 1.7em; }
.btn-sm { font-size: 0.8125rem; padding: 0.5em 1em; }
.btn-block { display: flex; width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* --------------------------------------------------------------------------
   6. CARDS, TAGS & BADGES
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-brand-soft);
  box-shadow: var(--shadow-md);
}

.card--flat { border-color: var(--color-hairline); }
.card--flat:hover { transform: none; box-shadow: var(--shadow-xs); }
.card--pad-lg { padding: var(--space-lg); }

.card--tint-warm   { background: var(--tint-warm);   border-color: transparent; }
.card--tint-orange { background: var(--tint-orange); border-color: transparent; }
.card--tint-blue   { background: var(--tint-blue);   border-color: transparent; }
.card--tint-green  { background: var(--tint-green);  border-color: transparent; }
.card--tint-yellow { background: var(--tint-yellow); border-color: transparent; }
.card--tint-pink   { background: var(--tint-pink);   border-color: transparent; }

.card__media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  aspect-ratio: 16 / 9;
}

.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__body { display: flex; flex-direction: column; gap: var(--space-2xs); }

.card__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: var(--leading-tight);
}

.card__title a { color: var(--heading-color); }
.card__title a:hover { color: var(--color-brand); }

.card__excerpt {
  color: var(--color-muted);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
}

.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-faint);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.7em;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.tag--brand   { background: var(--color-brand-soft); color: var(--color-brand-dark); }
.tag--blue    { background: var(--tint-blue);   color: var(--color-info); }
.tag--green   { background: var(--tint-green);  color: var(--color-success); }
.tag--orange  { background: var(--tint-orange); color: var(--color-accent); }
.tag--yellow  { background: var(--tint-yellow); color: #8a6d00; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
  object-fit: cover;
  background: var(--color-surface-2);
  flex: none;
}

.byline {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-muted);
}

.byline strong { color: var(--color-ink); }

/* Callout / promo band */
.callout {
  background: var(--tint-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.form-field {
  display: block;
  width: 100%;
  padding: 0.7em 1em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: var(--step-0);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-field:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--focus-ring);
}

/* --------------------------------------------------------------------------
   7. SITE CHROME — HEADER / NAV
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-decoration: none;
  flex: none;
}

.brand:hover { color: var(--color-ink); }

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-brand);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: var(--weight-black);
}

.site-nav { display: flex; align-items: center; }

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 0.5em 0.7em;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-family: var(--font-accent);
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  background: var(--color-surface-2);
  color: var(--color-brand);
}

.nav-link[aria-current="page"] {
  color: var(--color-brand);
  font-weight: var(--weight-bold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

/* Mobile toggle: a checkbox + label, no JS required */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle:checked + .nav-toggle-label span:nth-child(2) { opacity: 0; }
.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Base (mobile): nav collapses; opens when toggle checked */
.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  align-items: stretch;
  padding: var(--space-sm) var(--gutter) var(--space-md);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              visibility var(--duration-base) var(--ease-out);
}

.nav-toggle:checked ~ .site-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav .nav-list {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.site-nav .nav-link {
  display: block;
  padding: 0.75em 0.4em;
  border-bottom: 1px solid var(--color-hairline);
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   8. SITE CHROME — FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-2xl);
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.78);
  padding-block: var(--space-xl) var(--space-lg);
  font-size: var(--step--1);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.site-footer a:hover { color: var(--color-white); }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.footer-brand .brand { color: var(--color-white); }
.footer-brand .brand:hover { color: var(--color-white); }

.footer-tagline {
  margin-top: var(--space-sm);
  max-width: 34ch;
  line-height: var(--leading-snug);
  color: rgba(255, 255, 255, 0.65);
}

.footer-col h4 {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   9. MOTION — reusable animation / transition classes
   -------------------------------------------------------------------------- */
@keyframes fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes content-injection {
  0%   { transform: translateX(40px); opacity: 0; }
  100% { transform: translateX(0);    opacity: 1; }
}

@keyframes wiggle {
  0%   { transform: rotate(4deg); }
  50%  { transform: rotate(-4deg); }
  100% { transform: rotate(4deg); }
}

@keyframes blink {
  45%, 55% { transform: scaleY(1); }
  50%      { transform: scaleY(0); }
}

@keyframes head-shake {
  0%     { transform: translateX(0); }
  12.5%  { transform: translateX(-6px) rotateY(-9deg); }
  37.5%  { transform: translateX(5px) rotateY(7deg); }
  62.5%  { transform: translateX(-3px) rotateY(-5deg); }
  87.5%  { transform: translateX(2px) rotateY(3deg); }
  100%   { transform: translateX(0); }
}

@keyframes bob {
  16.65% { transform: translateY(8px); }
  33.3%  { transform: translateY(-6px); }
  49.95% { transform: translateY(4px); }
  66.6%  { transform: translateY(-2px); }
  83.25% { transform: translateY(1px); }
  100%   { transform: translateY(0); }
}

@keyframes drift {
  15% { transform: translate3d(260px, 180px, 0); }
  30% { transform: translate3d(240px, 150px, 0); }
  45% { transform: translate3d(190px, 220px, 0); }
  60% { transform: translate3d(150px, 120px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  animation: fade-in var(--duration-slow) var(--ease-out) forwards;
}

.fade-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-in var(--duration-slow) var(--ease-out) forwards;
}

.fade-in-from-right {
  opacity: 0;
  transform: translateX(40px);
  animation: content-injection var(--duration-slow) var(--ease-out) forwards;
}

.wiggle        { animation: wiggle 1.2s var(--ease-in-out) infinite; }
.blink         { animation: blink 3s steps(1, end) infinite; }
.head-shake    { animation: head-shake 0.8s var(--ease-in-out) both; }
.bob           { animation: bob 0.6s var(--ease-in-out) both; }
.drift         { animation: drift 10s var(--ease-in-out) infinite; }

.marquee {
  display: flex;
  width: max-content;
  gap: var(--space-xl);
  animation: marquee 32s linear infinite;
}

.marquee:hover { animation-play-state: paused; }

.delay-1 { animation-delay: 120ms; }
.delay-2 { animation-delay: 240ms; }
.delay-3 { animation-delay: 360ms; }

/* --------------------------------------------------------------------------
   10. RESPONSIVE — mobile-first min-width queries
   -------------------------------------------------------------------------- */
@media (min-width: 480px) {
  :root { --gutter: var(--space-lg); }
  h1 { font-size: var(--step-5); }
}

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .section { padding-block: var(--space-2xl); }
}

@media (min-width: 900px) {
  :root {
    --gutter: var(--space-xl);
    --header-height: 76px;
  }

  h1 { font-size: var(--step-6); }

  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }

  /* Desktop: nav is horizontal again, toggle hidden */
  .nav-toggle-label { display: none; }

  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .site-nav .nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3xs);
  }

  .site-nav .nav-link {
    padding: 0.5em 0.75em;
    border-bottom: 0;
    border-radius: var(--radius-sm);
  }
}

@media (min-width: 1200px) {
  :root { --gutter: var(--space-lg); }
}

/* --------------------------------------------------------------------------
   11. DARK MODE
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #17161a;
    --color-bg-alt: #1d1c21;
    --color-surface: #232227;
    --color-surface-2: #2b2a31;
    --color-ink: #f4f2f0;
    --color-text: #d9d6d3;
    --color-muted: #a8a4a0;
    --color-faint: #837f7b;
    --color-border: #37363d;
    --color-hairline: #2c2b31;
    --color-brand-soft: #45221d;

    --tint-warm: #2a201b;
    --tint-orange: #2a211b;
    --tint-blue: #182228;
    --tint-green: #18241c;
    --tint-yellow: #262214;
    --tint-pink: #281a1f;

    --bg-color: var(--color-bg);
    --text-color: var(--color-text);
    --heading-color: var(--color-ink);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
  }

  .site-header { background: rgba(23, 22, 26, 0.92); }
  .site-footer { background: #101014; }
  .card { background: var(--color-surface); }
  .form-field { background: var(--color-surface); }
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY — reduced motion & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .fade-in,
  .fade-up,
  .fade-in-from-right {
    opacity: 1;
    transform: none;
  }

  .marquee { animation: none; }
}

@media print {
  .site-header,
  .site-footer,
  .nav-toggle-label { display: none !important; }

  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
