/* =====================================================================
   WriteSmart.so — Notepad theme
   Lined paper, red margin rule, logo top-left, handwritten accents.
   ===================================================================== */
:root {
  --paper:        #fdfbf4;   /* warm paper */
  --paper-line:   #cfe0f3;   /* faint blue ruling */
  --paper-margin: #f2a9a0;   /* red margin rule */
  --ink:          #2b2b33;   /* pen ink */
  --ink-soft:     #5b5d6b;
  --muted:        #8b8d99;
  --accent:       #d6453d;   /* red-pen accent */
  --accent2:      #2f7df6;   /* blue-pen accent */
  --line-h:       30px;      /* ruling height — drives the lined paper */
  --margin-x:     64px;      /* left margin rule position */
  --max:          1000px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  line-height: var(--line-h);
  /* the notepad: horizontal rules + a red vertical margin rule */
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-margin) 0 0),                 /* red margin */
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line-h) - 1px),
      var(--paper-line) calc(var(--line-h) - 1px),
      var(--paper-line) var(--line-h)
    );
  background-size:
    2px 100%,            /* margin rule width */
    100% 100%;           /* ruling */
  background-position:
    var(--margin-x) 0,   /* margin rule x position */
    0 0;
  background-repeat: no-repeat, repeat;
  background-attachment: fixed, fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.15; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }

/* ---------- Nav (logo top-left) ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 20px 28px 20px calc(var(--margin-x) + 18px);
}
.brand {
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.02em; color: var(--ink) !important; text-decoration: none;
}
.brand::before { content: "✎ "; color: var(--accent); }
.brand span { color: var(--accent); }
.nav-menu { display: flex; gap: 24px; align-items: center; }
.nav-menu a { color: var(--ink-soft); font-size: .95rem; }
.nav-menu a:hover { color: var(--ink); }

/* hamburger (hidden on desktop) */
.hamburger { display: none; cursor: pointer; padding: 6px; }
.hamburger span {
  display: block; width: 26px; height: 3px; margin: 5px 0;
  background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s;
}
.btn-ghost {
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 7px 15px;
  color: var(--ink) !important; text-decoration: none !important;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn-ghost:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }

/* page content sits to the right of the red margin */
.hero, .section, .footer { padding-left: calc(var(--margin-x) + 18px); }
.hero-inner, .section > *, .section-head, .grid, .listicle,
.quote-grid, .footer-cols { padding-right: 28px; }

/* ---------- Breadcrumbs ---------- */
.crumbs {
  max-width: var(--max); margin: 0 auto; font-size: .85rem; color: var(--muted);
  padding: 14px 28px 0 calc(var(--margin-x) + 18px);
}
.crumbs a { color: var(--ink-soft); }
.crumbs span:last-child { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: 56px; padding-bottom: 30px; }
.hero-sm { padding-top: 40px; padding-bottom: 10px; }
.hero-inner { max-width: 760px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.eyebrow a { color: var(--accent); }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); letter-spacing: -.03em; }
.grad {
  color: var(--accent);
  text-decoration: underline wavy var(--accent2);
  text-underline-offset: 8px; text-decoration-thickness: 2px;
}
.lead { color: var(--ink-soft); font-size: 1.15rem; max-width: 620px; margin-top: 18px; }
.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

