/* The AI Field Guide — porres.com/aifieldguide
 * Visual identity inherits porres.com (Fraunces + Inter, restrained, off-white).
 * The Field Guide palette (warm brown, teal, burnt orange, cream) carries through
 * the headline image and accent strokes; the cards themselves carry their own color.
 */

:root {
  --text:        #0a0a0a;
  --muted:       #6b6b6b;
  --line:        #e5e0d4;
  --bg:          #fafaf8;
  --paper:       #fffdf6;
  --link:        #0a0a0a;
  --link-hover:  #0066cc;

  /* Field Guide palette */
  --warm-brown:  #6b4226;
  --teal:        #2a9d8f;
  --orange:      #e76f51;
  --cream:       #fefae0;

  --max-width:   980px;
  --prose-width: 640px;
  --radius:      10px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

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

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

/* ---------- Header ---------- */

.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header .brand {
  font-family: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--warm-brown);
  text-decoration: none;
}

.site-header .back-link,
.site-header .crumbs {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header .back-link:hover,
.site-header .crumbs a:hover {
  color: var(--link-hover);
}

.site-header .crumbs a {
  color: var(--muted);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  padding: 3.5rem 0 2rem;
}

.hero h1 {
  font-family: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 0.4rem;
  color: var(--warm-brown);
}

.hero .subtitle {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--text);
  margin: 0 0 1.25rem;
  letter-spacing: -0.005em;
}

.hero .meta {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1.5rem 0 0;
  background: var(--cream);
}

/* ---------- Intro prose ---------- */

.intro {
  padding: 2rem 0 1rem;
}

.intro p {
  max-width: var(--prose-width);
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.intro p + p { margin-top: 1.1rem; }

.intro a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.intro a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* ---------- Section heading ---------- */

.section-head {
  margin: 3rem 0 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.section-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "opsz" 36;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: var(--warm-brown);
  margin: 0;
}

.section-head .section-meta {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Tile grid (the five-tile "See the journey") ---------- */

.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 1rem;
}

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 980px) {
  .tiles { grid-template-columns: repeat(5, 1fr); }
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem 1.35rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 100%;
}

.tile:hover {
  border-color: var(--warm-brown);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(107, 66, 38, 0.07);
}

.tile .tile-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.tile .tile-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "opsz" 36;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--warm-brown);
  margin: 0 0 0.55rem;
}

.tile .tile-blurb {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.45;
  flex-grow: 1;
}

.tile .tile-arrow {
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-top: auto;
}

.tile.tile-pdf {
  background: var(--cream);
  border-color: var(--warm-brown);
}

.tile.tile-pdf .tile-eyebrow { color: var(--warm-brown); }
.tile.tile-pdf .tile-title { color: var(--warm-brown); }
.tile.tile-pdf .tile-arrow { color: var(--warm-brown); font-weight: 600; }

/* ---------- 15-card grid (thumbnails on landing) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
}

@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .card-grid { grid-template-columns: repeat(5, 1fr); } }

.card-thumb {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.6rem 0.65rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card-thumb:hover {
  border-color: var(--warm-brown);
  transform: translateY(-1px);
}

.card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--cream);
}

.card-thumb-meta {
  margin: 0.55rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
}

.card-thumb-meta strong {
  color: var(--warm-brown);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.card-thumb-meta .ct-title {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  text-align: right;
  line-height: 1.2;
}

/* ---------- Card detail page ---------- */

.card-page {
  padding: 2.5rem 0 3rem;
}

.card-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.card-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--warm-brown);
  margin: 0 0 1.5rem;
}

.card-figure {
  margin: 0 0 1.5rem;
  padding: 0;
  text-align: center;
}

.card-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--cream);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.62rem 1.05rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  letter-spacing: 0.005em;
}

.btn-primary {
  background: var(--warm-brown);
  color: var(--cream);
  border: 1px solid var(--warm-brown);
}
.btn-primary:hover {
  background: #57361d;
  border-color: #57361d;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid #cfc8b8;
}
.btn-secondary:hover {
  border-color: var(--warm-brown);
  color: var(--warm-brown);
  transform: translateY(-1px);
}

/* ---------- Card prev/next nav ---------- */

.card-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.card-nav a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.2s ease, transform 0.2s ease;
  font-size: 0.88rem;
}

.card-nav a:hover {
  border-color: var(--warm-brown);
  transform: translateY(-1px);
}

.card-nav-prev { text-align: left; }
.card-nav-next { text-align: right; align-items: flex-end; }

.card-nav-grid {
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-nav-label {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-brown);
  margin-bottom: 0.15rem;
}

.card-nav-title {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.2;
}

@media (max-width: 620px) {
  .card-nav {
    grid-template-columns: 1fr 1fr;
  }
  .card-nav-grid {
    grid-column: 1 / -1;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .tile, .card-thumb, .card-nav a, .btn {
    transition: none !important;
    transform: none !important;
  }
}

/* ---------- Small viewports ---------- */

@media (max-width: 480px) {
  .hero { padding-top: 2rem; }
  .hero h1 { font-size: 2.4rem; }
  .section-head h2 { font-size: 1.3rem; }
}
