/* design: v2 */
/* permanentjewelrymachine.com, design v2 A "First market Saturday" (design/home-v2-A.png, James's pick, 2 Dec 2026).
   A craft market morning: cornflower sky over the header and hero, tomato and cream awnings, the tool on a chalkboard
   easel, kits as coloured tickets, a mint page. DynaPuff for headings, Source Sans 3 for text. The drawings are inline
   SVG from src/art.ts. Dark mode is the same market at dusk: the drawings keep their colours, the page goes deep teal. */

@font-face { font-family: "DynaPuff"; src: url("/fonts/dynapuff-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

:root {
  --bg: #cde6d4;
  --brand: #d84935;
  --sky-top: #6f9ae0;
  --sky-bottom: #a9c8f0;
  --text: #1f3436;
  --ink: #243e40;
  --muted: #3f5658;
  --line: #a9cbb7;
  --card: #ffffff;
  --link: #a8331f;
  --tomato: #d84935;
  --tomato-dark: #a8331f;
  --cream: #fff4e2;
  --gold: #e5b84b;
  --mint: #bedcc9;
  --t1: #fbeec4; --t2: #e6f4ea; --t3: #fbe2de;
  --board: #2c4a44; --board-text: #fff8ec; --board-muted: #cfe6d8; --wood: #b9824f; --wood-dark: #8a5a33;
  --np: #8a4300;
  --yes: #155a34; --yes-bg: #e2f2e8;
  --no: #8a2416; --no-bg: #fde3de;
  --display: "DynaPuff", "Trebuchet MS", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #132a2c;
    --sky-top: #1d3463;
    --sky-bottom: #3a5d93;
    --text: #f3eee2;
    --ink: #f3eee2;
    --muted: #c5d3cc;
    --line: #35575a;
    --card: #1b3638;
    --link: #ffb4a3;
    --t1: #3b3420; --t2: #1d3b30; --t3: #3e2523;
    --np: #f5c27f;
    --yes: #9fe0b6; --yes-bg: #17301f;
    --no: #ffc1b5; --no-bg: #43201a;
  }
}

body { background: var(--bg); color: var(--text); font-family: "Source Sans 3", "Segoe UI", sans-serif; font-size: 18px; line-height: 1.55; }
h1, h2, h3, .wordmark, .main-nav a, .btn, .board-title, .toc-title { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
h1 { line-height: 1.08; }
h2 { line-height: 1.15; }
a { color: var(--link); }

/* ---------- header: on the sky, with an awning edge on the inner pages ---------- */
.site-header { background: var(--sky-top); border-bottom: 0; position: relative; }
.site-header .wrap, .site-footer .wrap { max-width: 1240px; }
.brand { color: #fff; gap: 8px; }
.brand .mark { height: 34px; }
.wordmark { font-size: 1.25rem; color: #fff; text-shadow: 0 2px 0 rgba(36, 62, 64, 0.35); }
.main-nav a { color: #fff; font-size: 1.05rem; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: #fff; text-decoration-color: var(--gold); text-decoration-thickness: 3px; }
.menu-btn { font-family: var(--display); background: var(--cream); color: #243e40; border: 0; border-radius: 10px; padding: 6px 14px; }
body:not(.page-home) .site-header::after {
  content: ""; display: block; height: 26px; margin-bottom: -26px; position: relative; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='26'%3E%3Crect width='28' height='12' fill='%23d84935'/%3E%3Crect x='28' width='28' height='12' fill='%23fff4e2'/%3E%3Cpath d='M0 12a14 13 0 0 0 28 0z' fill='%23d84935'/%3E%3Cpath d='M28 12a14 13 0 0 0 28 0z' fill='%23fff4e2'/%3E%3C/svg%3E") repeat-x;
}
@media (max-width: 700px) {
  .has-menu.menu-open .main-nav a { border-top-color: rgba(255, 255, 255, 0.35); }
}

/* ---------- home: the hero ---------- */
.page-home main { overflow-x: clip; }
.hero { position: relative; background: linear-gradient(var(--sky-top), var(--sky-bottom) 70%); text-align: center; padding: 18px 0 0; }
.hero-text { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; padding: 0 max(5vw, 16px); }
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); max-width: 22ch; margin-left: auto; margin-right: auto; color: #1c3436; margin: 8px 0 12px; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35); }
.hero .lede { font-size: 1.2rem; color: #142a2c; max-width: 720px; margin: 0 auto; font-weight: 500; }
.awn { position: absolute; top: 0; width: clamp(150px, 21vw, 320px); z-index: 1; pointer-events: none; }
.awn svg { display: block; width: 100%; height: auto; }
.awn-l { left: 0; }
.awn-r { right: 0; transform: scaleX(-1); }
.hero-art { margin-top: -10px; }
.hero-scene { display: block; width: 100%; height: clamp(250px, 31vw, 452px); }
@media (max-width: 860px) {
  .awn { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero .lede { font-size: 1.08rem; }
  .hero-scene { height: 260px; }
}

@media (prefers-color-scheme: dark) {
  .hero h1 { color: #fff8ec; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
  .hero .lede { color: #eaf1fb; }
}
@media (max-width: 480px) {
  .wordmark { font-size: 1rem; }
  .brand .mark { height: 28px; }
  .has-menu.js-menu:not(.menu-open) .header-row { flex-wrap: nowrap; }
}

/* ---------- home: the market (tool, answer, welder table) ---------- */
.market { background: var(--mint); padding: 32px 0 48px; }
@media (prefers-color-scheme: dark) { .market { background: var(--bg); } }
.market-wrap { max-width: 1240px; margin: 0 auto; padding: 0 max(4vw, 16px); }
.market-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .market-grid { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); } .easel { position: sticky; top: 16px; } }

.easel { position: relative; padding-bottom: 46px; }
.board { background: var(--board); color: var(--board-text); border: 14px solid var(--wood); border-radius: 12px; box-shadow: inset 0 0 0 3px var(--wood-dark), 0 6px 0 var(--wood-dark); padding: 18px 18px 8px; position: relative; z-index: 1; }
.legs span { position: absolute; bottom: 0; width: 16px; height: 70px; background: var(--wood); border-radius: 0 0 6px 6px; }
.legs span:first-child { left: 18%; transform: rotate(8deg); }
.legs span:last-child { right: 18%; transform: rotate(-8deg); }
.board-title { font-size: 1.8rem; margin: 0 0 6px; color: var(--board-text); }
.board-line { color: var(--board-muted); font-size: 1rem; margin: 0 0 12px; }
.board a { color: #ffd98a; }
.board .payback-form { background: transparent; border: 0; padding: 0; margin: 0; border-radius: 0; }
.board .payback-form label { font-size: 1rem; }
.payback-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.payback-form legend { font-family: var(--display); font-size: 1.15rem; color: var(--gold); margin-bottom: 6px; }
.payback-form .row { display: grid; gap: 6px 14px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.payback-form label { color: var(--board-text); font-weight: 600; }
.payback-form .hint, .board .hint { color: var(--board-muted); font-size: 0.92rem; }
.payback-form select, .payback-form input[type="number"] { font: inherit; font-size: 1rem; padding: 8px 10px; border: 2px solid transparent; border-radius: 9px; background: var(--cream); color: #243e40; width: 100%; max-width: 100%; }
.payback-form select:focus, .payback-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.payback-form .checks label { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-weight: 500; }
.payback-form .checks input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--gold); flex: none; }
@media (min-width: 560px) { .payback-form .row { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.board .payback-form .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.board .payback-form .row select, .board .payback-form .row input[type="number"] { margin-bottom: 8px; }

.btn { background: var(--tomato); color: #fff; border: 0; border-radius: 14px; padding: 12px 22px; font-size: 1.15rem; box-shadow: 0 5px 0 var(--tomato-dark); cursor: pointer; }
.btn:hover { background: #c63f2c; color: #fff; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--tomato-dark); }
.board .btn { width: 100%; font-size: 1.3rem; }
.share-btn { font-size: 1rem; padding: 8px 18px; background: #fff; color: #243e40; box-shadow: 0 4px 0 #9db7a8; border: 2px solid #243e40; }
.share-btn:hover { background: var(--cream); color: #243e40; }

.payback-answer > h2:first-child { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0 0 6px; color: var(--ink); }
.payback-answer h2 { font-size: 1.4rem; margin: 26px 0 10px; color: var(--ink); }
.answers { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.answer { background: var(--t1); border-radius: 16px; padding: 14px 18px; position: relative; display: grid; gap: 4px 22px; grid-template-columns: minmax(0, 1fr); color: var(--text); }
.answers .answer:nth-child(3n + 2) { background: var(--t2); }
.answers .answer:nth-child(3n + 3) { background: var(--t3); }
.answer::before, .answer::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--mint); }
.answer::before { left: -9px; } .answer::after { right: -9px; }
@media (prefers-color-scheme: dark) { .answer::before, .answer::after { background: var(--bg); } }
.answer h3 { font-size: 1.3rem; margin: 0 0 2px; }
.answer h3 a { color: var(--ink); text-decoration: none; }
.answer h3 a:hover { text-decoration: underline; }
.answer.welder-only { background: var(--card); }
.answer.over { opacity: 0.92; }
.ticket-side { font-size: 0.95rem; }
@media (min-width: 760px) {
  .answer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 16px 22px; }
  .ticket-side { border-left: 2px dashed rgba(36, 62, 64, 0.35); padding-left: 20px; }
}
@media (prefers-color-scheme: dark) { .ticket-side { border-left-color: rgba(243, 238, 226, 0.3); } }
.kind, .note, .source, .hint, .status { color: var(--muted); font-size: 0.95rem; }
.total { font-size: 1.05rem; margin: 6px 0; }
.total strong { font-family: var(--display); font-size: 1.9rem; color: var(--ink); }
.payback { margin: 6px 0; }
.payback strong { font-size: 1.15rem; }
.np { color: var(--np); font-weight: 700; }
.fit-no { color: var(--no); background: var(--no-bg); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.shop a { font-weight: 700; }

table { border-collapse: collapse; width: 100%; }
table.includes, table.vat, table.models, table.specs, table.prices { margin: 6px 0 10px; }
table.includes, table.vat, table.includes td, table.includes th, table.vat td, table.vat th { background: transparent; }
table.includes th, table.includes td, table.vat th, table.vat td { text-align: left; padding: 4px 6px; border-bottom: 1px solid rgba(36, 62, 64, 0.18); vertical-align: top; }
table.includes th, table.vat th { width: 7rem; font-weight: 700; }
@media (prefers-color-scheme: dark) { table.includes th, table.includes td, table.vat th, table.vat td { border-bottom-color: rgba(243, 238, 226, 0.18); } }
table.models, table.specs, table.prices { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink); }
table.models th, table.models td, table.specs th, table.specs td, table.prices th, table.prices td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.models thead th, table.prices thead th { background: var(--mint); color: #1f3436; font-weight: 700; }
@media (prefers-color-scheme: dark) { table.models thead th, table.prices thead th { background: #24474a; color: var(--text); } }
table.specs th { width: 9rem; }
.table-scroll { overflow-x: auto; padding: 2px; }

.market-switch { font-family: var(--display); font-size: 1.2rem; text-align: center; margin: 28px 0 8px; }
.market-switch a { color: #1d4fa8; }
@media (prefers-color-scheme: dark) { .market-switch a { color: #a9c8f0; } }
.welders-band { display: grid; gap: 10px 32px; grid-template-columns: minmax(0, 1fr); margin-top: 26px; align-items: center; }
.welders-band h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0; color: var(--ink); }
@media (min-width: 1000px) { .welders-band { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } }
.left-out { max-width: 860px; margin-top: 30px; }
.left-out h2 { font-size: 1.4rem; color: var(--ink); }

/* ---------- inner pages ---------- */
body:not(.page-home) main { background: var(--bg); }
.article-wrap { max-width: 1100px; padding-top: 44px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); color: var(--ink); margin: 0 0 10px; }
.page-head .lede { font-size: 1.2rem; }
.page-head-art { width: clamp(120px, 20vw, 210px); background: var(--cream); border-radius: 50%; padding: 12px; box-shadow: 0 0 0 6px #fff, 0 0 0 8px var(--mint); }
@media (prefers-color-scheme: dark) { .page-head-art { box-shadow: 0 0 0 6px var(--card), 0 0 0 8px var(--line); } }
.page-body h2 { display: inline-block; background: var(--tomato); color: #fff; font-size: 1.3rem; padding: 5px 18px 6px; border-radius: 999px; margin: 30px 0 10px; box-shadow: 0 4px 0 var(--tomato-dark); }
.page-body h3 { color: var(--ink); }
.page-body > p, .page-body li { max-width: 72ch; }
.byline { color: var(--muted); }
.crumbs a { color: var(--link); }
.toc { background: var(--card); border-radius: 12px; padding: 12px 16px; box-shadow: 0 0 0 2px var(--line); }
.page-payback .payback-form, .page-uk .payback-form { background: var(--board); border: 12px solid var(--wood); border-radius: 12px; padding: 16px; color: var(--board-text); }

.share { margin-top: 1.4rem; }
.share-link { margin-right: 0.75rem; }
.share-box { display: block; width: 100%; margin-top: 0.4rem; font: inherit; }

/* ---------- footer: the gold chain, then the market's ink ---------- */
.site-footer { background: #243e40; color: #e9efe9; border-top: 0; margin-top: 0; position: relative; }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='28'%3E%3Cellipse cx='6' cy='14' rx='7' ry='4.2' fill='none' stroke='%23e5b84b' stroke-width='2.6'/%3E%3Cellipse cx='18' cy='14' rx='4.2' ry='7' fill='none' stroke='%23b9862a' stroke-width='2.6'/%3E%3C/svg%3E") repeat-x;
}
.site-footer a, .footer-brand .brand { color: #ffe3a3; }
.site-footer .wordmark { color: #fff; }
.site-footer h2, .site-footer h3, .site-footer .footer-col p:first-child { color: #fff; }
