/* Baldrich · Maqueta — white clay model on a cool grey board, one cobalt accent. Archivo (wide) + IBM Plex. */
:root {
  --bg: #eceef0; --paper: #f7f8f9; --ink: #14181c; --ink-2: #4b535b; --muted: #6b737b; --line: rgba(20, 24, 28, .12);
  --accent: #2442e6; --accent-ink: #ffffff; --accent-soft: #e3e8ff; --ok: #1d7a4a; --err: #b42318;
  --stage-a: #f3f5f7; --stage-b: #dde2e7;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif; --body: "IBM Plex Sans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --top: 68px; --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1; }
h1 { font-size: clamp(64px, 8.4vw, 132px); font-weight: 760; font-stretch: 118%; letter-spacing: -.045em; line-height: .86; }
h2 { font-size: clamp(30px, 3vw, 44px); font-weight: 680; font-stretch: 108%; margin: 6px 0 14px; line-height: 1.04; }
h3.sub { font-size: 20px; font-weight: 650; font-stretch: 100%; margin: 34px 0 14px; letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform .2s, background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.small { padding: 9px 16px; font-size: 14px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { box-shadow: 0 10px 26px -12px var(--accent); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn:disabled { opacity: .5; transform: none; }
.chip { border: 0; border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.75); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto; height: var(--top); z-index: 40; display: flex; align-items: center; gap: 22px; padding: 0 22px;
  background: rgba(236, 238, 240, .82); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand b { display: block; font: 720 19px/1 var(--display); font-stretch: 115%; letter-spacing: -.02em; }
.brand small { font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); }
.nav a:hover, .nav a.on { background: rgba(20,24,28,.06); color: var(--ink); }
.menu { display: none; border: 0; background: none; width: 40px; height: 40px; position: relative; }
.menu i { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s; }
.menu i:first-of-type { top: 15px; } .menu i:last-of-type { top: 23px; }
.menu[aria-expanded="true"] i:first-of-type { transform: translateY(4px) rotate(45deg); } .menu[aria-expanded="true"] i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

/* ---------- layout: content left, model sticky right ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); padding-top: var(--top); }
.content { grid-column: 1; grid-row: 1; padding: 0 clamp(22px, 4vw, 64px) 40px; min-width: 0; }
.stage { grid-column: 2; grid-row: 1; position: sticky; top: var(--top); height: calc(100svh - var(--top)); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, var(--stage-a), var(--stage-b)); transition: background 1.2s; border-left: 1px solid var(--line); }
.model { position: absolute; inset: 0; }
.model canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.model.fallback svg { width: 100%; height: 100%; }
.caption { position: absolute; left: 18px; top: 16px; margin: 0; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.caption .mono { font-weight: 500; }
.caption .hint { font-size: 13px; color: var(--ink-2); }
.views { position: absolute; right: 16px; top: 14px; display: flex; gap: 6px; }
.study { position: absolute; left: 16px; bottom: 16px; width: min(330px, calc(100% - 32px)); padding: 12px 14px 10px; border-radius: var(--r); background: rgba(255,255,255,.78); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line); }
.study label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; }
.study-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.study small { color: var(--muted); font-size: 11.5px; }
input[type="range"] { flex: 1; accent-color: var(--accent); height: 22px; }
body.night .caption .hint, body.night .caption .mono { color: #dfe5f2; }

/* model labels (projected from 3D) */
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); font: 500 11.5px/1.2 var(--mono); color: var(--ink); white-space: nowrap;
  padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.7); opacity: .85; transition: opacity .2s; will-change: transform; }
