/* Color tokens come from generated assets/theme.css (config/site.json). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(255, 215, 176, 0.55) 0%, transparent 58%),
    radial-gradient(800px 420px at 92% 4%, rgba(235, 200, 160, 0.35) 0%, transparent 50%),
    var(--bg);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent); }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--panel);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 0.75rem;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { width: min(100% - 2rem, var(--wide)); margin: 0 auto; }
.narrow { width: min(100% - 2rem, var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 250, 243, 0.6);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand span { color: var(--accent); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.hero {
  padding: 3.6rem 0 2.8rem;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem 3rem;
  align-items: end;
}
.hero-kicker {
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-ink);
  margin: 0 0 0.85rem;
  text-transform: none;
}
.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.35rem, 5.5vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 11ch;
  text-wrap: balance;
}
.hero .lede {
  font-size: 1.13rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 38ch;
  margin: 0 0 1.5rem;
  line-height: 1.62;
  text-wrap: pretty;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    transform 0.15s ease,
    box-shadow 0.22s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px var(--shadow-accent);
}
.btn-primary:hover {
  background: #d34f00;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px var(--shadow-accent);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost {
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--panel);
}
.btn-ghost:active { transform: scale(0.98); }

.section { padding: 2.75rem 0 3rem; }
.section--start { padding-top: 2.4rem; }
.section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.62rem;
  margin: 0 0 0.55rem;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.section-lead {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 42ch;
}
.section p { margin: 0 0 1rem; max-width: 65ch; }
.section ul { margin: 0 0 1rem; padding-left: 1.15rem; max-width: 65ch; }
.section li { margin: 0.4rem 0; }

.grid-start {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}
.start-link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100%;
  padding: 1.15rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 10px 28px var(--shadow);
  transition:
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}
.start-link:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 14px 34px var(--shadow);
}
.start-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.start-link strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  letter-spacing: -0.015em;
}
.start-link span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: auto;
}
.start-link--featured {
  grid-column: span 12;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 92%, var(--accent) 8%), var(--panel));
}
.start-link--featured strong { font-size: 1.22rem; }
.start-link:not(.start-link--featured) { grid-column: span 4; }

@media (max-width: 900px) {
  .start-link:not(.start-link--featured) { grid-column: span 6; }
}
@media (max-width: 560px) {
  .start-link:not(.start-link--featured) { grid-column: span 12; }
}

/* Legacy alias if any page still uses grid-4 */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.meta-line {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.sources {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.sources h2 { font-size: 1.1rem; }
.note {
  background: var(--bg-deep);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.05rem;
  margin: 1rem 0 1.4rem;
  font-size: 0.95rem;
  max-width: 65ch;
}
.stuck-prompt {
  margin: 1.6rem 0 1.2rem;
  padding: 0.75rem 0 0;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}
.stuck-prompt a { color: var(--accent-ink); }

.site-footer {
  margin-top: 1rem;
  padding: 1.8rem 0 2.6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer a {
  color: var(--muted);
  transition: color 0.2s ease;
}
.site-footer a:hover { color: var(--accent); }

.page-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
  line-height: 1.12;
  text-wrap: balance;
}
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.4rem 0 0.85rem;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--accent); }

.guide-list {
  display: grid;
  gap: 0.65rem;
}
.guide-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 18px var(--shadow);
  transition:
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}
.guide-list a:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateX(2px);
}
.guide-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.guide-list strong {
  font-weight: 600;
  font-size: 0.98rem;
}
.guide-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
  }
  .hero h1 { max-width: none; }
  .hero .lede { max-width: none; }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }
  .nav::-webkit-scrollbar { display: none; }
  .guide-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .guide-list em { text-align: left; }
}

/* Probably Stolen additions */
.todo{display:inline-block;padding:0 .4em;border-radius:4px;background:#3a2a00;color:#ffd166;font-size:.8em;font-weight:600;letter-spacing:.02em}
.start-here{font-size:.9rem;color:var(--muted)}
table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:.95rem}
th,td{border:1px solid var(--line);padding:.45rem .6rem;text-align:left;vertical-align:top}
th{background:var(--bg-deep)}
blockquote{border-left:3px solid var(--accent);margin:1rem 0;padding:.2rem 1rem;color:var(--muted)}
code{background:var(--bg-deep);padding:.1em .35em;border-radius:4px}
