/* ==========================================================================
   An Austrian Economist — Global Stylesheet
   Version: 1.0

   Table of Contents:
   1. Reset & Box Model
   2. Design Tokens (CSS Custom Properties)
   3. Base & Typography
   4. Layout Utilities
   5. Navigation
   6. Hero Section
   7. Section Headings
   8. Essay Cards
   9. App Cards
   10. Tags / Badges
   11. Buttons & Links
   12. Featured App Banner
   13. About Page
   14. Filter Bar (Essays)
   15. Footer
   16. Animations & Transitions
   17. Responsive — Tablet (768px)
   18. Responsive — Small Desktop (1024px)
   19. Responsive — Large Desktop (1440px+)
   ========================================================================== */


/* ==========================================================================
   1. Reset & Box Model
   ========================================================================== */

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

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

body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

ul,
ol {
  list-style: none;
}


/* ==========================================================================
   2. Design Tokens (CSS Custom Properties)
   ========================================================================== */

:root {
  /* --- Color Palette --- */
  --color-bg:             #FAFAF8;
  --color-bg-alt:         #F4F3F0;
  --color-bg-card:        #FFFFFF;
  --color-bg-card-hover:  #FDFCFA;

  --color-text-primary:   #1A1A2E;
  --color-text-secondary: #4A4A5A;
  --color-text-muted:     #6B7280;
  --color-text-faint:     #9CA3AF;

  --color-accent-gold:    #B8860B;
  --color-accent-gold-light: #D4A843;
  --color-accent-gold-dark:  #8B6508;
  --color-accent-gold-bg: rgba(184, 134, 11, 0.08);

  --color-accent-navy:    #2C3E6B;
  --color-accent-navy-light: #3D5291;
  --color-accent-teal:    #2A7B88;

  --color-border:         #E8E6E1;
  --color-border-light:   #F0EDE8;
  --color-border-hover:   #D5D2CC;

  --color-shadow:         rgba(26, 26, 46, 0.06);
  --color-shadow-md:      rgba(26, 26, 46, 0.10);
  --color-shadow-lg:      rgba(26, 26, 46, 0.14);

  /* Status colors */
  --color-success:        #2D8A56;
  --color-disabled:       #C5C3BD;
  --color-disabled-bg:    #EDEDEB;
  --color-disabled-text:  #9CA3AF;

  /* --- Typography --- */
  --font-heading:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Modular type scale (minor third ~1.2) with fluid clamp */
  --text-xs:    clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);    /* ~12-13px */
  --text-sm:    clamp(0.8125rem, 0.77rem + 0.2vw, 0.875rem);   /* ~13-14px */
  --text-base:  clamp(1rem, 0.93rem + 0.3vw, 1.0625rem);       /* ~16-17px */
  --text-lg:    clamp(1.125rem, 1.05rem + 0.35vw, 1.1875rem);  /* ~18-19px */
  --text-xl:    clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);        /* ~20-24px */
  --text-2xl:   clamp(1.5rem, 1.25rem + 1vw, 1.875rem);        /* ~24-30px */
  --text-3xl:   clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);       /* ~30-40px */
  --text-4xl:   clamp(2.25rem, 1.75rem + 2vw, 3.25rem);        /* ~36-52px */
  --text-5xl:   clamp(2.75rem, 2rem + 3vw, 4rem);              /* ~44-64px */

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.02em;
  --tracking-wider:   0.04em;
  --tracking-widest:  0.08em;

  /* --- Spacing Scale (8px base) --- */
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */
  --space-32:  8rem;      /* 128px */

  /* --- Layout --- */
  --max-width-site:    1280px;
  --max-width-content: 960px;
  --max-width-wide:    1120px;
  --max-width-reading: 72ch;
  --max-width-narrow:  640px;

  --nav-height: 72px;

  /* --- Borders & Radius --- */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.35s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ==========================================================================
   3. Base & Typography
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

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

strong {
  font-weight: 600;
}

::selection {
  background-color: var(--color-accent-gold-bg);
  color: var(--color-text-primary);
}