/* hand-drawn buttons */
.btn, .btn-secondary {
  display: inline-block; padding: 11px 24px; border-radius: 6px;
  font-weight: 600; font-size: .98rem; border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn { background: var(--accent); color: #fff !important; text-decoration: none !important; }
.btn-secondary { background: var(--paper); color: var(--ink) !important; text-decoration: none !important; }
.btn:hover, .btn-secondary:hover {
  transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); text-decoration: none !important;
}

/* ---------- Sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding-top: 46px; padding-bottom: 46px; }
.section.alt { background: rgba(47,125,246,.05); border-top: 1px dashed var(--paper-margin);
               border-bottom: 1px dashed var(--paper-margin); }
.section-head { max-width: 640px; margin: 0 auto 34px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.02em; }
.section-head p { color: var(--ink-soft); margin-top: 10px; font-size: 1.05rem; }

/* ---------- Hub article ---------- */
.hub-article { max-width: 760px; }
.hub-article h2 { font-size: 1.9rem; margin: 26px 0 10px; }
.hub-article h2:first-child { margin-top: 0; }
.hub-article p { color: var(--ink-soft); margin-bottom: 14px; }
.hub-article a { color: var(--accent2); font-weight: 600; }

.authority {
  margin-top: 26px; padding: 22px 26px; background: #fffef9;
  border: 2px solid var(--ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--ink);
}
.authority h3 { font-size: 1.15rem; margin-bottom: 12px; }
.authority h3::before { content: "📌 "; }
.authority-list { list-style: none; display: grid; gap: 12px; }
.authority-list li { display: flex; flex-direction: column; }
.authority-list li a { font-weight: 600; color: var(--accent2); }
.authority-list li span { color: var(--muted); font-size: .92rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card {
  background: #fffef9; border: 2px solid var(--ink); border-radius: 8px;
  padding: 26px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s, box-shadow .14s;
}
.card:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.card-icon { font-size: 2rem; margin-bottom: 8px; }
.card h3 { font-size: 1.28rem; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: .97rem; }
.guide-card { text-decoration: none !important; color: var(--ink) !important; display: block; }
.kicker {
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem;
  font-weight: 700; color: var(--accent); margin-bottom: 2px;
}
.read-more { display: inline-block; margin-top: 12px; color: var(--accent2); font-weight: 600; }

/* ---------- Listicle ---------- */
.list-wrap { max-width: 780px; }
.listicle { list-style: none; display: grid; gap: 16px; }
.list-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: #fffef9; border: 2px solid var(--ink); border-radius: 8px;
  padding: 20px 24px; box-shadow: 3px 3px 0 var(--ink);
}
.list-n {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-family: 'Fraunces', serif;
  font-weight: 600; font-size: 1.15rem; background: var(--accent); color: #fff;
  border: 2px solid var(--ink);
}
.list-body h3 { font-size: 1.2rem; margin-bottom: 4px; }
.list-body h3 a { color: var(--ink); }
.list-body p { color: var(--ink-soft); font-size: .97rem; }
.badge {
  display: inline-block; margin-left: 8px; font-family: 'Inter', sans-serif;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent2); color: #fff; padding: 2px 8px; border-radius: 999px;
  vertical-align: middle;
}
.center-link { text-align: center; margin-top: 30px; }

/* ---------- Quotes ---------- */
.quote-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
blockquote {
  background: #fffef9; border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 22px 24px; box-shadow: 3px 3px 0 rgba(43,43,51,.15);
}
blockquote p { font-family: 'Fraunces', serif; font-style: italic; font-size: 1.08rem; line-height: 1.45; }
blockquote cite { display: block; margin-top: 12px; color: var(--muted); font-style: normal; font-size: .88rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item {
  background: #fffef9; border: 2px solid var(--ink); border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink); padding: 4px 22px;
}
.faq-item summary {
  cursor: pointer; list-style: none; font-family: 'Fraunces', serif; font-weight: 600;
  font-size: 1.12rem; padding: 16px 0; display: flex; justify-content: space-between;
  align-items: center; gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--ink-soft); padding: 0 0 18px; font-size: .98rem; }

/* ---------- Footer ---------- */
.footer { border-top: 2px solid var(--ink); margin-top: 30px; padding-top: 40px; padding-bottom: 40px; }
.footer-cols { max-width: var(--max); margin: 0 auto; display: grid; gap: 26px;
               grid-template-columns: 1.4fr 1fr 1fr; }
.footer-cols h4 { font-size: .95rem; margin-bottom: 8px; }
.footer-cols a { display: block; color: var(--ink-soft); font-size: .92rem; margin-bottom: 4px; }
.footer-cols a:hover { color: var(--ink); }
.footer .muted { color: var(--muted); }
.footer .small { max-width: var(--max); margin: 26px auto 0; font-size: .82rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav { position: relative; flex-wrap: wrap; padding-right: 20px; }
  .hamburger { display: block; }

  /* collapsed menu — slides open when the checkbox is checked */
  .nav-menu {
    flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-menu a {
    padding: 12px 4px; border-bottom: 1px dashed var(--paper-line); font-size: 1.05rem;
  }
  .nav-menu a:last-child { border-bottom: none; }
  .btn-ghost { box-shadow: none; border: none; padding: 12px 4px; }
  .nav-toggle:checked ~ .nav-menu { max-height: 420px; margin-top: 12px; }

  /* animate icon into an X */
  .nav-toggle:checked ~ .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 640px) {
  :root { --margin-x: 30px; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .section { padding-top: 36px; padding-bottom: 36px; }
  .list-item { padding: 16px 18px; gap: 14px; }
  .footer-cols { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .cta-row { flex-direction: column; }
  .cta-row .btn, .cta-row .btn-secondary { text-align: center; }
}
