/* ─────────────────────────────────────────────────────────────────
   main.css  |  Jeremy Anderson Personal Site
   Place in:  static/css/main.css
────────────────────────────────────────────────────────────────── */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Core palette — Forest Scholar */
  --forest: #2E4A38;
  --forest-mid: #3D6149;
  --forest-pale: #EBF2ED;
  --slate: #4A6074;
  --gold: #C9913A;
  --gold-pale: #FDF4E7;
  --ink: #1E2420;
  --text: #3D3D38;
  --muted: #7A8070;
  --border: #D6CEB8;
  --surface: #FFFFFF;
  --rule: #C2BAA5;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --font-script: 'Caveat', cursive;

  /* Spacing */
  --sp-xs: 0.375rem;
  --sp-sm: 0.75rem;
  --sp-md: 1.25rem;
  --sp-lg: 2rem;
  --sp-xl: 3.5rem;
  --sp-2xl: 6rem;

  /* Misc */
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(30, 36, 32, .07), 0 1px 2px rgba(30, 36, 32, .05);
  --shadow: 0 4px 16px rgba(30, 36, 32, .09);
  --shadow-lg: 0 12px 40px rgba(30, 36, 32, .13);
  --transition: 0.22s ease;

  --max-w: 1160px;
  --max-prose: 680px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--gold-pale);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

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

ul {
  list-style: none;
}

/* ── Utility ────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.container-prose {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--sp-sm);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--forest);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46, 74, 56, .3);
}

.btn-primary:hover {
  background: var(--forest-mid);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 74, 56, .3);
}

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}

.btn-ghost:hover {
  background: var(--forest-pale);
  transform: translateY(-2px);
}

.btn-white {
  background: #fff;
  color: var(--forest);
}

.btn-white:hover {
  background: var(--forest-pale);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: rgba(255, 255, 255, .9);
  border: 1.5px solid rgba(255, 255, 255, .4);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .7);
  transform: translateY(-2px);
}

/* ── Nav ────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(253, 244, 231, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-script);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: 0;
  transition: color var(--transition);
}

.nav-logo:hover {
  color: var(--forest-mid);
}

.nav-logo span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--forest);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--forest);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  background: var(--forest) !important;
  color: #fff !important;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem !important;
  transition: background var(--transition), transform var(--transition) !important;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--forest-mid) !important;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0.25rem;
}

.nav-toggle svg {
  display: block;
}

/* ── Hero (homepage) ────────────────────────────────────────────── */
.hero {
  padding: calc(64px + var(--sp-2xl)) 0 var(--sp-2xl);
  background: var(--gold-pale);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.25;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  background: var(--forest-pale);
  border: 1px solid rgba(46, 74, 56, .2);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  margin-bottom: var(--sp-md);
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-md);
}

.hero h1 em {
  font-weight: 300;
  font-style: italic;
  color: var(--forest);
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text);
  max-width: 520px;
  margin: 0 auto var(--sp-lg);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Signature sign-off ─────────────────────────────────────────── */
.hero-signoff {
  margin: 0 auto var(--sp-lg);
  text-align: right;
  max-width: 520px;
}

.hero-signoff .salutation {
  font-size: 1.2rem;
  color: var(--text);
  font-family: var(--font-script);
  font-style: italic;
  margin-bottom: 0;
  line-height: 1;
}

.hero-signoff .signature {
  font-family: var(--font-script);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--forest);
  display: block;
  line-height: 1.1;
}

/* ── Quote block ────────────────────────────────────────────────── */
.hero-quote {
  margin-top: var(--sp-xl);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--surface);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.hero-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.hero-quote cite {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Page hero (inner pages) ────────────────────────────────────── */
.page-hero {
  padding: calc(64px + var(--sp-xl)) 0 var(--sp-xl);
  background: var(--gold-pale);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.2;
  pointer-events: none;
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  text-align: center;
}

.page-hero-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-sm);
}