.lbl.hover { background: var(--ink); color: #fff; opacity: 1; }
.lbl.sel { font: 600 14px/1.2 var(--display); font-stretch: 110%; background: var(--accent); color: #fff; padding: 8px 12px 9px; border-radius: 10px; opacity: 1; z-index: 2;
  box-shadow: 0 12px 30px -12px rgba(36,66,230,.7); }
.lbl.sel small { display: block; font: 400 12px/1.35 var(--body); opacity: .9; margin-top: 3px; }
.lbl.sel::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--accent); }
.lbl.hide { opacity: 0; }
.lbl.lola { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 6px 18px -8px rgba(0,0,0,.4); }
body.night .lbl:not(.sel):not(.lola) { background: rgba(14,20,34,.7); color: #e6ebf5; }

/* ---------- content blocks ---------- */
.block { padding: clamp(64px, 9vh, 110px) 0 10px; max-width: 640px; }
.block > p { color: var(--ink-2); margin: 0 0 18px; }
.sheet { color: var(--accent); margin: 0 0 6px; font-weight: 500; }
.intro { padding-top: clamp(48px, 9vh, 110px); }
.lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--ink-2); margin: 30px 0 24px; max-width: 34em; }
.status { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; }
.status li { display: flex; gap: 12px; align-items: baseline; padding: 12px 14px; border-radius: var(--r); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.status li b { font: 500 12px var(--mono); color: var(--muted); min-width: 92px; }
.status li a { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* picker */
.picker { background: var(--paper); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); padding: 10px; }
.picker input { width: 100%; font: inherit; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.streetlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; max-height: 280px; overflow: auto; }
.streetlist button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 8px; font-size: 14.5px; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.streetlist button:hover { background: rgba(20,24,28,.05); }
.streetlist button[aria-selected="true"] { background: var(--accent); color: #fff; }
.streetlist button small { font: 400 11.5px var(--mono); opacity: .65; }
.mystreet { margin-top: 14px; padding: 20px 22px; border-radius: var(--r); background: #fff; box-shadow: 0 1px 0 var(--line), 0 20px 40px -28px rgba(20,24,28,.45); border-top: 4px solid var(--accent); }
.mystreet h3 { font: 720 30px/1 var(--display); font-stretch: 112%; letter-spacing: -.03em; }
.mystreet .who { margin: 10px 0 4px; font-weight: 600; }
.mystreet .story { margin: 0 0 14px; color: var(--ink-2); font-size: 15.5px; }
.mystreet .reps-line { margin: 0 0 16px; font-size: 15px; }
.mystreet .reps-line b { font: 500 12px var(--mono); color: var(--muted); display: block; margin-bottom: 4px; }
.mystreet .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* news + events */
.news { display: grid; gap: 10px; }
.news article, .ev { padding: 18px 20px; border-radius: var(--r); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.news .meta, .ev .meta { font: 500 12px var(--mono); color: var(--muted); display: flex; gap: 10px; margin-bottom: 6px; }
.news .pin { color: var(--accent); }
.news h3, .ev h3 { font: 650 21px/1.15 var(--display); font-stretch: 104%; margin: 0 0 6px; }
.news p, .ev p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.events { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: 74px 1fr; gap: 16px; }
.ev .day { text-align: center; padding-top: 2px; }
.ev .day b { display: block; font: 740 38px/1 var(--display); font-stretch: 110%; }
.ev .day span { font: 500 12px var(--mono); color: var(--muted); }
.ev .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.empty { padding: 18px 20px; border-radius: var(--r); border: 1.5px dashed rgba(20,24,28,.22); color: var(--ink-2); }
.empty b { color: var(--ink); }

/* forms */
.form { display: grid; gap: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(20,24,28,.2); background: #fff; color: var(--ink); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { justify-self: start; margin-top: 4px; }
.cats { border: 0; padding: 0; margin: 0; }
.cats legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; } .cats small { color: var(--muted); font-weight: 400; }
.cats > div { display: flex; flex-wrap: wrap; gap: 6px; }
.cats label { display: inline-flex; position: relative; font-weight: 500; }
.cats input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cats span { padding: 8px 13px; border-radius: 999px; font-size: 14px; background: #fff; box-shadow: inset 0 0 0 1px rgba(20,24,28,.2); cursor: pointer; }
.cats input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.cats input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.b-ok { padding: 12px 14px; border-radius: 10px; background: #e5f4ec; color: var(--ok); font-weight: 600; }
.b-err { padding: 12px 14px; border-radius: 10px; background: #fdecea; color: var(--err); font-weight: 600; }

/* association */
.reps { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; }
.reps dt, .reps dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.reps dt { padding-right: 18px; }
.reps dt button { border: 0; background: none; padding: 0; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(20,24,28,.25); text-underline-offset: 3px; }
.reps dt button:hover { color: var(--accent); }
.reps dd { color: var(--ink-2); }
.reps dd.none { color: var(--muted); font-style: italic; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.history li { display: grid; grid-template-columns: 70px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.history time { font: 740 22px/1.1 var(--display); font-stretch: 110%; color: var(--accent); }
.history b { display: block; margin-bottom: 4px; }
.history p { margin: 0; color: var(--ink-2); font-size: 15px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* useful */
.useful { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.useful a { display: flex; flex-direction: column; padding: 14px 16px; border-radius: var(--r); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: box-shadow .2s; }
.useful a:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.useful b { font: 700 20px var(--display); font-stretch: 108%; }
.useful span { font-size: 14px; color: var(--ink-2); }
.useful li:first-child a { background: var(--ink); color: #fff; } .useful li:first-child span { color: #c9cfd6; }
.foot { margin-top: 70px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.foot p { margin: 4px 0; }

dialog { border: 0; border-radius: 18px; padding: 26px; width: min(440px, calc(100% - 28px)); box-shadow: 0 40px 80px -30px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(14, 18, 24, .45); backdrop-filter: blur(3px); }
dialog h3 { font: 680 24px var(--display); margin: 0 0 16px; }
dialog form.x { position: absolute; right: 12px; top: 10px; }
dialog form.x button { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); }

/* ---------- mobile: model on top, content below ---------- */
@media (max-width: 900px) {
  :root { --top: 60px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand small { display: none; }
  .menu { display: block; }
  .nav { position: fixed; top: var(--top); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 12px 14px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; }
  .layout { grid-template-columns: 1fr; }
  .stage { grid-column: 1; grid-row: 1; position: relative; top: 0; height: 62svh; min-height: 420px; border-left: 0; border-bottom: 1px solid var(--line); }
  .content { grid-row: 2; }
  .study { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 10px 12px 8px; }
  .study small { display: none; }
  .caption { left: 12px; top: 12px; } .views { right: 10px; top: 10px; }
  .caption { display: none; }
  .top .btn { margin-left: auto; }
  .form .two { grid-template-columns: 1fr; }
  .useful { grid-template-columns: 1fr; }
  .lbl:not(.sel):not(.lola):not(.hover) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01s !important; scroll-behavior: auto !important; } }
