/* ============================================================
   ScarfCrochetPatterns.com — design system
   Warm craft palette: cream / terracotta / mustard / sage
   Zero external fonts, zero frameworks — instant static HTML.
   ============================================================ */

:root {
  --bg: #FFF9F0;
  --bg-soft: #FDF0DC;
  --bg-stitch: rgba(226, 96, 63, 0.055);
  --card: #FFFFFF;
  --ink: #33261F;
  --ink-soft: #6E5847;
  --line: rgba(51, 38, 31, 0.12);
  --brand: #E2603F;
  --brand-dark: #C74A28;
  --brand-soft: rgba(226, 96, 63, 0.1);
  --accent: #F2A93B;
  --accent-deep: #DE8F1C;
  --sage: #7A9B6D;
  --dark: #2A1B10;
  --dark-2: #37261a;
  --cream: #FBF3E4;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 5px 20px rgba(51, 38, 31, 0.09);
  --shadow-lg: 0 16px 40px rgba(51, 38, 31, 0.14);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
  --header-h: 68px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main { flex: 1 0 auto; width: 100%; }

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

a { color: var(--brand-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 249, 240, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.1;
}
.brand:hover { color: var(--ink); }
.brand .brand-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.brand .brand-top { display: block; }
.brand .brand-sub { display: block; color: var(--brand); font-size: 1.22rem; }
.brand .brand-dot { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover { color: var(--brand-dark); background: var(--brand-soft); }
.nav-cta {
  background: var(--brand);
  color: #fff !important;
  padding: 0.55rem 1.15rem;
  box-shadow: 0 4px 12px rgba(226, 96, 63, 0.35);
}
.nav-cta:hover { background: var(--brand-dark); }

@media (max-width: 760px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='26' viewBox='0 0 44 26'%3E%3Cg fill='none' stroke='%23E2603F' stroke-opacity='0.10' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 4 L12 18 L20 4'/%3E%3Cpath d='M24 4 L32 18 L40 4'/%3E%3C/g%3E%3C/svg%3E") repeat-x top / 44px 26px,
    radial-gradient(720px 340px at 12% -8%, rgba(242, 169, 59, 0.18), transparent 65%),
    radial-gradient(640px 360px at 96% 4%, rgba(226, 96, 63, 0.12), transparent 62%),
    var(--bg);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.75rem, 7vw, 5rem);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid rgba(226, 96, 63, 0.25);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 1rem 0 1.1rem;
}
.hero h1 .hl { color: var(--brand); }
.hero .lede {
  font-size: clamp(1.02rem, 2vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.7rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(226, 96, 63, 0.4);
}
.btn-primary:hover { color: #fff; box-shadow: 0 12px 26px rgba(226, 96, 63, 0.5); }
.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 2px solid rgba(226, 96, 63, 0.35);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn svg { flex: none; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.stat-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
  box-shadow: 0 2px 8px rgba(51, 38, 31, 0.06);
}
.stat-chip strong { color: var(--brand-dark); }

.hero-visual { position: relative; }
.hero-visual img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.4deg);
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px dashed rgba(226, 96, 63, 0.35);
  border-radius: var(--radius);
  transform: rotate(-2.2deg) translate(-8px, 8px);
  z-index: -1;
}
.hero-badge {
  position: absolute;
  top: -14px;
  right: -6px;
  background: var(--accent);
  color: #4A2E08;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(222, 143, 28, 0.45);
  transform: rotate(3deg);
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.6rem, 6vw, 4.2rem); }
.section-head { max-width: 46rem; margin: 0 auto 2.2rem; text-align: center; }
.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1.18;
  margin: 0.7rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.section-head .eyebrow { background: var(--cream); color: #8A5A22; border-color: rgba(242, 169, 59, 0.4); }
.section-head p { color: var(--ink-soft); margin: 0; }

.section-alt { background: var(--bg-soft); }
[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

/* ---------- Cards grid ---------- */
.category { margin-bottom: 2.9rem; }
.category:last-child { margin-bottom: 0; }
.category-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px dashed rgba(226, 96, 63, 0.3);
}
.category-head h3 {
  font-family: var(--font-head);
  font-size: 1.42rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.count-chip {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
}

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

.pattern-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, box-shadow 0.22s;
}
.pattern-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.pattern-card figure { margin: 0; background: var(--cream); }
.pattern-card figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.card-body { padding: 0.95rem 1rem 1.05rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.card-body h4 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  font-family: var(--font-head);
  letter-spacing: -0.005em;
}
.btn-download {
  margin-top: auto;
  width: 100%;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 12px rgba(226, 96, 63, 0.28);
}
.btn-download:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(226, 96, 63, 0.42); }

/* ---------- Video section ---------- */
.video-section {
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(242, 169, 59, 0.14), transparent 60%),
    var(--dark);
  color: var(--cream);
}
.video-section .section-head h2 { color: #fff; }
.video-section .section-head p { color: rgba(251, 243, 228, 0.78); }
.video-section .section-head .eyebrow {
  background: var(--accent);
  color: var(--dark);
  border-color: rgba(251, 243, 228, 0.35);
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(222, 143, 28, 0.35);
}
.video-wrap { max-width: 860px; margin: 0 auto; }
.video-facade {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(251, 243, 228, 0.15);
}
.video-facade img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.play-btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.play-btn::before {
  content: "";
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(226, 96, 63, 0.95);
  box-shadow: 0 0 0 12px rgba(226, 96, 63, 0.25);
  display: block;
  grid-area: 1 / 1;
}
.play-btn svg { display: block; grid-area: 1 / 1; }
.play-pulse { position: absolute; inset: 0; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(242, 169, 59, 0.55); }
  100% { box-shadow: 0 0 0 26px rgba(242, 169, 59, 0); }
}
.video-facade .play-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 78px; height: 78px;
  margin: -39px 0 0 -39px;
  border-radius: 50%;
  animation: pulse-ring 1.9s ease-out infinite;
  pointer-events: none;
}
.video-facade iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.video-caption {
  margin: 0 auto 1.1rem;
  max-width: 640px;
  text-align: center;
  font-size: 0.98rem;
  color: rgba(251, 243, 228, 0.85);
}
.video-caption strong { color: #fff; }

/* ---------- Article ---------- */
.article-wrap { max-width: 780px; margin-inline: auto; }
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.4rem;
  margin-bottom: 2.4rem;
}
.toc h2 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin: 0 0 0.65rem;
  color: var(--brand-dark);
}
.toc ol { margin: 0; padding-left: 1.3rem; columns: 2; column-gap: 2rem; }
.toc li { margin: 0.3rem 0; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.toc a:hover { color: var(--brand-dark); text-decoration: underline; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

.article h2 {
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 2.7rem 0 1rem;
}
.article h2 .h2-icon { color: var(--accent-deep); margin-right: 0.4rem; }
.article h3 {
  font-family: var(--font-head);
  font-size: 1.22rem;
  margin: 1.8rem 0 0.7rem;
}
.article p { margin: 0 0 1.05rem; }
.article ul:not([class]), .article ol:not([class]) { margin: 0 0 1.05rem; padding-left: 1.35rem; }
.article li { margin: 0.4rem 0; }
.article strong { color: #4A3222; }
.article .figure { margin: 1.6rem 0; }
.article .figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.article .figure figcaption {
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 0.55rem;
}

.key-takeaways {
  background: linear-gradient(140deg, rgba(226, 96, 63, 0.07), rgba(242, 169, 59, 0.1));
  border: 2px solid rgba(226, 96, 63, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin: 2.4rem 0;
}
.key-takeaways h2 { margin-top: 0; }
.key-takeaways ul { list-style: none; padding: 0; margin: 0; }
.key-takeaways li {
  padding-left: 1.85rem;
  position: relative;
  margin: 0.65rem 0;
  font-weight: 500;
}
.key-takeaways li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.32rem;
  width: 1.1rem; height: 1.1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2603F' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(51, 38, 31, 0.05);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  font-weight: 700;
  font-family: var(--font-head);
  font-size: 1.04rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .faq-toggle {
  flex: none;
  position: relative;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--brand-soft);
}
.faq summary .faq-toggle::before,
.faq summary .faq-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 99px;
  background: var(--brand-dark);
  transition: opacity 0.18s ease, height 0.18s ease;
}
.faq summary .faq-toggle::before { width: 0.72rem; height: 0.15rem; }
.faq summary .faq-toggle::after { width: 0.15rem; height: 0.72rem; }
.faq details[open] .faq-toggle::after { opacity: 0; height: 0; }
.faq details[open] summary { color: var(--brand-dark); }
.faq .faq-body { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); margin: 0; }

/* ---------- Author ---------- */
.author-box {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2.6rem;
}
.author-box .avatar { flex: none; width: 74px; height: 74px; border-radius: 50%; box-shadow: var(--shadow); }
.author-box h3 { margin: 0 0 0.2rem; font-family: var(--font-head); font-size: 1.12rem; }
.author-box p { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--ink-soft); }
.author-box .author-link { font-size: 0.92rem; font-weight: 700; }
@media (max-width: 560px) { .author-box { flex-direction: column; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: rgba(251, 243, 228, 0.85);
  margin-top: auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-block: 3rem 2.2rem;
}
.footer-brand .brand-icon { width: 44px; height: 44px; border-radius: 11px; }
.footer-brand .brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: #fff; margin: 0.7rem 0 0.5rem; }
.footer-brand p { font-size: 0.93rem; margin: 0 0 0.9rem; color: rgba(251, 243, 228, 0.72); }
.footer-brand .yarn-note { font-style: italic; font-family: var(--font-head); color: var(--accent); font-size: 0.95rem; }
.site-footer h4 {
  font-family: var(--font-head);
  color: #fff;
  font-size: 1.02rem;
  margin: 0 0 0.85rem;
  letter-spacing: 0.02em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.45rem 0; }
.site-footer a { color: rgba(251, 243, 228, 0.82); text-decoration: none; font-size: 0.95rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(251, 243, 228, 0.14);
  padding-block: 1.2rem;
  font-size: 0.85rem;
  color: rgba(251, 243, 228, 0.6);
}
.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p { margin: 0; }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- Motion & misc ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

::selection { background: rgba(242, 169, 59, 0.4); }