.page-hero-sub {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Features grid ──────────────────────────────────────────────── */
.features {
  padding: var(--sp-2xl) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-header {
  text-align: center;
  margin-bottom: var(--sp-xl);
}

.features-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
}

.feature-card {
  padding: var(--sp-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--gold-pale);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--forest);
  transition: height var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(46, 74, 56, .25);
}

.feature-card:hover::before {
  height: 100%;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--forest-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-md);
  color: var(--forest);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--sp-xs);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: var(--sp-sm);
}

.feature-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--transition);
}

.feature-link:hover {
  gap: 0.55rem;
}

/* ── Story section ──────────────────────────────────────────────── */
.story {
  padding: var(--sp-2xl) 0;
  background: var(--gold-pale);
}

.story-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-2xl);
  align-items: start;
}

.story-sidebar {
  position: sticky;
  top: calc(64px + var(--sp-lg));
}

.story-sidebar h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-md);
}

.story-sidebar p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: var(--sp-lg);
}

.story-body p {
  color: var(--text);
  font-size: 1.025rem;
  line-height: 1.8;
  margin-bottom: var(--sp-md);
}

.story-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  float: left;
  line-height: 0.8;
  margin: 0.06em 0.12em 0 0;
  color: var(--forest);
}

.lessons {
  margin-top: var(--sp-lg);
  padding: var(--sp-lg);
  background: var(--forest);
  border-radius: var(--radius-lg);
  color: #fff;
}

.lessons h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--sp-sm);
  color: rgba(255, 255, 255, .85);
  letter-spacing: -0.01em;
}

.lessons ol {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lessons li {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(235, 242, 237, 0.9);
}

.lessons li::marker {
  color: var(--gold);
  font-weight: 600;
}

/* ── Posts list ─────────────────────────────────────────────────── */
.posts {
  padding: var(--sp-2xl) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.posts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-xl);
}

.posts-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.see-all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition);
  white-space: nowrap;
}

.see-all:hover {
  gap: 0.55rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--sp-lg);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.post-item:first-child {
  border-top: 1px solid var(--border);
}

.post-item:hover .post-title {
  color: var(--forest);
}

.post-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--rule);
  min-width: 24px;
}

.post-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  background: rgba(74, 96, 116, .08);
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  margin-bottom: 0.3rem;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  transition: color var(--transition);
  display: block;
}

.post-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.2rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--rule);
  white-space: nowrap;
}

/* ── Blog list page ─────────────────────────────────────────────── */
.blog-list-section {
  padding: var(--sp-xl) 0 var(--sp-2xl);
  background: var(--surface);
}

.blog-filters {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-md) 0;
}

.filter-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  transition: all var(--transition);
}

.filter-tag:hover,
.filter-active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: var(--sp-lg) 0;
}

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination {
  margin-top: var(--sp-xl);
}

.pagination-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
}

.pagination-btn {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--forest);
  border: 1.5px solid var(--forest);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.pagination-btn:hover {
  background: var(--forest-pale);
}

.pagination-disabled {
  color: var(--rule);
  border-color: var(--border);
  cursor: default;
}

.pagination-info {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Post detail ────────────────────────────────────────────────── */
.post-hero {
  padding: calc(64px + var(--sp-xl)) 0 var(--sp-xl);
  background: var(--gold-pale);
  border-bottom: 1px solid var(--border);
}

.post-hero-inner {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}

.post-meta-date,
.post-meta-read {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.post-meta-sep {
  color: var(--rule);
}

.post-title-hero {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--sp-md);
}

.post-excerpt-hero {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.post-article {
  padding: var(--sp-2xl) 0;
  background: var(--surface);
}

.post-body {
  padding-bottom: var(--sp-xl);
}

.post-featured-image {
  margin-bottom: var(--sp-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  object-fit: cover;
}

.post-content-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.post-content-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  margin: var(--sp-xl) 0 var(--sp-md);
  letter-spacing: -0.02em;
}

.post-content-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin: var(--sp-lg) 0 var(--sp-sm);
}

.post-content-body p {
  margin-bottom: var(--sp-md);
}

.post-content-body ul,
.post-content-body ol {
  padding-left: 1.5rem;
  margin-bottom: var(--sp-md);
}

.post-content-body li {
  margin-bottom: 0.4rem;
}

.post-content-body blockquote {
  border-left: 3px solid var(--gold);
  padding: var(--sp-sm) var(--sp-lg);
  margin: var(--sp-lg) 0;
  background: var(--gold-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text);
}

.post-content-body a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: rgba(46, 74, 56, .3);
}