/* ==========================================================================
   4. Layout Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width-site);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

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

/* Wider container for grid sections that need breathing room at 1440px */
.container--wide {
  max-width: var(--max-width-wide);
}

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

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section--sm {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

/* Reduce combined gap when sections stack directly */
.section + .section,
.section + .section--sm {
  padding-top: var(--space-10); /* 40px instead of 64px */
}

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   5. Navigation
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--nav-height);
  transition: box-shadow var(--transition-base);
}

.site-nav.scrolled {
  box-shadow: 0 1px 8px var(--color-shadow);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.site-nav__logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.site-nav__logo:hover {
  color: var(--color-accent-gold);
}

.site-nav__links {
  display: none;
  align-items: center;
  gap: var(--space-8);
}

.site-nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-2) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.site-nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent-gold);
  transition: width var(--transition-base);
}

.site-nav__link:hover {
  color: var(--color-text-primary);
}

.site-nav__link:hover::after {
  width: 100%;
}

.site-nav__link--active {
  color: var(--color-accent-gold);
}

.site-nav__link--active::after {
  width: 100%;
}

/* Hamburger toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  gap: 5px;
  z-index: 1001;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
  transform-origin: center;
}

/* Hamburger open state */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(250, 250, 248, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  padding: var(--space-12) var(--space-5);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.mobile-menu.is-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu__link {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  padding: var(--space-3) var(--space-6);
  transition: color var(--transition-fast);
}

.mobile-menu__link:hover,
.mobile-menu__link--active {
  color: var(--color-accent-gold);
}

/* Body scroll lock when menu is open */
body.nav-open {
  overflow: hidden;
}

/* Spacer to push content below fixed nav */
.nav-spacer {
  height: var(--nav-height);
}


/* ==========================================================================
   6. Hero Section
   ========================================================================== */

.hero {
  min-height: calc(65vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-5);
}

.hero__content {
  max-width: 720px;
}

.hero__rule {
  width: 64px;
  height: 2px;
  background-color: var(--color-accent-gold);
  border: none;
  margin: 0 auto var(--space-10);
}

.hero__quote {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 400;
  font-style: italic;
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  margin-bottom: var(--space-8);
  letter-spacing: var(--tracking-tight);
}

.hero__attribution {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-12);
}

.hero__attribution span {
  color: var(--color-accent-gold);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}


/* ==========================================================================
   7. Section Headings
   ========================================================================== */

.section-header {
  margin-bottom: var(--space-10);
}

.section-header--center {
  text-align: center;
}

.section-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.section-header__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: var(--leading-normal);
}

.section-header--center .section-header__subtitle {
  margin-left: auto;
  margin-right: auto;
}

.section-header__rule {
  width: 48px;
  height: 2px;
  background-color: var(--color-accent-gold);
  border: none;
  margin-top: var(--space-4);
}

.section-header--center .section-header__rule {
  margin-left: auto;
  margin-right: auto;
}

/* "View All" link at bottom of section */
.section-footer {
  text-align: center;
  margin-top: var(--space-10);
}

.section-footer__link {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-accent-gold);
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.section-footer__link:hover {
  color: var(--color-accent-gold-dark);
}

.section-footer__link svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.section-footer__link:hover svg {
  transform: translateX(3px);
}


/* ==========================================================================
   8. Essay Cards
   ========================================================================== */

/* Grid layout for homepage essay previews */
.essay-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.essay-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.essay-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow);
  border-color: var(--color-border-hover);
}

.essay-card:focus-within {
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.essay-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.essay-card__title a {
  color: inherit;
  transition: color var(--transition-fast);
}

.essay-card__title a:hover {
  color: var(--color-accent-gold);
}

.essay-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-accent-navy);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.essay-card__meta-divider {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: var(--color-text-faint);
  flex-shrink: 0;
}

.essay-card__excerpt {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-5);
  flex: 1;
}

.essay-card__read-more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent-gold);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--transition-fast), gap var(--transition-fast);
}

.essay-card__read-more:hover {
  color: var(--color-accent-gold-dark);
  gap: var(--space-2);
}

/* Full-width list layout for essays page */
.essay-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.essay-card--list {
  padding: var(--space-8);
}

.essay-card--list .essay-card__title {
  font-size: var(--text-2xl);
}

