/* StringArtGen — "On the cutting mat". See docs/DESIGN-LANGUAGE.md.
   Paper sheets for interface, a green cutting mat (real 1 cm grid) under
   every board, one yellow action per screen, neutral ink. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

/* Guides, techniques and legal pages — same visual system as the studio app. */
:root {
  color-scheme: light;
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eceaee;
  --ink: #141614;
  --ink-2: #434a46;
  --muted: #69716c;
  --line: #d6dad5;
  --line-strong: #b9beb9;
  --accent: #f3c623;
  --accent-ink: #1f5a49;
  --accent-soft: #fde7e2;
  --cobalt: #1f5a49;
  --cobalt-soft: #e3e9fb;
  --ok: #0c8f6f;
  --ok-soft: #dcf3ec;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --stage: #2d5a4c;
  --stage-2: #2d5a4c;
  --font: "Barlow", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.72;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141514;
  --surface: #2d5a4c;
  --surface-2: #242624;
  --ink: #ebedea;
  --ink-2: #c5cac6;
  --muted: #9ba39e;
  --line: #2e322f;
  --line-strong: #454a46;
  --accent: #f3c623;
  --accent-ink: #8fd0b8;
  --accent-soft: #3a1c17;
  --cobalt: #7d9bff;
  --cobalt-soft: #1d2442;
  --ok: #3ccfa5;
  --ok-soft: #10302a;
  --warn: #f0b04a;
  --warn-soft: #3a2a10;
  --stage: #23483d;
  --stage-2: #23483d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141514; --surface: #2d5a4c; --surface-2: #242624; --ink: #ebedea; --ink-2: #c5cac6; --muted: #9ba39e;
    --line: #2e322f; --line-strong: #454a46; --accent: #f3c623; --accent-ink: #8fd0b8; --accent-soft: #3a1c17;
    --cobalt: #7d9bff; --cobalt-soft: #1d2442; --ok: #3ccfa5; --ok-soft: #10302a; --warn: #f0b04a; --warn-soft: #3a2a10;
    --stage: #23483d; --stage-2: #23483d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
::selection { background: #ffd2c7; color: #141614; }
h1, h2, h3, p, ul, ol, figure { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 780; line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); margin-bottom: 1.1rem; max-width: 18ch; }
h1 em { font-style: normal; color: inherit; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); margin-top: 2.6rem; margin-bottom: 0.9rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
p { margin-bottom: 1.2rem; }
li { margin-bottom: 0.6rem; }
ul, ol { padding-left: 1.4rem; }
strong { font-weight: 720; }

/* Header — mirrors the studio app */
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 22px; height: 66px; padding: 0 clamp(16px, 3vw, 36px); background: #ffffff; color: #141614; border-bottom-color: #d6dad5; backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 750; font-size: 1.08rem; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.wordmark img { width: 28px; height: 28px; }
.wordmark b { color: inherit; font-weight: 750; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 12px; }
.site-header nav a { padding: 8px 12px; border-radius: 4px; color: inherit; font-weight: 600; font-size: 0.93rem; text-decoration: none; opacity: 0.8; }
.site-header nav a:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.site-header nav a[aria-current="page"] { opacity: 1; background: rgba(255, 255, 255, 0.13); }
.header-login { margin-left: auto; padding: 8px 12px; border-radius: 4px; color: inherit; font-weight: 600; font-size: 0.93rem; text-decoration: none; white-space: nowrap; }
.header-login:hover { background: rgba(127, 127, 127, 0.14); }
.header-login + .header-cta { margin-left: 4px; }
.header-cta { margin-left: auto; display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 4px; background: #f3c623; color: #141614; font-weight: 650; font-size: 0.9rem; text-decoration: none; white-space: nowrap; }
.header-cta:hover { background: #f3c623; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Layout */
.page-shell { max-width: 1240px; margin: auto; padding: 56px clamp(16px, 5vw, 64px) 90px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 26px; font-size: 0.82rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.eyebrow { font-size: 0.72rem; font-weight: 750;   color: var(--accent-ink); margin-bottom: 14px; }
.intro { font-size: 1.12rem; color: var(--muted); max-width: 64ch; }
.editorial-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(28px, 4vw, 56px); border-radius: 6px; background: radial-gradient(70% 90% at 80% 40%, #2d5a4c 0%, #2d5a4c 70%); color: #f3f1f6; }
.editorial-hero h1 { color: #fff; }
.editorial-hero h1 em { color: inherit; }
.editorial-hero .eyebrow { color: #8fd0b8; }
.editorial-hero .intro { color: #c9c6d2; }
.editorial-image { margin: 0; }
.editorial-image img { display: block; width: 100%; height: auto; aspect-ratio: 1.3; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.editorial-image figcaption { padding: 10px 4px 0; font-size: 0.72rem; color: #a9a6b3; }
.topic-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 46px; }
.topic-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 0.86rem; text-decoration: none; }
.topic-links a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.topic-links a:nth-child(2n)::before { background: var(--cobalt); }
.topic-links a:hover { border-color: var(--ink); }
.section-heading h2 { margin: 0 0 6px; font-size: clamp(1.9rem, 3.4vw, 2.7rem); }

/* Articles */
.article-meta { display: inline-block; font-size: 0.76rem; font-weight: 650; padding: 4px 12px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.article-layout { display: grid; grid-template-columns: minmax(0, 740px) 240px; gap: 56px; margin-top: 30px; }
.article-body { min-width: 0; font-size: 1.02rem; }
.article-body > h2:first-child { margin-top: 0; }
.article-body p, .article-body li { max-width: 72ch; color: var(--ink-2); }
.article-body a { font-weight: 600; overflow-wrap: anywhere; }
.article-body h2[id], .technique-card[id] { scroll-margin-top: 84px; }
.article-aside { align-self: start; position: sticky; top: 90px; padding: 20px; border-radius: 6px; background: var(--stage); color: #e9e7ee; }
.article-aside h2 { font-size: 0.72rem;   margin: 0 0 14px; color: #8fd0b8; }
.article-aside ul { list-style: none; padding: 0; margin: 0 0 14px; }
.article-aside li { margin: 0 0 10px; }
.article-aside a { color: #e9e7ee; text-decoration: none; font-size: 0.9rem; }
.article-aside a:hover { color: #fff; text-decoration: underline; }
.note { border-left: 4px solid var(--cobalt); background: var(--cobalt-soft); padding: 18px 22px; margin: 26px 0; border-radius: 0 16px 16px 0; }
.note p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; text-align: left; background: var(--surface); }
caption { text-align: left; padding: 14px; font-weight: 650; background: var(--surface-2); }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; vertical-align: top; }
th { font-weight: 720; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* Cards */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 26px 0 56px; }
.guide-card { display: flex; flex-direction: column; padding: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; transition: transform 0.25s, box-shadow 0.25s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20, 18, 30, 0.08), 0 18px 48px rgba(20, 18, 30, 0.14); }
.guide-card:nth-child(4n + 1) { background: var(--stage); color: #f3f1f6; border-color: transparent; }
.guide-card:nth-child(4n + 1) p { color: #b9b6c3; }
.guide-number { display: flex; align-items: center; gap: 12px; font-size: 0.72rem; font-weight: 700;   margin-bottom: 22px; color: var(--muted); }
.guide-card:nth-child(4n + 1) .guide-number { color: #a9a6b3; }
.guide-number b { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0; }
.guide-card:nth-child(2n) .guide-number b { background: var(--cobalt); }
.guide-card h2 { font-size: 1.6rem; margin: 0 0 12px; }
.guide-card p { font-size: 0.94rem; color: var(--muted); margin-bottom: 22px; }
.read-link { margin-top: auto; font-size: 0.86rem; font-weight: 700; color: inherit; border-bottom: 2px solid var(--accent); align-self: flex-start; padding-bottom: 2px; }
.action-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 4px; background: #f3c623; color: #141614; font-weight: 650; text-decoration: none;  }
.action-link:hover { background: #f3c623; text-decoration: none; }
.after-article { margin-top: 44px; padding: 28px; border-radius: 6px; background: var(--stage); color: #f3f1f6; }
.after-article h2 { margin-top: 0; font-size: 1.7rem; }
.after-article p { color: #c9c6d2; }
.library-intro { max-width: 76ch; color: var(--muted); }
.technique-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 30px 0 56px; }
.technique-card { padding: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.technique-topline { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.technique-topline .eyebrow { margin-bottom: 0; }
.technique-index { display: inline-grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 750; }
.technique-card:nth-child(2n) .technique-index { background: var(--cobalt); }
.technique-card h2 { margin: 0 0 14px; font-size: 1.75rem; }
.technique-card > p { color: var(--muted); font-size: 0.95rem; }
.status-tag { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; background: var(--ok-soft); color: var(--ok); }
.technique-card:nth-child(n + 4) > .status-tag { background: var(--warn-soft); color: var(--warn); }
.technique-card .reference-link { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; font-size: 0.8rem; }
.studio-callout { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 32px; border-radius: 6px; background: radial-gradient(70% 90% at 85% 40%, #2d5a4c 0%, #2d5a4c 70%); color: #f3f1f6; }
.studio-callout .eyebrow { color: #8fd0b8; }
.studio-callout h2 { margin: 0 0 12px; font-size: 1.9rem; max-width: 25ch; }
.studio-callout p:last-child { margin-bottom: 0; max-width: 55ch; color: #c9c6d2; }
.studio-callout .action-link { flex-shrink: 0; }

/* Footer — mirrors the studio app */
.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 18px 30px; align-items: center; margin-top: 40px; padding: 40px clamp(16px, 5vw, 80px); background: #2d5a4c; color: #c9c6d2; }
.site-footer p { margin: 0; }
.site-footer strong { color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: #c9c6d2; font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.simple-page { max-width: 880px; }
.simple-page .article-body { margin-top: 32px; }
.error-page { padding-bottom: 130px; }
.error-code { font-size: 0.75rem; letter-spacing: 0.13em; color: var(--accent-ink); font-weight: 750; }
.small-text { font-size: 0.875rem; color: var(--muted); }

@media (max-width: 950px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .article-aside { position: static; grid-row: 1; }
  .article-aside ul { display: flex; flex-wrap: wrap; column-gap: 20px; }
  .editorial-hero { grid-template-columns: 1fr; }
  .studio-callout { flex-direction: column; align-items: flex-start; }
  .site-header nav { display: none; }
}
@media (max-width: 680px) {
  .page-shell { padding-top: 26px; }
  .editorial-hero { padding: 22px; border-radius: 22px; }
  .guide-grid, .technique-grid { grid-template-columns: 1fr; }
  .guide-card, .technique-card { padding: 22px; }
  .site-footer { grid-template-columns: 1fr; }
  th, td { min-width: 110px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  body { background: white; color: #111; }
  .site-header, .site-footer, .article-aside, .breadcrumb, .after-article, .skip-link, .topic-links, .studio-callout { display: none; }
  .editorial-hero { background: none; color: #111; padding: 0; }
  .page-shell { max-width: none; padding: 0; }
  .article-layout { display: block; }
  .note { border: 1px solid #777; }
}
.article-image { margin: 26px 0 8px; max-width: 1040px; }
.article-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.article-image figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.guide-card .card-image { display: block; height: auto; width: calc(100% + 56px); max-width: none; margin: -28px -28px 20px; aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 680px) { .guide-card .card-image { width: calc(100% + 44px); margin: -22px -22px 16px; } }

/* ---------- Ad placements (Google AdSense) ---------- */
/* Space is reserved to avoid layout shift; a placement AdSense leaves unfilled collapses. */
.ad-slot { display: grid; gap: 4px; width: min(100% - 32px, 970px); min-height: 120px; margin: 40px auto; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; color: var(--muted); }
