/* Casaverso portal — blueprint identity of the commercial deck: ink ground, paper line work, amber annotation */
:root {
  --bg: #eef3f7; --surface: #ffffff; --line: #cbd9e4; --fg: #0b2239; --muted: #4f6a82; --accent: #b0700a;
  --accent-ink: #ffffff; --accent-fill: #f3b64a; --err: #b3361b; --err-bg: #fbe9e4; --grid: rgba(11, 34, 57, .06);
  --shadow: 0 1px 0 rgba(11, 34, 57, .06), 0 18px 40px -24px rgba(11, 34, 57, .35);
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b2239; --surface: #10304f; --line: #23486b; --fg: #eaf2f8; --muted: #a3bdd2; --accent: #f3b64a;
    --accent-ink: #0b2239; --accent-fill: #f3b64a; --err: #ffb4a0; --err-bg: rgba(255, 138, 106, .12); --grid: rgba(150, 196, 230, .075);
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 24px 48px -28px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b2239; --surface: #10304f; --line: #23486b; --fg: #eaf2f8; --muted: #a3bdd2; --accent: #f3b64a;
  --accent-ink: #0b2239; --accent-fill: #f3b64a; --err: #ffb4a0; --err-bg: rgba(255, 138, 106, .12); --grid: rgba(150, 196, 230, .075);
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 24px 48px -28px rgba(0, 0, 0, .7); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); font-stretch: 112%; letter-spacing: -.01em; text-decoration: none; }
.wordmark svg { width: 26px; height: 26px; flex: none; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr); min-height: 100%; }
.hero { position: relative; overflow: hidden; background: #0b2239; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 60%; }
/* the one moment: the drawing (blueprint grid) wipes away to reveal the rendered house */
.hero .sheet {
  position: absolute; inset: 0; background-color: #0b2239;
  background-image: linear-gradient(rgba(150, 196, 230, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 196, 230, .16) 1px, transparent 1px),
                    linear-gradient(rgba(150, 196, 230, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 196, 230, .07) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  clip-path: inset(0 0 0 0); animation: reveal 1.6s cubic-bezier(.7, 0, .2, 1) .35s forwards;
}
@keyframes reveal { to { clip-path: inset(0 0 0 100%); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 34, 57, 0) 55%, rgba(11, 34, 57, .75)); pointer-events: none; }
.dim { position: absolute; left: 6%; right: 6%; bottom: 44px; z-index: 1; color: #f3b64a; font: 500 13px/1 var(--mono); }
.dim .rule { position: relative; height: 1px; background: currentColor; transform-origin: left; animation: draw 1.1s ease-out 1.5s both; }
.dim .rule::before, .dim .rule::after { content: ""; position: absolute; top: -6px; width: 1px; height: 13px; background: currentColor; }
.dim .rule::before { left: 0; } .dim .rule::after { right: 0; }
.dim span { display: block; text-align: center; margin-top: 10px; letter-spacing: .04em; animation: fade .6s ease 2.4s both; }
.hero .cap { position: absolute; left: 6%; bottom: 96px; z-index: 1; color: #eaf2f8; max-width: 28ch; font: 500 15px/1.4 var(--body); opacity: .92; animation: fade .6s ease 2.4s both; }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes fade { from { opacity: 0; } }

.pane { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px clamp(24px, 5vw, 72px); background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.pane main { width: 100%; max-width: 400px; }
.pane h1 { font: 700 clamp(34px, 3.6vw, 46px)/1.04 var(--display); font-stretch: 108%; letter-spacing: -.02em; margin: 0 0 12px; text-wrap: balance; }
.pane .lede { color: var(--muted); margin: 0 0 32px; max-width: 36ch; }
form { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.field { position: relative; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg);
  font: 400 16px var(--body); transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[aria-invalid=true] { border-color: var(--err); }
.reveal-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; }
.reveal-pw:hover { color: var(--fg); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-fill); margin: 0; }
.hint { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 22px; border: 0; border-radius: 8px;
  background: var(--accent-fill); color: #0b2239; font: 700 16px var(--body); cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.05); } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.error { display: none; padding: 12px 14px; border-radius: 8px; background: var(--err-bg); color: var(--err); font-size: 14px; font-weight: 500; }
.error.on { display: block; }
.pane footer { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .hero { height: 38vh; min-height: 220px; }
  .hero .cap { display: none; }
  .dim { bottom: 22px; }
  .pane { gap: 28px; padding-block: 28px; }
}

/* ---------- projects ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 0; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent-fill) 22%, transparent); color: var(--accent); font: 700 12px var(--body); }
.badge[hidden] { display: none; }   /* display above beats the UA [hidden] rule: clients saw "Admin" */
.wrap { max-width: 1180px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 64px; }
.greet h1 { font: 700 clamp(30px, 4vw, 44px)/1.08 var(--display); font-stretch: 108%; letter-spacing: -.02em; margin: 0 0 6px; }
.greet p { margin: 0 0 32px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.card .cover { position: relative; aspect-ratio: 16 / 10; background: #0b2239; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; transition: transform .6s ease; }
.card:hover .cover img { transform: scale(1.025); }
.card .body { display: grid; gap: 14px; align-content: start; padding: 20px 22px 22px; }
.card h2 { font: 700 24px/1.15 var(--display); font-stretch: 106%; margin: 0; letter-spacing: -.01em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); font-size: 14px; }
.facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.facts dd { margin: 0; }
.facts .area { font-family: var(--mono); font-size: 13px; color: var(--fg); }
.phase { justify-self: start; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.net { color: var(--muted); font-size: 13px; }
.grid.one { grid-template-columns: 1fr; }
.grid.one .card { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); grid-template-rows: none; }
.grid.one .card .cover { aspect-ratio: auto; min-height: 380px; }
.grid.one .card .body { align-content: center; padding: 36px; gap: 18px; }
.grid.one .card h2 { font-size: clamp(28px, 3vw, 38px); }
.empty { padding: 48px 24px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--fg); font-size: 18px; margin-bottom: 6px; }
.skeleton { height: 380px; border-radius: 12px; background: linear-gradient(90deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--line)), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 860px) {
  .grid.one .card { grid-template-columns: 1fr; }
  .grid.one .card .cover { min-height: 0; aspect-ratio: 16 / 10; }
  .grid.one .card .body { padding: 22px; }
  .who .mail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}