.essay-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}


/* ==========================================================================
   9. App Cards
   ========================================================================== */

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

.app-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.app-card__description {
  flex: 1;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow);
  border-color: var(--color-border-hover);
}

.app-card:focus-within {
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.app-card--disabled {
  opacity: 0.65;
  cursor: default;
}

.app-card--disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border);
}

.app-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background-color: var(--color-accent-gold-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.app-card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-accent-gold);
}

.app-card__icon--disabled {
  background-color: var(--color-disabled-bg);
}

.app-card__icon--disabled svg {
  color: var(--color-disabled);
}

.app-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.app-card__description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.app-card__status {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-disabled-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}


/* ==========================================================================
   10. Tags / Badges
   ========================================================================== */

.tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.tag:hover {
  background-color: rgba(42, 123, 136, 0.1);
  border-color: var(--color-accent-teal);
  color: var(--color-accent-teal);
}


/* ==========================================================================
   11. Buttons & Links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
}

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

/* Primary: Gold filled */
.btn--primary {
  background-color: var(--color-accent-gold);
  color: #FFFFFF;
  border-color: var(--color-accent-gold);
}

.btn--primary:hover {
  background-color: var(--color-accent-gold-dark);
  border-color: var(--color-accent-gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary: Outlined */
.btn--secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-text-secondary);
  background-color: var(--color-bg-alt);
  transform: translateY(-1px);
}

.btn--secondary:active {
  transform: translateY(0);
}

/* Ghost: Minimal */
.btn--ghost {
  background-color: transparent;
  color: var(--color-accent-gold);
  border-color: transparent;
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  background-color: var(--color-accent-gold-bg);
  color: var(--color-accent-gold-dark);
}

/* Disabled */
.btn--disabled,
.btn[disabled] {
  background-color: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  border-color: var(--color-disabled-bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* Small variant */
.btn--sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}


/* ==========================================================================
   12. Featured App Banner
   ========================================================================== */

.featured-app {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
}

.featured-app__badge {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent-navy);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.featured-app__name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.featured-app__description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 55ch;
}


/* ==========================================================================
   13. About Page
   ========================================================================== */

.about {
  max-width: 760px;
  margin: 0 auto;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
}

.about__photo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-10);
}

.about__photo {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-alt);
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about__photo svg {
  width: 80px;
  height: 80px;
  color: var(--color-text-faint);
}

.about__bio {
  text-align: left;
  margin-bottom: var(--space-12);
}

.about__bio p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.about__social-heading {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-6);
  color: var(--color-text-primary);
}

.about__social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
  min-height: 44px;
}

.social-link:hover {
  color: var(--color-accent-gold);
  border-color: var(--color-accent-gold-light);
  background-color: var(--color-accent-gold-bg);
}

.social-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}


/* ==========================================================================
   14. Filter Bar (Essays)
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
}

.filter-bar__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

.filter-bar__btn {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.filter-bar__btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text-primary);
}

.filter-bar__btn--active,
.filter-bar__btn--active:hover {
  background-color: var(--color-text-primary);
  color: var(--color-bg);
  border-color: var(--color-text-primary);
}

/* Mobile filter bar: horizontal scroll instead of wrapping */
@media (max-width: 767px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-4);
    /* Gradient fade on right edge to hint at scrollable overflow */
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  }
}


/* ==========================================================================
   15. Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-5);
  margin-top: var(--space-12);
}

.site-footer__inner {
  max-width: var(--max-width-site);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.site-footer__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.site-footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.site-footer__link:hover {
  color: var(--color-accent-teal);
  border-color: var(--color-accent-teal);
}

.site-footer__link svg {
  width: 16px;
  height: 16px;
}

.site-footer__copyright {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}


/* ==========================================================================
   Apps Section — reduced bottom padding for sparse content
   ========================================================================== */

.apps-section {
  padding-bottom: var(--space-8);
}


/* ==========================================================================
   16. Animations & Transitions
   ========================================================================== */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Page-load animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply animations to key elements */
.hero__content {
  animation: fadeInUp 0.8s ease-out both;
}

.section-header {
  animation: fadeInUp 0.6s ease-out both;
}

