/* CasaVision desktop — full-page web layout. The phone frame is gone:
   the page itself is the cream surface, with a sticky topbar and
   centered content using screen-appropriate widths. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: #F5F0E8;
  color: #1A1A1A;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}
body[data-cv-dark="1"] {
  background: #161614;
  color: #F5F0E8;
}
::-webkit-scrollbar { width: 0; height: 0; }
* { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Top bar ---------- */
.cv-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
  padding: 14px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
body[data-cv-dark="1"] .cv-topbar {
  background: rgba(22, 22, 20, 0.9);
  border-bottom-color: rgba(245, 240, 232, 0.08);
}
.cv-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #1A1A1A;
  text-decoration: none;
}
body[data-cv-dark="1"] .cv-topbar .brand { color: #F5F0E8; }
.cv-topbar .brand em {
  color: #E8684A;
  font-style: italic;
  font-weight: 400;
}
.cv-topbar .brand svg { flex-shrink: 0; }

.cv-topbar nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.cv-topbar nav button {
  all: unset;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.62);
  letter-spacing: -0.005em;
  transition: color 0.15s;
}
.cv-topbar nav button:hover { color: #1A1A1A; }
.cv-topbar nav button.active { color: #E8684A; }
body[data-cv-dark="1"] .cv-topbar nav button { color: rgba(245, 240, 232, 0.65); }
body[data-cv-dark="1"] .cv-topbar nav button:hover { color: #F5F0E8; }

.cv-topbar .right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cv-topbar .avatar {
  width: 34px; height: 34px;
  border-radius: 17px;
  background: #1A1A1A;
  color: #F5F0E8;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  position: relative;
}
.cv-topbar .avatar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #E8684A;
  border: 1.5px solid #F5F0E8;
}
body[data-cv-dark="1"] .cv-topbar .avatar { background: #F5F0E8; color: #1A1A1A; }
body[data-cv-dark="1"] .cv-topbar .avatar::after { border-color: #161614; }

/* ---------- Stage / page content ---------- */
.cv-page {
  width: 100%;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 56px) 80px;
  display: flex;
  justify-content: center;
}

/* Inner components keep their inline-style padding (24px). The PhoneFrame
   sets max-width per screen — see SCREEN_MAXW in components.js. */

/* Hide the inline brand header that some screens (Pick, Capture) render
   for the phone version — the desktop topbar already shows brand + avatar. */
[data-cv-internal-brand] { display: none !important; }

/* The mobile prototype reserves 70px at the top for the iPhone status
   bar. On desktop there's no status bar — clamp that to ~24px so content
   sits naturally below the topbar. Targets the first inline-style header
   inside each screen. */
[data-cv-stage] > div > div:first-of-type[style*="70px"]:not([data-cv-internal-brand]) {
  padding-top: 32px !important;
}

/* ---------- Pick Report — two cards side-by-side on desktop ---------- */
@media (min-width: 880px) {
  [data-cv-screen="Pick"] [data-cv-cards] {
    flex-direction: row !important;
    align-items: stretch;
    gap: 20px !important;
  }
  [data-cv-screen="Pick"] [data-cv-cards] > button {
    flex: 1 1 0;
    min-width: 0;
  }
  [data-cv-screen="Pick"] [data-cv-cards] > button > div {
    height: 100%;
  }
}

/* ---------- Projects — grid layout on desktop ---------- */
@media (min-width: 880px) {
  [data-cv-screen="Projects"] [data-cv-projects] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px !important;
  }
}
@media (min-width: 1100px) {
  [data-cv-screen="Projects"] [data-cv-projects] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Footer ---------- */
.cv-footer {
  text-align: center;
  padding: 32px 24px 56px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.4);
}
body[data-cv-dark="1"] .cv-footer { color: rgba(245, 240, 232, 0.4); }
.cv-footer span { color: #E8684A; }

/* ---------- Dev nav strip — only visible with ?dev=1 in URL ---------- */
.nav-strip {
  display: none;
  position: fixed;
  top: 88px;
  left: 16px;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(26, 26, 26, 0.06);
}
body[data-cv-dev="1"] .nav-strip { display: flex; }
body[data-cv-dark="1"][data-cv-dev="1"] .nav-strip {
  background: rgba(245, 240, 232, 0.08);
  border-color: rgba(245, 240, 232, 0.1);
  color: rgba(245, 240, 232, 0.7);
}
.nav-strip .label { color: #E8684A; font-weight: 600; margin-bottom: 6px; }
.nav-strip button {
  all: unset;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  color: rgba(26, 26, 26, 0.5);
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
body[data-cv-dark="1"] .nav-strip button { color: rgba(245, 240, 232, 0.5); }
.nav-strip button:hover { background: rgba(26, 26, 26, 0.05); }
body[data-cv-dark="1"] .nav-strip button:hover { background: rgba(245, 240, 232, 0.06); }
.nav-strip button.active { color: #E8684A; }

.hint { display: none; }

@keyframes casaPop {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Compact down to mobile */
@media (max-width: 720px) {
  .cv-topbar nav { display: none; }
  .cv-topbar { padding: 12px 18px; }
  .cv-page { padding: 18px 14px 60px; }
}
