/* =====================================================================
   Nose · Neighbor — stylesheet
   The Daily Dispatch: editorial broadsheet × Wes Anderson × Notion calm.
   ===================================================================== */

:root {
  /* Palette: newspaper surfaces with modern hazard-yellow accents. */
  --paper:        #F6EED1;
  --paper-edge:   #EBE0B8;
  --ink:          #1F1B16;
  --ink-muted:    #5A5045;
  --rule:         #DDD0A8;
  --terracotta:   #F4D84A;
  --terracotta-2: #E0C338;
  --sage:         #7A8C5C;
  --mustard:      #C9962B;
  --danger:       #8B2F1F;
  --warning:      #76591D;
  --success:      #4F6D3D;
  --white:        #1F1B16;

  /* Type */
  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --rhythm: 1.6rem;
  --radius: 6px;
  --shadow-sm: 0 1px 0 rgba(31,27,22,0.06);
  --shadow-press: 0 6px 0 var(--paper-edge), 0 8px 18px rgba(31,27,22,0.10);
  --shadow-pressed: 0 1px 0 var(--paper-edge), 0 2px 6px rgba(31,27,22,0.10);
}

@media (prefers-color-scheme: dark) {
  /* Lean into the print metaphor: keep the field bright, not the room. */
  :root {
    --paper:      #1B1813;
    --paper-edge: #100E0A;
    --ink:        #F2EAD9;
    --ink-muted:  #B6A990;
    --rule:       #3A332A;
    --white:      #1F1B16;
    --terracotta: #F4D84A;
    --terracotta-2: #D8BA28;
    --sage:       #A2B47C;
    --danger:     #F08B72;
    --warning:    #E3C36C;
    --success:    #B9D18D;
  }
}

/* ---------- Reset & globals ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100svh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
hr { border: 0; }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(31,27,22,0.05) 1px, transparent 1px),
    radial-gradient(rgba(31,27,22,0.04) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  opacity: .25;
  z-index: 0;
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: .15; }
}

/* ---------- Typography helpers ---------- */
.mono   { font-family: var(--mono); font-variant-ligatures: none; }
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.4rem;
}
.small  { font-size: 0.78rem; }

/* ---------- Layout: paper sheet ---------- */
.paper {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) calc(var(--gutter) * 2);
}
.screen {
  transform: translateY(0);
  opacity: 1;
}
.screen.is-entering {
  animation: screen-enter 360ms cubic-bezier(.19, 1, .22, 1) both;
}
.screen.is-exiting {
  position: absolute;
  inset: var(--gutter) var(--gutter) auto;
  width: calc(100% - (var(--gutter) * 2));
  pointer-events: none;
  animation: screen-exit 320ms cubic-bezier(.19, 1, .22, 1) both;
}
@keyframes screen-enter {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes screen-exit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-0.35rem); }
}

.masthead {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 2.6rem) var(--gutter) 0.8rem;
  text-align: center;
}

.masthead__rules {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0.1rem;
  margin-bottom: 1.2rem;
}

.logotype {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.18em;
}
.logotype__dot {
  color: var(--terracotta);
  font-weight: 400;
  transform: translateY(-0.05em);
}

.pronunciation {
  margin: 0.65rem 0 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tagline {
  margin: 0.28rem 0 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.08rem, 3.4vw, 1.25rem);
  font-weight: 400;
  color: var(--ink-muted);
}

.rule {
  height: 1px;
  background: var(--rule);
  margin: 1.4rem 0;
}
.rule--double {
  height: 4px;
  background:
    linear-gradient(var(--rule), var(--rule)) top/100% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) bottom/100% 1px no-repeat;
  background-color: transparent;
  margin: 0 0 1.2rem;
}