.essay-card {
  animation: fadeInUp 0.6s ease-out both;
}

.essay-card:nth-child(1) { animation-delay: 0.1s; }
.essay-card:nth-child(2) { animation-delay: 0.2s; }
.essay-card:nth-child(3) { animation-delay: 0.3s; }

.featured-app {
  animation: fadeInUp 0.6s ease-out both;
  animation-delay: 0.1s;
}

.page-header {
  animation: fadeInUp 0.6s ease-out both;
}

.app-card {
  animation: fadeInUp 0.6s ease-out both;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }

.about {
  animation: fadeInUp 0.6s ease-out both;
  animation-delay: 0.1s;
}

.essay-card--list {
  animation: fadeInUp 0.5s ease-out both;
}

.essay-card--list:nth-child(1) { animation-delay: 0.05s; }
.essay-card--list:nth-child(2) { animation-delay: 0.1s; }
.essay-card--list:nth-child(3) { animation-delay: 0.15s; }
.essay-card--list:nth-child(4) { animation-delay: 0.2s; }
.essay-card--list:nth-child(5) { animation-delay: 0.25s; }
.essay-card--list:nth-child(6) { animation-delay: 0.3s; }

/* Reduced motion preference */
@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;
  }
}


/* ==========================================================================
   PAGE: Page-level heading areas
   ========================================================================== */

.page-header {
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
  text-align: center;
}

.page-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.page-header__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin: 0 auto;
  line-height: var(--leading-normal);
}

.page-header__rule {
  width: 48px;
  height: 2px;
  background-color: var(--color-accent-gold);
  border: none;
  margin: var(--space-5) auto 0;
}


/* Hide redundant footer site name on mobile (copyright already contains it) */
@media (max-width: 767px) {
  .site-footer__name {
    display: none;
  }
}


/* ==========================================================================
   17. Responsive — Tablet and Up (768px)
   ========================================================================== */

@media (min-width: 768px) {

  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  .site-nav__inner {
    padding: 0 var(--space-8);
  }

  /* Show desktop nav links, hide hamburger */
  .site-nav__links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

  /* Hero */
  .hero {
    min-height: calc(68vh - var(--nav-height));
    padding: var(--space-16) var(--space-8);
  }

  /* Essay grid: 2 columns on tablet */
  .essay-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Center orphaned last card when odd number of items */
  .essay-grid > .essay-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 60%;
    justify-self: center;
  }

  /* App grid: 2 columns on tablet */
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Featured app: horizontal layout */
  .featured-app {
    flex-direction: row;
    text-align: left;
    padding: var(--space-10);
    gap: var(--space-8);
  }

  .featured-app__content {
    flex: 1;
  }

  .featured-app__action {
    flex-shrink: 0;
    align-self: center;
  }

  /* Footer: horizontal layout with true center alignment */
  .site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    text-align: left;
  }

  .site-footer__copyright {
    order: -1;
  }

  .site-footer__links {
    justify-self: end;
  }

  /* About photo larger */
  .about__photo {
    width: 200px;
    height: 200px;
  }
}


/* ==========================================================================
   18. Responsive — Small Desktop (1024px)
   ========================================================================== */

@media (min-width: 1024px) {

  /* Reduce hero height on desktop to avoid cavernous gap */
  .hero {
    min-height: calc(60vh - var(--nav-height));
  }

  /* Essay grid: 3 columns on desktop */
  .essay-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Section spacing increases */
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .section + .section,
  .section + .section--sm {
    padding-top: var(--space-12); /* 48px instead of 80px */
  }

  .page-header {
    padding-top: var(--space-16);
    padding-bottom: var(--space-10);
  }
}


/* ==========================================================================
   19. Responsive — Large Desktop (1440px+)
   ========================================================================== */

@media (min-width: 1440px) {

  .container {
    padding-left: var(--space-12);
    padding-right: var(--space-12);
  }

  .site-nav__inner {
    padding: 0 var(--space-12);
  }
}


/* ==========================================================================
   20. Print Styles (minimal)
   ========================================================================== */

@media print {
  .site-nav,
  .nav-spacer,
  .site-footer,
  .btn,
  .filter-bar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .essay-card,
  .app-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}


