/* Permit Scouter: concrete-grey page, slate ink, and one bright thing: the yellow job-site permit card. */

/* Barlow, self-hosted (SIL Open Font License, see fonts/OFL-LICENSE.txt) */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --concrete: #e8eae9;
  --paper: #f6f7f6;
  --ink: #1d2632;
  --muted: #556170;
  --rule: #c5cbcc;
  --link: #1f4fa0;
  --permit: #ffd23f;
  --permit-ink: #1d2632;
  --code-bg: #dfe3e2;
  --notice-bg: #1d2632;
  --notice-ink: #e8eae9;
  --sans: "Barlow", system-ui, sans-serif;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 66ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --concrete: #141a21;
    --paper: #1b232c;
    --ink: #e6e9ec;
    --muted: #9aa5b1;
    --rule: #2f3a46;
    --link: #8db3ff;
    --code-bg: #222c37;
    --notice-bg: #26313d;
    --notice-ink: #e6e9ec;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- top of page ---------- */

.notice {
  background: var(--notice-bg);
  color: var(--notice-ink);
  font-size: 0.9375rem;
  padding: 0.55rem 0;
}
.notice p { margin: 0; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}
.wordmark::before {
  /* a small permit tag as the mark */
  content: "";
  width: 0.9rem;
  height: 1.15rem;
  background: var(--permit);
  border: 2px solid var(--permit-ink);
  border-radius: 2px;
  transform: rotate(-6deg);
}

.site-nav { display: flex; gap: 1.25rem; font-weight: 500; white-space: nowrap; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 4.5rem;
  overflow-x: clip; /* the tilted card must never widen the page */
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  max-width: 14ch;
}

.lede { font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 40ch; margin: 0 0 2rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.button {
  display: inline-block;
  font: 600 1.0625rem/1 var(--sans);
  padding: 0.95rem 1.4rem;
  border-radius: 4px;
  border: 2px solid var(--ink);
  text-decoration: none;
}
.button.primary { background: var(--ink); color: var(--concrete); }
.button.primary:hover { background: transparent; color: var(--ink); }
.button.quiet { color: var(--ink); background: transparent; }
.button.quiet:hover { background: var(--ink); color: var(--concrete); }

/* ---------- the permit card ---------- */

.permit-stage { position: relative; justify-self: center; width: 100%; max-width: 27rem; }

.permit {
  position: relative;
  background: var(--permit);
  color: var(--permit-ink);
  border-radius: 3px;
  padding: 1.6rem 1.6rem 1.25rem;
  --tilt: -1.6deg;
  transform: rotate(var(--tilt));
  box-shadow: 0 1px 0 rgba(29, 38, 50, 0.25), 0 18px 32px -18px rgba(29, 38, 50, 0.55);
  animation: settle 700ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

@keyframes settle {
  from { transform: translateY(-14px) rotate(calc(var(--tilt) - 2.4deg)); opacity: 0; }
  to { transform: rotate(var(--tilt)); opacity: 1; }
}

/* staples */
.permit::before, .permit::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  width: 1.5rem;
  height: 0.28rem;
  border-radius: 1px;
  background: linear-gradient(#9aa3ad, #6f7882);
}
.permit::before { left: 1.1rem; transform: rotate(-8deg); }
.permit::after { right: 1.1rem; transform: rotate(7deg); }

.permit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 3px solid var(--permit-ink);
  padding: 0.4rem 0 0.6rem;
}
.permit-title {
  /* the one place all caps belongs: it's what the real card says */
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.permit-issuer { font-weight: 600; font-size: 0.95rem; text-align: right; }

.permit-number {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  margin: 0.75rem 0 0.25rem;
  letter-spacing: 0.01em;
}

.permit dl { margin: 0.5rem 0 0; display: grid; grid-template-columns: 7.5rem 1fr; }
.permit dt, .permit dd {
  margin: 0;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(29, 38, 50, 0.28);
}
.permit dt { font-size: 0.875rem; font-weight: 500; padding-top: 0.5rem; }
.permit dd { font-weight: 600; }
.permit .value { font-family: var(--display); font-size: 1.3rem; line-height: 1.2; }

.inspections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 1rem; }
.inspections span {
  border: 1.5px solid var(--permit-ink);
  border-radius: 2px;
  padding: 0.35rem 0.45rem 1.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.permit-caption { margin: 1.4rem 0 0; font-size: 0.9375rem; color: var(--muted); text-align: center; }

.permit.is-empty dd { color: rgba(29, 38, 50, 0.55); }

/* ---------- sections ---------- */

.section { padding: 4rem 0; border-top: 1px solid var(--rule); }

.section h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}
.section .intro { color: var(--muted); max-width: var(--measure); margin: 0 0 2rem; }

.split { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 3rem; }

.fields { margin: 0; display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; }
.fields dt, .fields dd { margin: 0; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.fields dt { font-weight: 600; }
.fields dd { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: 0.9375rem; color: var(--muted); }
td.price { font-family: var(--display); font-weight: 700; font-size: 1.3rem; white-space: nowrap; padding-right: 0; text-align: right; }
th.price { text-align: right; padding-right: 0; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 1rem; }
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.6rem;
}
.steps h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.steps p { margin: 0; color: var(--muted); }

.coverage { list-style: none; margin: 0; padding: 0; }
.coverage li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.coverage .live::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #2f9e5b;
  margin-right: 0.6rem;
  vertical-align: 0.08em;
}
.coverage .soon { color: var(--muted); }
.coverage .meta { color: var(--muted); text-align: right; }

.note { color: var(--muted); font-size: 0.9375rem; max-width: var(--measure); margin: 1.25rem 0 0; }

.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--muted); }

/* ---------- docs page ---------- */

.docs { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; padding-top: 2rem; padding-bottom: 4rem; }
.docs nav { position: sticky; top: 1.5rem; align-self: start; font-size: 0.9375rem; }
.docs nav ul { list-style: none; margin: 0; padding: 0; }
.docs nav li { padding: 0.3rem 0; }
.docs nav a { color: var(--muted); text-decoration: none; }
.docs nav a:hover { color: var(--ink); text-decoration: underline; }

.docs article { max-width: 48rem; }
.docs h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.05; margin: 0 0 1rem; }
.docs h2 { font-family: var(--display); font-weight: 700; font-size: 1.75rem; margin: 3rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.docs h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.docs p, .docs li { max-width: var(--measure); }

.endpoint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; margin: 2.25rem 0 0.5rem; }
.endpoint code { font-size: 1.05rem; font-weight: 600; background: none; padding: 0; overflow-wrap: anywhere; white-space: normal; }
.endpoint .cost { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.endpoint .cost.free { color: #2f7d4e; }

code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; white-space: nowrap; }
pre {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0.75rem 0 1.25rem;
}
pre code { background: none; padding: 0; font-size: inherit; white-space: pre; }

.params td:first-child { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.params td, .params th { font-size: 0.9375rem; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-top: 1.5rem; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .docs nav { position: static; }
  .docs nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
}

@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; }
  .fields dt { border-bottom: 0; padding-bottom: 0; }
  .permit { padding: 1.4rem 1.15rem 1.1rem; }
  .permit dl { grid-template-columns: 6.25rem 1fr; }
  .site-nav a:not(:first-child) { display: none; }
  .permit { --tilt: -1deg; }
  .permit-stage { padding: 0 0.35rem; }
  .permit-title { font-size: 1.3rem; }
  .permit-issuer { font-size: 0.85rem; }
  .permit-number { font-size: 1.7rem; }
  th, td { padding-right: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .permit { animation: none; }
}
