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

:root {
  --bg: #e8e5df;
  --surface: #dedad2;
  --border: #c8c3b8;
  --text: #4a4d5c;
  --heading: #1e2030;
  --accent: #7278b0;
  --muted: #8a8d9e;
  --green: #5a6e58;
}

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Code', 'Menlo', 'Courier New', monospace;
  font-weight: 500;
  line-height: 1.75;
  min-height: 100vh;
  padding: 3rem 1.5rem;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 175px 1fr;
  grid-template-areas: "header main" "header footer";
  gap: 0 3.5rem;
  align-items: start;
}

header {
  grid-area: header;
  position: sticky;
  top: 3rem;
  padding-right: 1.5rem;
  border-right: 1px solid var(--border);
}

.logo {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.logo span {
  color: var(--accent);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: var(--heading);
  background: var(--surface);
}

nav a.active {
  color: var(--accent);
}

nav .sep {
  display: none;
}

main { grid-area: main; }

h1 {
  font-size: 1.4rem;
  color: var(--heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.joke {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0 3px 3px 0;
}

.joke p {
  font-size: 0.95rem;
  color: var(--text);
}

.joke p + p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.joke .punchline {
  color: var(--green);
  font-size: 0.93rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.joke a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}

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

footer {
  grid-area: footer;
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  .wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main" "footer";
    gap: 0;
  }

  header {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
  }

  nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  nav .sep {
    display: inline;
  }
}