/* ==========================================================================
   21. Article / Essay Page
   ========================================================================== */

/* --- Back link --- */
.article__back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wide);
  transition: color var(--transition-fast), gap var(--transition-fast);
  margin-bottom: var(--space-8);
}

.article__back-link:hover {
  color: var(--color-accent-gold);
  gap: var(--space-3);
}

.article__back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Article header --- */
.article__header {
  text-align: center;
  margin-bottom: var(--space-12);
  animation: fadeInUp 0.8s ease-out both;
}

.article__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
}

.article__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-accent-navy);
  font-weight: 500;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.article__meta-divider {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: var(--color-text-faint);
  flex-shrink: 0;
}

.article__tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.article__rule {
  width: 48px;
  height: 2px;
  background-color: var(--color-accent-gold);
  border: none;
  margin: 0 auto;
}

/* --- Article body --- */
.article__body {
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

.article__body p {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem; /* 20px */
}

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

/* Section headings within the article */
.article__body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
  padding-top: var(--space-3);
}

/* Remove extra top margin on first heading */
.article__body h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* Tighten H2 when it follows a pull quote (pull quote already provides spacing) */
.article__pullquote + h2 {
  margin-top: var(--space-5);
  padding-top: 0;
}

/* --- Inline blockquotes (attributed quotes from economists) --- */
.article__body blockquote {
  position: relative;
  margin: var(--space-8) 0;
  padding: var(--space-4) 0 var(--space-4) var(--space-8);
  border-left: 3px solid var(--color-accent-gold);
}

.article__body blockquote p {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

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

.article__body blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

/* --- Pull quotes (large, centered callouts) --- */
.article__pullquote {
  position: relative;
  text-align: center;
  margin: var(--space-10) 0;
  padding: var(--space-8) var(--space-6);
}

.article__pullquote::before,
.article__pullquote::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background-color: var(--color-accent-gold);
  margin: 0 auto;
}

.article__pullquote::before {
  margin-bottom: var(--space-8);
}

.article__pullquote::after {
  margin-top: var(--space-8);
}

.article__pullquote p {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  font-style: italic;
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  max-width: 60ch;
  margin: 0 auto;
}

.article__pullquote__attribution {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-4);
}

/* --- Section dividers within article --- */
.article__divider {
  width: 32px;
  height: 2px;
  background-color: var(--color-border);
  border: none;
  margin: var(--space-12) auto;
}

/* --- Article footer (bottom back link) --- */
.article__footer {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
}

.article__footer .article__back-link {
  margin-bottom: 0;
}

/* --- Lead paragraph styling (drop cap only, same body styling) --- */
.article__body > p:first-of-type {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

.article__body > p:first-of-type::first-letter {
  font-family: var(--font-heading);
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  padding-right: 0.1em;
  margin-top: 0.05em;
  color: var(--color-text-primary);
  font-weight: 700;
}

/* --- Emphasis and book titles --- */
.article__body em {
  font-style: italic;
}


/* ==========================================================================
   21b. Article Responsive — Tablet (768px+)
   ========================================================================== */

@media (min-width: 768px) {
  .article__body blockquote {
    padding: var(--space-6) 0 var(--space-6) var(--space-10);
    margin: var(--space-10) 0;
  }

  .article__pullquote {
    margin: var(--space-12) calc(-1 * var(--space-8));
    padding: var(--space-10) var(--space-8);
  }

  .article__pullquote p {
    font-size: var(--text-3xl);
  }

  .article__header {
    margin-bottom: var(--space-12);
  }
}


/* ==========================================================================
   21c. Article Responsive — Desktop (1024px+)
   ========================================================================== */

@media (min-width: 1024px) {
  .article__pullquote {
    margin: var(--space-12) calc(-1 * var(--space-12));
  }
}


/* ==========================================================================
   21d. Article Print Styles
   ========================================================================== */

@media print {
  .article__back-link,
  .article__footer {
    display: none !important;
  }

  .article__pullquote {
    border: 1px solid #ccc;
    padding: 1rem;
    margin: 1rem 0;
  }

  .article__body blockquote {
    border-left: 3px solid #999;
    background: none;
  }
}
