/* Aida and Alchemy site styles.
   Layout concept: a paper-and-Aida studio. Pages read like the books: Lora headings on warm paper,
   a stitched cross border under the header, covers standing on a wooden ledge, previews framed like hoops.
   Deliberately single (light) theme: the brand is paper, wood and floss, matching the printed books. */
:root {
  color-scheme: light;
  --paper: #f4efea;        /* brand paper, same as the book pages */
  --paper-deep: #ebe3d9;   /* section bands */
  --card: #fbf8f4;         /* raised surfaces */
  --ink: #232c5e;          /* logo navy: headings, buttons */
  --ink-soft: #4d5170;     /* body text */
  --muted: #6f6f82;        /* captions */
  --line: #dcd2c5;         /* hairlines */
  --wood: #d8b48a;         /* hoop and ledge */
  --wood-dark: #a97c51;
  --rose: #b4465a;         /* small accents, prices */
  --sage: #4f7a58;         /* confirmations */
  --warn-bg: #f9eeda;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.1rem, 1.6rem + 2.4vw, 3.1rem);
  --radius: 10px;
  --wrap: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rose); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }
.prose p + p, .prose p + ul, .prose ul + p, .prose h2 + p, .prose h3 + p, .prose p + h2, .prose ul + h2, .prose p + h3, .prose ol + p, .prose p + ol, .prose ul + h3, .prose ol + h2 { margin-top: 1rem; }
.prose h2 { margin-top: 2.2rem; font-size: var(--step-2); }
.prose h3 { margin-top: 1.6rem; }
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0; }
.prose li + li { margin-top: 0.35rem; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose);
}
.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 58ch; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

/* Header */
.site-header { background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: 46px; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 999px; font-weight: 500; font-size: 0.95rem; color: var(--ink); }
.nav a:hover { background: var(--paper-deep); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--card); }
.nav .cart-link { border: 1px solid var(--line); }
.cart-count { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; margin-left: 4px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 0 4px; }
.cart-count[data-empty="true"] { display: none; }

/* Stitched border: a row of cross stitches in the brand floss colours */
.stitch-band {
  height: 18px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='18' viewBox='0 0 72 18'%3E%3Cg stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 5l8 8M12 5l-8 8' stroke='%23b4465a'/%3E%3Cpath d='M22 5l8 8M30 5l-8 8' stroke='%23d8b48a'/%3E%3Cpath d='M40 5l8 8M48 5l-8 8' stroke='%23232c5e'/%3E%3Cpath d='M58 5l8 8M66 5l-8 8' stroke='%2392b5ba'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.85;
}

