/* 699 Crochet — Forest & Sage */
@font-face { font-family: "Brico"; src: url("/static/fonts/Brico-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Brico"; src: url("/static/fonts/Brico-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Brico"; src: url("/static/fonts/Brico-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Brico"; src: url("/static/fonts/Brico-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --forest: #1E3A2B;
  --sage: #5C8F68;
  --sage-light: #9CC5A4;
  --sage-wash: #E3EBDF;
  --cream: #F3EFE6;
  --paper: #FBF9F4;
  --muted: #4A5E52;
  --line: #D9D3C4;
  --danger: #A23B2A;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 58, 43, .06), 0 6px 20px rgba(30, 58, 43, .06);
}

* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--forest);
  font: 400 17px/1.5 "Brico", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 18px 56px; }
a { color: var(--forest); text-decoration-color: var(--sage-light); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--sage); }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 3.6vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10; background: rgba(243, 239, 230, .94);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1160px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--forest); }
.brand img { height: 34px; width: auto; display: block; }
.brand span { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.nav a:hover { background: var(--sage-wash); }
.nav a.on { background: var(--forest); color: var(--cream); }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 700 16px/1 "Brico", system-ui, sans-serif; padding: 14px 22px; border-radius: 999px;
  border: 2px solid var(--forest); background: var(--forest); color: var(--cream); text-decoration: none;
  min-height: 48px; transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: #2A4E3A; border-color: #2A4E3A; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.ghost:hover { background: var(--sage-wash); }
.btn.sage { background: var(--sage); border-color: var(--sage); }
.btn.small { padding: 9px 14px; min-height: 38px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--danger); border-color: #E2C3BC; }
.btn.wide { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=search], input[type=password], select, textarea {
  width: 100%; font: 500 17px/1.3 "Brico", system-ui, sans-serif; color: var(--forest);
  background: var(--paper); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--sage-light); outline-offset: 2px; border-color: var(--sage);
}
.field { margin-bottom: 14px; }
.code-input { font-size: 28px !important; letter-spacing: .3em; text-align: center; font-weight: 800 !important; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 24px; }
.narrow { max-width: 460px; margin: 6vh auto 0; }
.notice { background: var(--sage-wash); border: 1px solid var(--sage-light); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.error { background: #F6E3DE; border: 1px solid #E2C3BC; color: #6E2418; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }

/* Home */
.hero { display: grid; gap: 28px; align-items: center; padding: 4vh 0 3vh; }
.hero .lead { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); max-width: 34em; }
.hero-art { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hero-art img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--paper); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--sage-wash); color: var(--forest); letter-spacing: .02em; }
.features { display: grid; gap: 14px; margin: 28px 0; }
.feature { padding: 20px; }
.feature b { display: block; font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.soon { margin-top: 28px; padding: 24px; background: var(--forest); color: var(--cream); border-radius: var(--radius); }
.soon h2 { color: var(--cream); }
.soon p { color: #D6E5D9; margin: 0; }

/* Library */
.lib-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.levels { display: flex; gap: 6px; flex-wrap: wrap; }
.levels a { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); font-weight: 700; font-size: 15px; background: var(--paper); }
.levels a.on { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; text-decoration: none; overflow: hidden; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--sage-wash); }
.tile .t { padding: 10px 12px 12px; }
.tile .t h3 { font-size: 15px; margin: 0 0 4px; }
.tile .t span { font-size: 13px; color: var(--muted); }
.tile:hover { border-color: var(--sage-light); }
.lvl { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.lvl.Easy { background: #E1EEDF; color: #2F5A3A; }
.lvl.Medium { background: #F1E7CC; color: #6A5214; }
.lvl.Hard { background: #EBD9D3; color: #7A2E1E; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 24px; }
.empty { text-align: center; padding: 48px 12px; }

/* Pattern */
.crumbs { font-size: 14px; margin-bottom: 12px; }
.pattern { display: grid; gap: 24px; }
.pattern .art img { width: 100%; border-radius: var(--radius); display: block; background: var(--paper); border: 1px solid var(--line); }
.pattern .art figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin: 18px 0; }
.facts div { background: var(--paper); padding: 12px 14px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.colors { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.colors li { display: flex; align-items: center; gap: 10px; }
.colors svg { flex: none; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; list-style: none; }
.chips li { font-size: 14px; padding: 5px 10px; border-radius: 999px; background: var(--sage-wash); }
.actions { display: grid; gap: 10px; margin: 20px 0; }

/* Account and admin */
.copy-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0; }
.copy-box input { font-size: 14px; }
table.members { width: 100%; border-collapse: collapse; font-size: 15px; }
table.members th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
table.members td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.members tr.off td { opacity: .55; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.stats div { padding: 14px; }
.stats b { display: block; font-size: 28px; font-weight: 800; line-height: 1; }
.stats span { font-size: 13px; color: var(--muted); }
.scroll { overflow-x: auto; }

footer { border-top: 1px solid var(--line); padding: 22px 18px 30px; text-align: center; font-size: 14px; color: var(--muted); }
footer img { height: 22px; vertical-align: middle; margin-right: 6px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: auto 1fr; align-items: center; }
  .actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: 1.1fr 1fr; padding: 7vh 0 5vh; }
  .pattern { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .pattern .art { position: sticky; top: 76px; }
  .filters { grid-template-columns: auto 220px 1fr; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .nav a { padding: 8px 10px; }
  table.members .hide-sm { display: none; }
}

.m0 { margin: 0; }
.m0b { margin-bottom: 0; }
.mt { margin-top: 14px; }
.mt8 { margin-top: 8px; }
.mb { margin-bottom: 14px; }
.mb2 { margin-bottom: 18px; }
.narrow.account { max-width: 560px; }

/* Store */
.h2 { font-size: clamp(22px, 3.6vw, 30px); font-weight: 800; }
.h3 { font-size: 18px; font-weight: 700; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.drop { position: relative; margin: 8px 0 0; }
.drop-in {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 180px; padding: 22px; border: 2px dashed #B9C9B5; border-radius: 18px; background: var(--paper);
  cursor: pointer; font-weight: 500; margin: 0; color: var(--forest);
}
.drop-in b { font-size: 19px; }
.drop-in:hover, .drop.over .drop-in { border-color: var(--sage); background: var(--sage-wash); }
.file:focus-visible + .drop-in, .drop-in:focus-within { outline: 3px solid var(--sage-light); outline-offset: 2px; }
.drop.busy .drop-in { opacity: .6; pointer-events: none; }
.wide-narrow { max-width: 620px; }
.steps { margin-top: 18px; }
.steps ol { list-style: none; padding: 0; }
.price { max-width: 520px; margin: 28px auto 0; text-align: center; }
.price .amount { font-size: 52px; font-weight: 800; line-height: 1.1; margin: 10px 0 4px; }
.price .amount span { font-size: 18px; font-weight: 500; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 16px 0 20px; text-align: left; display: grid; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 7px; border: solid var(--sage); border-width: 0 0 3px 3px; transform: rotate(-45deg); }
.maker { display: grid; gap: 18px; }
.stage { position: relative; display: grid; place-items: center; min-height: 320px; background: var(--sage-wash); border-radius: 12px; padding: 14px; margin-top: 6px; }
.stage img { max-width: 100%; max-height: 620px; image-rendering: pixelated; border-radius: 4px; }
.stage.loading img { opacity: .45; }
.stage-msg { margin: 0; color: var(--muted); font-weight: 500; text-align: center; }
.stage img:not([hidden]) + .stage-msg { position: absolute; inset: auto 12px 12px; background: rgba(251,249,244,.92); border-radius: 10px; padding: 6px 10px; }
.stage:not(.loading) img:not([hidden]) + .stage-msg { display: none; }
.colors-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.colors-list li { display: flex; align-items: center; gap: 6px; }
.colors-list i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg label { margin: 0; font-weight: 700; font-size: 14px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; line-height: 1.15; }
.seg small { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.seg input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.seg input:checked + span small { color: #D6E5D9; }
.seg input:focus-visible + span { outline: 3px solid var(--sage-light); outline-offset: 2px; }
.buy { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.pill.ok { background: #E1EEDF; color: #2F5A3A; vertical-align: middle; }
.usage-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.meter { height: 10px; border-radius: 99px; background: var(--sage-wash); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--sage); width: 0; }
.meter .w1 { width: 10%; } .meter .w2 { width: 20%; } .meter .w3 { width: 30%; } .meter .w4 { width: 40%; } .meter .w5 { width: 50%; }
.meter .w6 { width: 60%; } .meter .w7 { width: 70%; } .meter .w8 { width: 80%; } .meter .w9 { width: 90%; } .meter .w10 { width: 100%; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (min-width: 900px) {
  .maker { grid-template-columns: 1fr 380px; align-items: start; }
  .maker .side { position: sticky; top: 76px; }
}
@media (max-width: 520px) { .nav { gap: 2px; } .nav a { font-size: 14px; padding: 7px 8px; } }
.nav { flex-wrap: wrap; justify-content: flex-end; }

/* Learn */
.foot-links { margin-top: 6px; }
.learn-hero { display: grid; gap: 18px; align-items: end; padding: 3vh 0 2vh; }
.learn-hero .lead, .post .lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 36em; }
.learn-search { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 6px 0 12px; max-width: 640px; }
.topics { margin-bottom: 18px; }
.topics a { font-size: 14px; padding: 7px 12px; }
.part { margin: 30px 0 10px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.acard { display: flex; flex-direction: column; text-decoration: none; overflow: hidden; }
.acard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--sage-wash); }
.acard .t { padding: 12px 14px 14px; }
.acard h3 { margin: 4px 0 6px; font-size: 17px; }
.acard:hover { border-color: var(--sage-light); }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); }
.book-strip { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 10px 16px 10px 10px; text-decoration: none; }
.book-strip img { width: 54px; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.book-strip > span { display: flex; flex-direction: column; }
.book-strip .go { font-size: 22px; font-weight: 800; color: var(--sage); }
.learn-band { margin: 34px 0; }
.learn-band .book-strip { margin-top: 16px; }

.post { max-width: 760px; margin: 0 auto; }
.post header { margin: 8px 0 18px; }
.post-art { margin: 0 0 26px; }
.post-art img { width: 100%; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { margin: 1.6em 0 .5em; font-size: clamp(22px, 3vw, 27px); }
.prose h3 { margin: 1.4em 0 .4em; font-size: 19px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.4em 0; padding: 14px 18px; background: var(--sage-wash); border-left: 4px solid var(--sage); border-radius: 0 12px 12px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom-width: 2px; }
.book-cta { display: grid; grid-template-columns: 90px 1fr; gap: 18px; align-items: center; margin: 36px 0 18px; }
.book-cta img { width: 90px; border-radius: 4px; box-shadow: var(--shadow); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.prevnext a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; }
.prevnext .next { text-align: right; }

/* Book */
.book-hero { display: grid; gap: 28px; align-items: start; padding: 3vh 0; }
.book-hero .cover { width: 100%; max-width: 380px; border-radius: 6px; box-shadow: 0 2px 4px rgba(30,58,43,.12), 0 18px 40px rgba(30,58,43,.18); justify-self: center; }
.book-hero .lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); }
.bk-buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; margin-bottom: 10px; }
.bk-buy > div { display: flex; flex-direction: column; }
.bk-price { font-size: 34px; font-weight: 800; line-height: 1; }
.btn[disabled] { opacity: .55; cursor: default; }
.toc { margin: 24px 0; }
.toc-cols { display: grid; gap: 8px 28px; }
.toc h3 { margin: 16px 0 6px; font-size: 16px; }
.toc ol { margin: 0; padding-left: 2.2em; font-size: 15px; }
.toc li { margin: 2px 0; }

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .toc-cols { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .learn-hero { grid-template-columns: 1fr 380px; }
  .book-hero { grid-template-columns: 380px 1fr; gap: 48px; }
  .toc-cols { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 420px) { .nav .hide-xs { display: none; } }
