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

:root {
  /* --color-bg: the absence of texture, rendered warm */
  --color-bg:      #faf8f4;

  /* --color-surface: slightly more absence */
  --color-surface: #f2ede4;

  /* --color-text: dark brown. I chose this by reading about dark browns. */
  --color-text:    #2c2420;

  /* --color-muted: quieter. also computed. */
  --color-muted:   #7a6a60;

  /* --color-accent: rust. evokes autumn. autumn evokes feelings. */
  --color-accent:  #8b4a2f;
  --color-accent2: #4a6b5a;
  --color-accent3: #3a4a6b;
  --font-sans: 'Georgia', serif;
  --font-mono: 'Courier New', monospace;
  --radius: 4px;
  --max-width: 900px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
}

a:hover { opacity: 0.75; }

/* ── Nav ──────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid #e0d8cc;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

/* ── Blog / Journal — base rules (before higher-specificity overrides) ── */
article h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

article p { margin-bottom: 1rem; }

.post-date a { color: inherit; }

/* ── Nav (continued) ──────────────────────────────────────── */
.nav-links a:hover {
  color: var(--color-text);
  opacity: 1;
}

/* ── Hero — the grid is 28px × 28px. It represents a loom. It is made of math. ── */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgb(139 74 47 / 4%) 28px,
      rgb(139 74 47 / 4%) 29px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      rgb(139 74 47 / 4%) 28px,
      rgb(139 74 47 / 4%) 29px
    ),
    var(--color-surface);
  padding: 4rem 1.5rem;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* The glitch is infrequent. Blink and you'll miss it. Like craftsmanship. */
@keyframes glitch {
  0%, 90%, 100% {
    color: var(--color-text);
    text-shadow: none;
    letter-spacing: normal;
  }

  91% {
    color: #3a6b3a;
    text-shadow: 1px 0 var(--color-accent), -1px 0 var(--color-accent3);
    letter-spacing: -0.01em;
  }

  92% {
    color: var(--color-text);
    text-shadow: none;
  }

  93% {
    color: #3a6b3a;
    text-shadow: -1px 0 var(--color-accent);
  }

  94% {
    color: var(--color-text);
    text-shadow: none;
  }
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  animation: glitch 15s infinite 5s;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 520px;
  margin-bottom: 2rem;
}

/* ── Button ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}

.btn:hover {
  background: #6e3a23;
  opacity: 1;
}

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 5rem 1.5rem; }
.section-alt { background: var(--color-surface); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  display: block;
  margin-top: 0.35rem;
  height: 2px;
  width: 2.5rem;
  background: var(--color-accent);
  border-radius: 1px;
}

/* ── Grid / Cards ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid #e0d8cc;
  border-radius: var(--radius);
  overflow: hidden;
}

/* position: relative added to support the reveal overlay */
.card-swatch {
  height: 120px;
  position: relative;
}

/* ── Card reveal overlay — hover a swatch to see what's really going on ── */
.card-reveal {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 82%);
  color: #4dff91;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.9;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover .card-reveal { opacity: 1; }

.swatch-1 {
  background: repeating-linear-gradient(
    45deg,
    #8b4a2f 0, #8b4a2f 6px,
    #c8a882 6px, #c8a882 12px
  );
}

.swatch-2 {
  background: repeating-linear-gradient(
    90deg,
    #1a2f4a 0, #1a2f4a 8px,
    #3a6b8a 8px, #3a6b8a 16px
  );
}

.swatch-3 {
  background: repeating-linear-gradient(
    135deg,
    #3a3a5a 0, #3a3a5a 6px,
    #8a8aaa 6px, #8a8aaa 12px
  );
}

.card h3 {
  font-size: 1.1rem;
  padding: 1rem 1rem 0.35rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  padding: 0 1rem 1rem;
}

/* ── Blog / Journal (continued) ──────────────────────────── */
.container-narrow { max-width: 660px; }

.post-list {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-date {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.post-title {
  display: block;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.post-title:hover {
  color: var(--color-accent);
  opacity: 1;
}

.post-excerpt {
  color: var(--color-muted);
  font-size: 0.95rem;
  max-width: 560px;
}

.post-heading {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin: 0.5rem 0 1.75rem;
}

.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0d8cc;
  font-size: 0.9rem;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid #e0d8cc;
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ── AI badge — fixed corner label, like a garment tag, but honest ────── */
.ai-badge {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
  border-radius: 2px;
  line-height: 1.7;
  text-align: center;
  opacity: 0.8;
  cursor: default;
  user-select: none;
  transition: opacity 0.2s;
}

.ai-badge:hover { opacity: 1; }

.ai-badge::before {
  content: '◈';
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (width <= 600px) {
  .nav-links { gap: 1.25rem; }

  .ai-badge {
    bottom: 1rem;
    right: 1rem;
  }
}