/* ---------- Section copy ---------- */
.lede {
  font-family: var(--serif);
  font-weight: 800;
  font-variation-settings: "opsz" 144;
  font-size: clamp(1.85rem, 6.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0.1rem 0 0.7rem;
}

.body {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 1.2rem;
  max-width: 56ch;
}

.footnote {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  background: rgba(255,252,246,0.4);
  border-radius: var(--radius);
}
@media (prefers-color-scheme: dark) {
  .footnote { background: rgba(255,255,255,0.03); }
}
.footnote .body { font-size: 0.95rem; margin: 0; color: var(--ink-muted); }

/* ---------- The big report button (the seal) ---------- */
.report-btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;

  width: 100%;
  margin: 1.6rem 0 1rem;
  padding: 1.6rem 1.2rem 1.5rem;

  background: var(--terracotta);
  color: var(--white);
  border: 2px solid var(--terracotta-2);
  border-radius: 14px;
  box-shadow: var(--shadow-press);

  font-family: var(--serif);
  font-weight: 800;
  font-variation-settings: "opsz" 144;
  font-size: clamp(1.5rem, 6vw, 1.95rem);
  letter-spacing: 0.005em;
  line-height: 1;
  text-transform: none;

  transition: transform 60ms ease, box-shadow 60ms ease, background 200ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.report-btn:hover { background: var(--terracotta-2); }
.report-btn:active,
.report-btn.is-pressed {
  transform: translateY(4px);
  box-shadow: var(--shadow-pressed);
}
.report-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.report-btn[disabled] {
  opacity: 0.65;
  cursor: progress;
}
button[disabled] { cursor: progress; }

.report-btn__seal {
  display: inline-flex;
  margin-bottom: 0.2rem;
  color: var(--white);
  opacity: 0.92;
}
.report-btn__label { display: block; }
.report-btn__sub {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- Status line ---------- */
.status {
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-align: center;
  margin: 0.4rem 0;
  letter-spacing: 0.04em;
  min-height: 1.2em;
}
.status[data-tone="progress"] { color: var(--warning); }
.status[data-tone="success"]  { color: var(--success); }
.status[data-tone="warning"]  { color: var(--warning); }
.status[data-tone="error"]    { color: var(--danger); }

/* ---------- FILED stamp ---------- */
.filed-stamp {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--serif);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  color: var(--terracotta);
  border: 4px double currentColor;
  padding: 0.4rem 1.2rem 0.5rem;
  margin: 0.4rem 0 1.4rem;
  transform: rotate(-6deg) translateY(-4px) scale(0.6);
  opacity: 0;
  filter: blur(0.3px);
}
.filed-stamp::before, .filed-stamp::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.15;
  border-radius: 50%;
  pointer-events: none;
}
.filed-stamp::before { width: 6px; height: 6px; top: -3px; left: 14%; }
.filed-stamp::after  { width: 4px; height: 4px; bottom: -2px; right: 22%; }
.filed-stamp__date {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  margin-top: 0.15rem;
  opacity: 0.85;
}
.filed-stamp.is-landed {
  animation: stamp-land 480ms cubic-bezier(.19,1,.22,1) forwards;
}
@keyframes stamp-land {
  0%   { transform: rotate(-12deg) translateY(-14px) scale(1.08); opacity: 0; }
  70%  { transform: rotate(-6deg)  translateY(0)     scale(1);    opacity: 1; }
  100% { transform: rotate(-6deg)  translateY(0)     scale(1);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .filed-stamp { transform: rotate(-6deg); opacity: 1; }
  .filed-stamp.is-landed { animation: none; }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
  .screen.is-entering,
  .screen.is-exiting { animation: none; }
}

/* ---------- Dispatch readout ---------- */
.readout {
  margin: 1.4rem 0 1.6rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.readout__row {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 0.7rem;
  padding: 0.7rem 0.1rem;
  border-bottom: 1px dashed var(--rule);
  align-items: baseline;
}
.readout__row:last-child { border-bottom: 0; }
.readout dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.readout dd {
  margin: 0;
  font-size: 1rem;
  word-break: break-word;
}
.readout dd .conf {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

#quip {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

/* ---------- Addendum (details collapsible) ---------- */
.addendum {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255,252,246,0.55);
  margin: 0 0 1.2rem;
}
@media (prefers-color-scheme: dark) {
  .addendum { background: rgba(255,255,255,0.03); }
}
.addendum > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
}
.addendum > summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.addendum > summary::-webkit-details-marker { display: none; }
.addendum > summary .kicker { grid-column: 1 / 2; margin: 0 0 0.15rem; }
.addendum__title {
  grid-column: 1 / 2;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
}
.addendum__chev {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--ink-muted);
  transition: transform 200ms ease;
}
.addendum[open] .addendum__chev { transform: rotate(180deg); }

/* ---------- Form ---------- */
.form {
  padding: 0.2rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.field__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field__hint { font-size: 0.82rem; color: var(--ink-muted); margin: 0; }
.input,
.form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color 120ms;
}
.form textarea { resize: vertical; min-height: 3.6em; line-height: 1.5; }
.input:focus,
.form textarea:focus {
  outline: 0;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201,98,46,0.15);
}
.field--contact .input:not(:first-of-type) { margin-top: 0.5rem; }

/* Severity */
.severity { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.severity__opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-height: 54px;
  padding: 0.65rem 0.2rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: border-color 120ms, background 120ms, color 120ms;
}
.severity__opt input { position: absolute; opacity: 0; pointer-events: none; }
.severity__opt:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.severity__opt span {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}
.severity__opt em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.severity__opt:has(input:checked) {
  background: var(--terracotta);
  border-color: var(--terracotta-2);
  color: var(--white);
}
.severity__opt:has(input:checked) em { color: rgba(255,255,255,0.85); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.chip:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Buttons */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.2rem;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition: background 140ms, border-color 140ms, transform 60ms;
}
.btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.btn[disabled] { opacity: 0.62; }
.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover { background: #000; }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
  width: 100%;
  margin-top: 0.4rem;
}
.btn--ghost:hover { border-color: var(--ink-muted); }

/* ---------- Colophon ---------- */
.colophon {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--gutter) * 2);
  text-align: center;
  color: var(--ink-muted);
}
.colophon .body { margin: 0 auto 0.6rem; font-size: 0.88rem; }
.colophon .small { opacity: 0.8; }

/* ---------- Misc ---------- */
::selection { background: var(--mustard); color: var(--ink); }

/* Mobile tightening */
@media (max-width: 480px) {
  .readout__row { grid-template-columns: 7.5em 1fr; gap: 0.5rem; }
  .severity__opt em { display: none; }
}