/* Sections */
.section { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.section.band { background: var(--paper-deep); }
.section-head { display: grid; gap: 0.5rem; margin-bottom: 1.8rem; max-width: 62ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--card); text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: #18204a; color: var(--card); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--card); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero */
.hero { padding-block: clamp(2rem, 1.5rem + 3vw, 4rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-copy { display: grid; gap: 1.1rem; }
.hero-note { font-size: var(--step--1); color: var(--muted); }
.shelf { position: relative; padding: 0 4% 0; }
.shelf-books { display: flex; align-items: flex-end; justify-content: center; gap: 0; position: relative; z-index: 1; }
.shelf-books img { width: 34%; border-radius: 3px; box-shadow: 0 10px 22px rgba(35, 44, 94, 0.18), 0 2px 4px rgba(35, 44, 94, 0.12); }
.shelf-books img:nth-child(1) { transform: rotate(-4deg) translateX(12%); }
.shelf-books img:nth-child(2) { width: 38%; position: relative; z-index: 2; }
.shelf-books img:nth-child(3) { transform: rotate(4deg) translateX(-12%); }
.ledge { height: 16px; margin-top: -4px; border-radius: 3px; background: linear-gradient(var(--wood), var(--wood-dark)); box-shadow: 0 8px 14px rgba(110, 76, 40, 0.25); }
.aida {
  background-color: var(--card);
  background-image:
    linear-gradient(rgba(35, 44, 94, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 44, 94, 0.06) 1px, transparent 1px);
  background-size: 9px 9px;
}

/* Book grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 28px 22px; }
.book-card { display: grid; gap: 10px; align-content: start; }
.book-card .cover { display: block; border-radius: 3px; overflow: hidden; box-shadow: 0 8px 18px rgba(35, 44, 94, 0.14); background: var(--card); }
.book-card .cover img { aspect-ratio: 850 / 1100; object-fit: cover; width: 100%; }
.book-card h3 { font-size: 1.08rem; }
.book-card h3 a { text-decoration: none; }
.book-card p { font-size: 0.9rem; color: var(--muted); }
.book-card .links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.88rem; font-weight: 500; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: var(--paper-deep); border-radius: 999px; padding: 2px 10px; width: fit-content; }
.coming .cover { opacity: 0.92; }

/* Feature tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; align-content: start; }
.tile h3 a { text-decoration: none; }
.tile .icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-deep); color: var(--ink); }

/* Split blocks */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.split.top { align-items: start; }

/* Figures */
figure { margin: 0; display: grid; gap: 8px; }
figcaption { font-size: var(--step--1); color: var(--muted); }
.frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.preview-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--ink); background: var(--warn-bg); border-radius: 999px; padding: 2px 10px; width: fit-content; }

/* Book page */
.book-hero .wrap { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.book-hero .cover img { border-radius: 4px; box-shadow: 0 14px 30px rgba(35, 44, 94, 0.2); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: 0.95rem; }
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { margin: 0; }
.breadcrumb { font-size: var(--step--1); color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.two-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.checklist li::before { content: "✕"; color: var(--rose); font-weight: 700; line-height: 1.65; }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.field input, .field select {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); width: 100%; min-width: 0;
}
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(35, 44, 94, 0.15); }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input { flex: 1 1 220px; }
.notice { border-radius: 8px; padding: 12px 14px; font-size: 0.92rem; background: var(--warn-bg); color: var(--ink); }
.notice.ok { background: #e5f0e4; }
.signup-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; }

/* Shop */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 22px; }
.product { display: grid; gap: 10px; align-content: start; }
.product .thumb { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; }
.placeholder-art { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: 0.85rem; }
.price { font-weight: 600; color: var(--ink); }
.price .iqd { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.example-flag { font-size: 0.75rem; font-weight: 600; color: var(--rose); text-transform: uppercase; letter-spacing: 0.05em; }
.buy-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.cart-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.cart-table th, .cart-table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart-table td.num, .cart-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--rose); text-decoration: underline; cursor: pointer; }

/* Calculator */
.calc { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.5rem); align-items: start; }
.calc-out { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; }
.big-number { font-family: var(--font-display); font-size: var(--step-3); color: var(--ink); font-weight: 700; line-height: 1.1; }
.size-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.size-table th, .size-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.size-table tr[data-active="true"] td { background: var(--paper-deep); font-weight: 600; color: var(--ink); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-size: 0.9rem; border: 0; background: transparent; padding: 6px 14px; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* Chart guide demo */
.chart-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 22px; align-items: start; }
.chart-demo canvas { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.key { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.key td, .key th { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,0.12); }
.sym { font-family: "Courier New", monospace; font-weight: 700; color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #d9dbe8; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 28px; padding-block: 44px 28px; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.92rem; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 18px; font-size: 0.82rem; color: #b9bcd1; }
.site-footer .field input { background: #fff; }
.site-footer .btn { background: var(--card); color: var(--ink); border-color: var(--card); }
.site-footer .btn:hover { background: var(--wood); border-color: var(--wood); color: var(--ink); }
.site-footer .field label { color: #fff; }
.site-footer .notice { color: var(--ink); }
.preview-bar { background: var(--warn-bg); color: var(--ink); font-size: 0.85rem; text-align: center; padding: 8px 16px; }

@media (max-width: 860px) {
  .hero .wrap, .split, .book-hero .wrap, .calc, .chart-demo { grid-template-columns: minmax(0, 1fr); }
  .book-hero .cover { max-width: 300px; }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer .wrap > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}
@media (max-width: 560px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
}
@media (max-width: 480px) {
  .brand span { font-size: 1.1rem; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .facts dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
