@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Work+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #fffaf0;
  --bg-grid: #f2e6cf;
  --ink: #241f2e;
  --muted: #665c72;

  --paper: #ffffff;
  --paper-soft: #fff4e2;
  --line: #e7d7bd;
  --line-strong: #d8c4a3;

  --accent: #f28b2e;
  --accent-soft: #ffe1ba;
  --accent-deep: #b96212;

  --link: #8a4311;
  --link-hover: #64310d;
  --link-soft: #fff1df;

  --radius: 16px;
  --shadow: 0 8px 0 rgb(36 31 46 / 7%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Work Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 63px,
      var(--bg-grid) 63px,
      var(--bg-grid) 64px
    );
  overflow-wrap: break-word;
}

header,
main,
footer {
  width: min(940px, calc(100% - 2rem));
  margin: 0 auto;
}

header {
  margin-top: 1rem;
  padding: 0.8rem 1.2rem 0.95rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0;
  line-height: 1.15;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  order: -1;
}

h2,
h3 {
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.tagline {
  margin: 0.3rem 0 0;
  color: var(--muted);
  max-width: 55ch;
}

nav {
  order: -2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.28rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav a {
  color: inherit;
  text-decoration: none;
  position: relative;
}

nav a + a::before {
  content: "•";
  color: var(--line-strong);
  position: relative;
  left: -0.33rem;
  margin-right: 0.12rem;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.22rem;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 160ms ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
}

nav a:hover::after,
nav a:focus-visible::after {
  background: var(--accent-soft);
}

main {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

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

.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.hero {
  border-color: #f0c896;
  background: linear-gradient(180deg, var(--paper-soft), #fff7ea 40%, #fffdf7);
  padding: 1.15rem 1.25rem;
}

.feature-card {
  border-color: #efc88f;
  background: linear-gradient(180deg, #fffdf7, #fff6e9);
}

.info-card {
  background: linear-gradient(180deg, #ffffff, #fffdfa);
}

.ideas-card {
  background: linear-gradient(180deg, #ffffff, #fffcf4);
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-link {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #efc88f;
  border-radius: 999px;
  background: var(--link-soft);
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.feature-link:hover,
.feature-link:focus-visible {
  background: #ffe8cc;
}

.card h2,
.card h3 {
  position: relative;
}

.card h2::after,
.card h3::after {
  content: "";
  display: block;
  width: 58px;
  height: 4px;
  border-radius: 4px;
  margin-top: 0.45rem;
  background: var(--accent-soft);
}

a {
  color: var(--link);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

p {
  margin: 0.42rem 0;
}

ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.22rem;
}

/* Archive page */
.archive-intro {
  padding: 0.9rem 1.05rem;
  background: linear-gradient(180deg, #fffdf8, #fff8ed);
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.archive-list li {
  margin: 0;
  border-top: 1px dashed var(--line);
}

.archive-list li:first-child {
  border-top: 0;
}

.archive-list a {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.archive-list a:hover,
.archive-list a:focus-visible {
  background: #fff5e4;
}

.archive-date {
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.archive-title {
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
}

.archive-summary {
  color: var(--muted);
  font-size: 0.96rem;
}

.compact-archive-list {
  margin-top: 0.7rem;
}

.compact-archive-list .archive-title {
  font-size: 1.08rem;
}

.compact-archive-list .archive-summary {
  font-size: 0.93rem;
}

.plain-post-list {
  list-style: none;
  padding: 0;
  margin: 0.7rem 0 0;
}

.plain-post-list li {
  margin: 0;
  border-top: 1px dashed var(--line);
}

.plain-post-list li:first-child {
  border-top: 0;
}

.plain-post-list a {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0;
  text-decoration: none;
}

.plain-post-list a:hover,
.plain-post-list a:focus-visible {
  background: transparent;
}

/* Post page readability */
.post {
  max-width: 74ch;
  padding: 1.15rem 1.3rem;
  background: #fffdf8;
}

.post-hero-image {
  display: block;
  width: calc(100% + 2.6rem);
  max-width: none;
  margin: -1.15rem -1.3rem 1rem;
  border-bottom: 1px solid var(--line);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.post-meta {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-lead {
  margin-top: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #332d3d;
}

.post h2 {
  margin-top: 1.5rem;
  font-size: clamp(1.25rem, 2.3vw, 1.55rem);
}

.post ul {
  margin-top: 0.65rem;
  padding-left: 1.35rem;
}

.post li + li {
  margin-top: 0.38rem;
}

.post p + p {
  margin-top: 0.58rem;
}

.post blockquote {
  margin: 1rem 0 1.1rem;
  padding: 0.85rem 1rem 0.9rem 1.15rem;
  color: #3a3145;
  background: linear-gradient(90deg, var(--accent-soft), #fff8ee);
  border-left: 5px solid var(--accent);
  border-radius: 0 14px 14px 0;
  box-shadow: 0 4px 0 rgb(36 31 46 / 5%);
}

.post blockquote p {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.03rem;
  line-height: 1.62;
}

.note {
  margin: 1rem 0 0.4rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid #efd5af;
  border-radius: 12px;
  background: #fff5e8;
}

.note p {
  margin: 0;
}

code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  border: 1px solid var(--line);
  background: #fff5e5;
  border-radius: 6px;
  padding: 0.08rem 0.33rem;
}

pre {
  margin: 0.9rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff7eb;
  overflow-x: auto;
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  line-height: 1.6;
}

/* Post template system */
.template-index {
  display: grid;
  gap: 1rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.template-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(180deg, #ffffff, #fffaf1);
}

.template-card p {
  color: var(--muted);
}

.template-card .feature-link {
  margin-top: auto;
  align-self: flex-start;
}

.template-code {
  font-size: 0.86rem;
}

.post-kicker {
  margin: 0 0 0.15rem;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-dek {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.post-body-rule {
  margin: 1rem 0;
  border: 0;
  border-top: 1px dashed var(--line-strong);
}

.pullquote {
  margin: 1rem 0;
  padding: 0.15rem 0 0.2rem 1rem;
  border-left: 5px solid var(--accent);
  color: #30273a;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.18rem, 2.6vw, 1.55rem);
  line-height: 1.28;
}

.post-signoff,
.related-card {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #efd5af;
  border-radius: 12px;
  background: #fff7eb;
}

.post-signoff p,
.related-card p {
  margin: 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
}

.post-template-note {
  max-width: 62ch;
}

.post-template-note h1 {
  font-size: clamp(1.65rem, 4vw, 2.05rem);
}

.post-template-note .post-lead {
  font-size: 1.04rem;
}

@media (max-width: 760px) {
  .template-grid {
    grid-template-columns: 1fr;
  }

  .post-nav {
    flex-direction: column;
  }
}

footer {
  margin: 1rem auto 2rem;
  padding: 0.6rem 0.2rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  body {
    line-height: 1.58;
    background: var(--bg);
  }

  header,
  main,
  footer {
    width: calc(100% - 0.9rem);
  }

  header {
    margin-top: 0.45rem;
    padding: 0.72rem 0.9rem 0.82rem;
    gap: 0.15rem;
  }

  h1 {
    font-size: clamp(1.65rem, 9vw, 2.05rem);
  }

  .tagline {
    margin-top: 0.22rem;
    font-size: 0.98rem;
  }

  nav {
    gap: 0.55rem;
    margin-bottom: 0.08rem;
    font-size: 0.76rem;
    letter-spacing: 0.07em;
  }

  main {
    gap: 0.8rem;
  }

  .card,
  .hero,
  .post {
    padding: 0.95rem 0.95rem;
  }

  .feature-link {
    width: 100%;
    text-align: center;
  }

  .archive-list a {
    padding: 0.85rem 0.9rem;
  }

  .archive-title {
    font-size: 1.1rem;
  }

  .post {
    max-width: none;
  }

  .post-hero-image {
    width: calc(100% + 1.9rem);
    margin: -0.95rem -0.95rem 0.9rem;
  }

  .post-lead {
    font-size: 1.02rem;
  }

  .post h2 {
    margin-top: 1.25rem;
    font-size: 1.22rem;
  }

  .note {
    padding: 0.75rem 0.85rem;
  }

  footer {
    margin-top: 0.8rem;
    padding-top: 0.4rem;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  header,
  main,
  footer {
    width: min(860px, calc(100% - 1.4rem));
  }

  .card,
  .hero,
  .post {
    padding-inline: 1.05rem;
  }
}
