/* Sound Neighbor: calm, neighborly, high legibility. Fonts are self-hosted (OFL). */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/bricolage-grotesque-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ground: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #1F2A24;
  --accent: #2F6B5E;
  --accent-dark: #24554A;
  --accent-soft: rgba(47, 107, 94, 0.18);
  --border: #C9D0CB;
  --text-2: #3E4842;
  --text-3: #4A544E;
  --error: #A3261B;
  --error-bg: #FBEDEB;
  --warn-bg: #FFF7E0;
  --warn-border: #C99A2E;
  --radius: 14px;
  --body-font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display-font: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
  color-scheme: light;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1, h2 {
  font-family: var(--display-font);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
h1 { font-size: clamp(1.6rem, 6vw, 2rem); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }

p { margin: 0 0 0.75rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-dark); }

code { font-size: 0.95em; background: var(--ground); padding: 0.1em 0.3em; border-radius: 4px; }
code.break { word-break: break-all; }

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

.page-head { margin-bottom: 1.25rem; }
.eyebrow {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.875rem;
}
.sub { color: var(--text-2); font-size: 1.0625rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card:focus { outline: none; }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card.warn { background: var(--warn-bg); border-color: var(--warn-border); }

/* ---- Form controls ---- */

.field { margin-bottom: 1rem; }
label { display: block; font-weight: 700; margin-bottom: 0.15rem; }
.optional { font-weight: 400; color: var(--text-3); }
.hint { color: var(--text-3); font-size: 0.9375rem; margin-bottom: 0.4rem; }

input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
}
input[type="text"]:focus-visible { border-color: var(--accent); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--error); }
input[readonly] { background: var(--ground); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button.primary, .button.primary {
  background: var(--accent);
  color: #fff;
}
button.primary:hover:not(:disabled) { background: var(--accent-dark); }
button.secondary, .button.secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
button.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
button:disabled {
  background: var(--border);
  color: var(--text-2);
  cursor: not-allowed;
}
button.wide { width: 100%; }

.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row button { flex: none; }

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

.error {
  color: var(--error);
  background: var(--error-bg);
  border-left: 4px solid var(--error);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-weight: 700;
}
.status { min-height: 1.5em; color: var(--text-2); }
.status.error { min-height: 0; }

/* ---- Neighbor page ---- */

.levels { display: grid; gap: 0.75rem; margin-bottom: 1rem; }

.level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  min-height: 64px;
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 400;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.level:hover { border-color: var(--accent); }
.level[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.level-title { font-weight: 700; font-size: 1.125rem; }
.level-detail { color: var(--text-2); font-size: 0.9375rem; }
.level[aria-pressed="true"] .level-title::before {
  content: "✓ ";
  color: var(--accent);
}

.fine { color: var(--text-3); font-size: 0.9375rem; margin-top: 1rem; }

#send { margin-top: 0.25rem; }
#sent h2 { font-size: 1.5rem; }

/* ---- Setup / owner ---- */

.steps { padding-left: 1.25rem; margin: 0; }
.steps > li { margin-bottom: 1.25rem; }
.steps > li > strong { display: block; margin-bottom: 0.35rem; }
.store-links { display: block; }
.store-links a { display: inline-block; padding: 0.4rem 0; }

.qr { width: 180px; max-width: 100%; margin: 0.25rem 0 0.75rem; }
.qr svg { display: block; width: 100%; height: auto; }

details { margin-bottom: 0.75rem; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 700; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; margin: 0 0 0.5rem; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; min-width: 0; }

.notes { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.notes li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.notes li:last-child { border-bottom: none; }
.note-time { color: var(--text-2); min-width: 4.5rem; }
.note-level { font-weight: 700; }

@media (max-width: 360px) {
  .wrap { padding-left: 0.75rem; padding-right: 0.75rem; }
  .card { padding: 1rem; }
  .copy-row { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .level, button { transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
}
