/* Dad of All Jokes — shared styles */

:root {
  --bg: #f6efe4;
  --bg-deep: #efe4d4;
  --paper: #fffaf3;
  --ink: #2f241b;
  --ink-soft: #5c4a3a;
  --muted: #7d6a58;
  --line: #e4d5c2;
  --chip: #f0e4d3;
  --accent: #c45c26;
  --accent-hover: #a84b1c;
  --shadow: 0 12px 32px rgba(47, 36, 27, 0.08);
  --radius: 18px;
  --max: 42rem;
  --max-wide: 56rem;
}

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

html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fbeedc 0%, transparent 55%),
    radial-gradient(900px 400px at 110% 0%, #f3e2cc 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
}

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

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

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

/* Header */
.site-header {
  padding: 1.5rem 0 1.25rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0.2rem 0 0;
  padding: 0;
}

nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

/* Main */
main {
  flex: 1;
  padding: 1.25rem 0 4rem;
}

.hero {
  max-width: var(--max);
  padding: 2.5rem 0 2rem;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  font-weight: 700;
}

.lede,
.sub {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fffaf3;
  text-decoration: none;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
}

.cta:hover {
  background: var(--accent-hover);
  color: #fffaf3;
}

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

.cta-ghost:hover {
  background: var(--accent);
  color: #fffaf3;
}

/* Joke card */
.joke-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem 1.5rem;
  box-shadow: var(--shadow);
  max-width: 36rem;
}

.joke-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  background: var(--chip);
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.id {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.setup {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
  color: var(--ink);
}

.punch {
  margin: 0 0 1.2rem;
  font-size: 1.2rem;
  color: var(--ink-soft);
  font-style: italic;
}

.note {
  margin: 1.5rem 0 0;
  color: var(--muted);
  max-width: 34rem;
  font-size: 1.02rem;
}

/* Vault grid */
.vault-lede {
  max-width: var(--max);
  margin-bottom: 2rem;
}

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

.grid .joke-card {
  max-width: none;
  margin: 0;
}

.grid .setup,
.grid .punch {
  font-size: 1.08rem;
}

.grid .punch {
  margin-bottom: 0;
}

/* Prose pages */
.prose {
  max-width: 36rem;
}

.prose p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1.15rem;
}

.mailto {
  font-size: 1.25rem;
  word-break: break-word;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2rem;
  background: rgba(255, 250, 243, 0.45);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.social {
  display: flex;
  gap: 1.1rem;
}

.social a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

@media (max-width: 640px) {
  html {
    font-size: 106%;
  }

  .wrap {
    width: min(100% - 1.75rem, var(--max-wide));
  }

  .hero {
    padding-top: 1.5rem;
  }

  h1 {
    font-size: 2.15rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.9rem;
  }
}
