/* SpunkArt shared stylesheet. One file for every page. */
:root {
  --bg: #fbf8f3;
  --paper: #ffffff;
  --ink: #1f1d1a;
  --muted: #5b564e;
  --line: #e4ddd2;
  --accent: #b4441d;
  --accent-soft: #f6e4da;
  --code-bg: #f3efe8;
  --note-bg: #fff6e0;
  --note-line: #e2c26b;
  --radius: 10px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --paper: #201f1c;
    --ink: #eeeae3;
    --muted: #b7b0a5;
    --line: #3a3732;
    --accent: #f08a5d;
    --accent-soft: #3a2a22;
    --code-bg: #2a2824;
    --note-bg: #2e2a1d;
    --note-line: #8a7433;
  }
}
/* Section accents: one layout, a different accent per section. */
body.sec-color { --accent: #b4441d; }
body.sec-frontend { --accent: #2f6f8f; }
body.sec-dev { --accent: #3d6b3a; }
body.sec-ops { --accent: #555e2a; }
body.sec-web { --accent: #6b4c9a; }
body.sec-money { --accent: #8a5a12; }
body.sec-business { --accent: #9b2f4f; }
body.sec-social { --accent: #2a6f6a; }
body.sec-reading { --accent: #7a3e8f; }
body.sec-city { --accent: #375a9e; }
@media (prefers-color-scheme: dark) {
  body.sec-frontend { --accent: #7cc0e0; }
  body.sec-dev { --accent: #8fcf89; }
  body.sec-ops { --accent: #c4cf7a; }
  body.sec-web { --accent: #c1a3ee; }
  body.sec-money { --accent: #e8b65a; }
  body.sec-business { --accent: #f08aa8; }
  body.sec-social { --accent: #74cfc6; }
  body.sec-reading { --accent: #d7a0ea; }
  body.sec-city { --accent: #92b2f0; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* Header */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { font: 700 1.35rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.site-nav a:hover { color: var(--accent); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Page grid */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 20px; padding-bottom: 48px; }
@media (min-width: 960px) { .page { grid-template-columns: minmax(0, 1fr) 280px; } }

.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

article.guide { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px 30px; min-width: 0; }
@media (min-width: 700px) { article.guide { padding: 34px 44px 44px; } }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin: 0 0 12px; }
h2 { font-size: 1.45rem; margin: 2.1em 0 .5em; padding-top: .4em; border-top: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 1.2em; }
.kicker { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }
strong { font-weight: 650; }
blockquote { margin: 1.2em 0; padding: 4px 16px; border-left: 4px solid var(--accent); color: var(--muted); }

code, pre, kbd { font-family: var(--mono); font-size: .9em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--paper); }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; background: var(--accent-soft); }

.formula { background: var(--accent-soft); border-radius: 8px; padding: 12px 16px; font-family: var(--mono); font-size: .95rem; overflow-x: auto; margin: 0 0 1em; }
.example { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 1.2em; }
.note { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 8px; padding: 12px 16px; font-size: .95rem; margin: 1.4em 0; }

details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; background: var(--paper); }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 6px; }

/* Interactive tools (only pages with a working client-side widget) */
.tool-box { border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px; margin: 1.4em 0 1.6em; background: var(--bg); }
.tool-box h2 { border-top: 0; margin-top: 0; padding-top: 0; font-size: 1.2rem; }
.tool-box label { display: block; font-size: .9rem; font-weight: 600; margin: 10px 0 4px; }
.tool-box input, .tool-box select, .tool-box textarea {
  width: 100%; max-width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
}
.tool-box input[type="color"] { height: 42px; padding: 2px; }
.tool-box input[type="checkbox"], .tool-box input[type="radio"] { width: auto; }
.tool-box textarea { min-height: 120px; font-family: var(--mono); font-size: 14px; }
.tool-box .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.tool-box button {
  font: inherit; font-weight: 600; cursor: pointer; margin: 12px 8px 0 0; padding: 8px 16px;
  border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
@media (prefers-color-scheme: dark) { .tool-box button { color: #141312; } }
.tool-box button.secondary { background: transparent; color: var(--accent); }
.tool-box output, .tool-box .result { display: block; margin-top: 12px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: .95rem; white-space: pre-wrap; overflow-x: auto; min-height: 1.6em; }

/* Sidebar */
aside.side { font-size: .95rem; }
aside.side section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
aside.side h2 { font-size: 1.05rem; margin: 0 0 8px; padding: 0; border: 0; }
aside.side ul { list-style: none; padding: 0; margin: 0; }
aside.side li { margin: 0; border-top: 1px solid var(--line); }
aside.side li:first-child { border-top: 0; }
aside.side li a { display: block; padding: 7px 0; text-decoration: none; }
aside.side li a:hover { text-decoration: underline; }

/* Home */
.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.1rem); max-width: 20ch; }
.hero .lead { max-width: 62ch; }
.home-intro { max-width: 760px; }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 18px 0 30px; }
.sec-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.sec-card h2 { font-size: 1.15rem; margin: 0 0 6px; padding: 0; border: 0; }
.sec-card p { color: var(--muted); font-size: .93rem; }
.directory { columns: 1; column-gap: 28px; padding-left: 18px; }
@media (min-width: 640px) { .directory { columns: 2; } }
@media (min-width: 960px) { .directory { columns: 3; } }
.directory li { break-inside: avoid; font-size: .95rem; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.city-grid h3 { margin: 0 0 4px; font-size: 1rem; }
.city-grid p { margin: 0; font-size: .92rem; line-height: 1.8; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.gallery figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery figcaption { padding: 6px 10px; font-size: .85rem; color: var(--muted); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: .9rem; }
.site-foot .wrap { padding-top: 22px; padding-bottom: 26px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-foot a { color: var(--muted); }
