/* Just Teach Me AI — site styles. No framework, no JS. */

:root {
  --bg: #faf7f2;
  --bg-elev: #ffffff;
  --bg-soft: #f1ece3;
  --text: #1d2229;
  --text-muted: #5b6470;
  --line: #e3dccf;
  --accent: #1f6f78;
  --accent-strong: #165259;
  --accent-soft: #dfeef0;
  --warm: #f4b860;
  --warm-soft: #fbeed6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 24px -12px rgba(20, 24, 31, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181f;
    --bg-elev: #1c2129;
    --bg-soft: #1a1f27;
    --text: #e8e6e1;
    --text-muted: #a3a9b3;
    --line: #2b323c;
    --accent: #6fc3cc;
    --accent-strong: #9adbe2;
    --accent-soft: #1d3338;
    --warm: #f4b860;
    --warm-soft: #3a3020;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a:hover {
  color: var(--accent-strong);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1.1em;
}

.muted {
  color: var(--text-muted);
}

.wrap {
  width: min(1080px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(720px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 3px solid var(--bg);
}

.brand-name em {
  font-style: normal;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--warm);
}

/* ---------- hero ---------- */

.hero {
  background:
    radial-gradient(60% 80% at 100% 0%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(40% 60% at 0% 100%, var(--warm-soft) 0%, transparent 60%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4.5rem);
  max-width: 800px;
}

.hero h1 .accent {
  color: var(--accent);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.eyebrow a:hover {
  color: var(--accent);
}

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .btn {
    color: #0f1417;
  }
  .btn:hover {
    color: #0f1417;
  }
  .btn-ghost,
  .btn-ghost:hover {
    color: var(--text);
  }
}

/* ---------- intro ---------- */

.intro {
  padding: clamp(2.5rem, 5vw, 4rem) 0 1rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.intro-grid h2 {
  font-size: 1.25rem;
  margin-bottom: 0.4em;
}

.intro-grid p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---------- article groups ---------- */

.group {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.group + .group {
  border-top: 1px solid var(--line);
}

.group-head {
  margin-bottom: 1.25rem;
}

.group-head h2 {
  margin-bottom: 0.2em;
}

.group-head p {
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text);
}

.card-num {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--warm);
  font-weight: 600;
  flex: none;
  width: 2ch;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.3;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card-meta {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.35rem;
}

/* ---------- cta ---------- */

.cta {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ---------- page head ---------- */

.page-head {
  padding: clamp(2.5rem, 5vw, 4rem) 0 1rem;
}

/* ---------- article ---------- */

.article {
  padding: clamp(2.5rem, 5vw, 4rem) 0 3rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.article-header .lede {
  margin-bottom: 0;
}

.prose {
  font-size: 1.08rem;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: 1.55rem;
}

.prose h3 {
  margin-top: 1.8em;
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: 1.2em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li > p {
  margin-bottom: 0.4em;
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--warm);
  background: var(--warm-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

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

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.prose pre {
  overflow-x: auto;
  background: var(--bg-soft);
  padding: 1rem;
  border-radius: var(--radius);
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  background: var(--bg-soft);
  font-weight: 700;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

/* ---------- pager ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  text-decoration: none;
  color: var(--text);
}

.pager-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pager-link.next {
  text-align: right;
  grid-column: 2;
}

.pager-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.pager-title {
  font-weight: 700;
}

@media (max-width: 560px) {
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-link.next {
    grid-column: auto;
    text-align: left;
  }
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  font-size: 0.95rem;
  background: var(--bg-soft);
}

.site-footer p {
  margin-bottom: 0.5em;
  max-width: 70ch;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .site-nav {
    gap: 0.9rem;
    font-size: 0.9rem;
  }
  .brand-name {
    font-size: 0.95rem;
  }
}
