/* Case Converter: the type specimen (docs/design.md, "Look"). A contemporary foundry specimen in black and white:
   a heavy name beside a large light "Aa", the picker as a list of styles with the chosen one reversed out, and the
   result set large. Fonts are self-hosted; build.py fingerprints them beside this file in assets/. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("bricolage-grotesque-var-latin.a79fdb52d4.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("dm-mono-400-latin.e1896b13b2.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: #ffffff;   /* page and your text's box */
  --panel: #f0f0ee;   /* the result's ground, hover */
  --ink: #111111;     /* text, rules, the chosen style, Copy */
  --muted: #5c5c58;   /* captions, counts, the footer */
  --hair: #dcdcd8;    /* decorative hairlines */
  --edge: #85857f;    /* control borders */
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0e0e0d; --panel: #1b1b19; --ink: #f1f1ed; --muted: #a3a39d; --hair: #2d2d2a; --edge: #75756f; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.5 var(--sans); font-optical-sizing: auto; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 76rem; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 860px) { .wrap { padding-inline: 32px; } }

/* Masthead: the name, the promise, and a specimen "Aa", drawn here and hidden from screen readers */
header.site { padding-block: 36px 8px; }
.site .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: end; }
.site .wrap::after {
  content: "Aa"; content: "Aa" / "";
  grid-column: 2; grid-row: 1; align-self: end;
  font: 300 5.25rem/0.78 var(--sans); letter-spacing: -0.04em; color: var(--ink);
}
.title { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(2.5rem, 7.2vw, 5.75rem); font-weight: 720; line-height: 0.92; letter-spacing: -0.035em; }
.promise { grid-column: 1 / -1; grid-row: 2; margin: 20px 0 0; max-width: 38rem; font-size: 1.0625rem; }
@media (min-width: 860px) {
  header.site { padding-block: 64px 12px; }
  .site .wrap::after { grid-row: 1 / span 2; font-size: clamp(8rem, 14vw, 12.5rem); }
  .promise { grid-column: 1; font-size: 1.1875rem; }
}

/* The tool. Phones: your text, the picker, the result. From 860px: the picker across the top, the boxes side by side. */
main.tool { padding-block: 28px 8px; }
.needs-js { display: none; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "in" "picker" "out"; gap: 32px; }
.col-in { grid-area: in; min-width: 0; }
.picker { grid-area: picker; min-width: 0; margin: 0; padding: 0; border: 0; }
.col-out { grid-area: out; min-width: 0; }
@media (min-width: 860px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "picker picker" "in out"; }
}
.box-label { display: block; margin: 0 0 8px; font: 400 0.8125rem/1.2 var(--mono); color: var(--muted); }
.box { display: block; width: 100%; min-height: 11rem; margin: 0; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 0;
  background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.5 var(--sans); resize: vertical; }
.box::placeholder { color: var(--muted); opacity: 1; }
.box.result { border-color: transparent; background: var(--panel); font-size: 1.375rem; font-weight: 520; line-height: 1.22; letter-spacing: -0.01em; }
@media (min-width: 860px) {
  .box { min-height: 15rem; }
  .box.result { font-size: 1.875rem; line-height: 1.16; }
}
.counts { margin: 8px 0 0; font: 400 0.8125rem/1.4 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* The picker: a specimen's list of styles, each name in its own case, the chosen one reversed out */
.chips { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 16px; }
.group { min-width: 0; }
.group-writing, .group-code { grid-column: 1 / -1; }
.group-label { display: block; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font: 400 0.8125rem/1.2 var(--mono); color: var(--muted); }
.group-chips { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; }
.group-writing .group-chips, .group-code .group-chips { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chip { position: relative; display: flex; align-items: center; min-width: 0; min-height: 46px; padding: 8px 10px;
  border-bottom: 1px solid var(--hair); font: 480 1.0625rem/1.15 var(--sans); cursor: pointer; overflow-wrap: anywhere; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip:hover { background: var(--panel); }
.chip:has(input:checked) { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Windows High Contrast and other forced colours drop the reversed background, so the system's own selection colours
   and a thick border mark the chosen style there */
@media (forced-colors: active) {
  .chip:has(input:checked) { forced-color-adjust: none; background: Highlight; color: HighlightText; border-bottom: 3px solid HighlightText; }
}
@media (min-width: 860px) {
  .chips { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
  .group-writing, .group-code { grid-column: auto; }
  .group-writing .group-chips { grid-template-columns: minmax(0, 1fr); }
  .chip { font-size: 1.25rem; min-height: 48px; }
}

/* Options for the chosen case: the title style, or the filename's separator and letters */
.options { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 16px; }
.options fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; margin: 0; padding: 0; border: 0; }
.options legend { float: left; margin-right: 14px; font: 400 0.8125rem/44px var(--mono); color: var(--muted); }
.options label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.options input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

/* Buttons, the status line, and notes under the result */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font: 600 0.9375rem/1 var(--sans); cursor: pointer; }
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.status { min-height: 1.4em; margin: 10px 0 0; font: 400 0.8125rem/1.4 var(--mono); color: var(--muted); }
.notes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.notes li { padding: 8px 0; border-top: 1px solid var(--hair); }

/* How this works: a specimen's feature list */
.how { margin-top: 56px; padding-block: 0 8px; }
.how h2 { margin: 0; padding-top: 18px; border-top: 2px solid var(--ink); font-size: clamp(1.75rem, 4.2vw, 3rem); font-weight: 680; line-height: 1.02; letter-spacing: -0.025em; }
.how ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; margin: 22px 0 0; padding: 0; list-style: none; }
.how li { padding: 14px 0 18px; border-top: 1px solid var(--hair); max-width: 36rem; }
.how strong { display: block; margin-bottom: 2px; font-size: 1.1875rem; font-weight: 640; letter-spacing: -0.01em; }
.how .limit { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--hair); max-width: 46rem; color: var(--muted); }
@media (min-width: 860px) { .how ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.foot { margin-top: 16px; }
.foot .wrap { padding-block: 18px 40px; }
.foot p { margin: 0; padding-top: 14px; border-top: 1px solid var(--hair); font: 400 0.8125rem/1.5 var(--mono); color: var(--muted); }
.foot a { color: var(--muted); }

/* The 404 page */
.lost { padding-block: 24px 8px; }
.lost-code { margin: 0; font: 300 clamp(6rem, 22vw, 12rem)/0.85 var(--sans); letter-spacing: -0.05em; }
.lost-line { max-width: 38rem; margin: 20px 0 0; font-size: 1.1875rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.title a { color: inherit; text-decoration: none; }