.post-content-body a:hover {
  text-decoration-color: var(--forest);
}

.post-content-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--forest-pale);
  color: var(--forest);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.post-content-body pre {
  background: var(--ink);
  color: var(--forest-pale);
  padding: var(--sp-lg);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--sp-md);
}

.post-content-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-lg);
  margin-top: var(--sp-xl);
}

.post-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-share-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}

.share-btn:hover {
  border-color: var(--forest);
  color: var(--forest);
}

/* ── Related posts ──────────────────────────────────────────────── */
.related-posts {
  padding: var(--sp-2xl) 0;
  background: var(--gold-pale);
  border-top: 1px solid var(--border);
}

.related-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-xl);
}

/* ── Projects ───────────────────────────────────────────────────── */
.projects {
  padding: var(--sp-2xl) 0;
  background: var(--gold-pale);
  border-top: 1px solid var(--border);
}

.projects-page {
  background: var(--surface);
}

.projects-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-xl);
}

.projects-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
}

.projects-grid-full {
  grid-template-columns: repeat(2, 1fr);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--forest-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
}

.project-icon svg {
  width: 18px;
  height: 18px;
}

.project-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.badge-live {
  background: rgba(46, 74, 56, .1);
  color: var(--forest);
}

.badge-wip {
  background: rgba(201, 145, 58, .12);
  color: var(--gold);
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--sp-md);
}

.project-stack {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--slate);
  background: rgba(74, 96, 116, .08);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
}

/* ── CTA section ────────────────────────────────────────────────── */
.cta-section {
  padding: var(--sp-2xl) 0;
  background: var(--forest);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(201, 145, 58, .12) 0%, transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(74, 96, 116, .1) 0%, transparent 60%);
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.cta-inner .section-label {
  color: rgba(201, 145, 58, .9);
}

.cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-md);
}

.cta-inner p {
  color: rgba(235, 242, 237, .7);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--sp-lg);
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: rgba(235, 242, 237, .6);
  padding: var(--sp-2xl) 0 var(--sp-xl);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.footer-logo-text {
  font-family: var(--font-script);
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(235, 242, 237, .9);
  margin-bottom: var(--sp-sm);
  letter-spacing: 0;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.65;
  max-width: 260px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-sm);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col ul li a {
  font-size: 0.88rem;
  color: rgba(235, 242, 237, .55);
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: rgba(235, 242, 237, .9);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding-top: var(--sp-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: 0.8rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(235, 242, 237, .5);
  transition: all var(--transition);
}

.footer-social a:hover {
  border-color: rgba(201, 145, 58, .6);
  color: var(--gold);
}

.footer-social svg {
  width: 14px;
  height: 14px;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.fade-up:nth-child(1) {
  animation-delay: 0.1s;
}

.fade-up:nth-child(2) {
  animation-delay: 0.22s;
}

.fade-up:nth-child(3) {
  animation-delay: 0.34s;
}

.fade-up:nth-child(4) {
  animation-delay: 0.46s;
}

.fade-up:nth-child(5) {
  animation-delay: 0.58s;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .story-inner {
    grid-template-columns: 1fr;
  }

  .story-sidebar {
    position: static;
  }

  .projects-grid,
  .projects-grid-full {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  :root {
    --sp-2xl: 4rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(253, 244, 231, .97);
    backdrop-filter: blur(10px);
    padding: var(--sp-lg);
    border-bottom: 1px solid var(--border);
    gap: var(--sp-md);
  }

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

  .nav-toggle {
    display: block;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .post-num,
  .post-meta {
    display: none;
  }

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

  .posts-header,
  .projects-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-sm);
  }

  .post-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}