/* ============================================================
   Proto P button + Connect modal + biomarker personalization
   Scoped to /porzana — uses Porzana palette (oxblood + ember)
   ============================================================ */

/* P button in nav (added before .nav__cta) */
.proto-p-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(193, 74, 43, 0.28);
  background: rgba(193, 74, 43, 0.06);
  color: #c14a2b;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  padding: 0;
  letter-spacing: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  position: relative;
}
.proto-p-btn:hover {
  background: rgba(193, 74, 43, 0.14);
  border-color: rgba(193, 74, 43, 0.45);
  color: #d96a4d;
}
.proto-p-btn:active { transform: scale(0.96); }
.proto-p-btn:focus-visible {
  outline: 2px solid #c14a2b;
  outline-offset: 2px;
}

/* Connected state — shifts to a soft sage/ember mix to read clearly on dark */
.proto-p-btn.is-connected {
  background: rgba(176, 122, 62, 0.16);
  border-color: rgba(176, 122, 62, 0.55);
  color: #d4a972;
}
.proto-p-btn.is-connected::after {
  content: '';
  position: absolute;
  top: -2px; right: -2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #c14a2b;
  box-shadow: 0 0 0 2px #0e0807, 0 0 10px rgba(193, 74, 43, 0.65);
}

/* Mobile — slightly smaller and tucked in */
@media (max-width: 720px) {
  .proto-p-btn { width: 36px; height: 36px; font-size: 19px; margin-right: 8px; }
}

/* ===== Modal overlay ===== */
.proto-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 4, 3, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.proto-overlay.is-open { display: flex; opacity: 1; }

.proto-modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #1a0f0c;
  border: 1px solid rgba(236, 231, 221, 0.10);
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(193, 74, 43, 0.05);
  padding: 36px;
  color: #ece7dd;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.proto-overlay.is-open .proto-modal { transform: translateY(0) scale(1); }

@media (max-width: 540px) {
  .proto-modal { padding: 28px 22px; border-radius: 12px; }
}

.proto-modal__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.proto-modal__icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(193, 74, 43, 0.10);
  border: 1px solid rgba(193, 74, 43, 0.32);
  color: #c14a2b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  flex-shrink: 0;
}
.proto-modal__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  color: #ece7dd;
  margin: 0;
  line-height: 1.1;
}
.proto-modal__subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aa9e8a;
  margin-top: 4px;
}

.proto-modal__close {
  position: absolute;
  top: 18px; right: 18px;
  background: transparent;
  border: none;
  color: #aa9e8a;
  font-size: 20px;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.proto-modal__close:hover { background: rgba(236, 231, 221, 0.06); color: #ece7dd; }

.proto-modal { position: relative; }

.proto-body {
  font-size: 15px;
  line-height: 1.6;
  color: #d4cfc4;
}
.proto-body p { margin: 0 0 14px 0; }
.proto-body p:last-child { margin-bottom: 0; }
.proto-body strong { color: #ece7dd; font-weight: 500; }

.proto-checklist {
  margin: 20px 0;
  padding: 18px 20px;
  background: rgba(236, 231, 221, 0.03);
  border: 1px solid rgba(236, 231, 221, 0.08);
  border-radius: 10px;
}
.proto-checklist__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aa9e8a;
  margin-bottom: 10px;
}
.proto-checklist ul { list-style: none; padding: 0; margin: 0; }
.proto-checklist li {
  font-size: 14px;
  color: #d4cfc4;
  padding: 5px 0 5px 22px;
  position: relative;
}
.proto-checklist li::before {
  content: '';
  position: absolute;
  left: 0; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c14a2b;
}

.proto-privacy {
  font-size: 12px;
  color: #aa9e8a;
  line-height: 1.55;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(236, 231, 221, 0.06);
}
.proto-privacy a { color: #b07a3e; text-decoration: none; border-bottom: 1px solid transparent; }
.proto-privacy a:hover { border-bottom-color: #b07a3e; }

.proto-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.proto-btn {
  flex: 1 1 auto;
  min-width: 130px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.proto-btn--primary {
  background: #c14a2b;
  color: #fff;
  border-color: #c14a2b;
}
.proto-btn--primary:hover { background: #d96a4d; border-color: #d96a4d; }
.proto-btn--ghost {
  background: transparent;
  color: #ece7dd;
  border-color: rgba(236, 231, 221, 0.18);
}
.proto-btn--ghost:hover { background: rgba(236, 231, 221, 0.05); border-color: rgba(236, 231, 221, 0.32); }

/* ===== Loading state ===== */
.proto-loading {
  text-align: center;
  padding: 12px 0 8px;
}
.proto-loading__spinner {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(193, 74, 43, 0.08);
  border: 1px solid rgba(193, 74, 43, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  color: #c14a2b;
  position: relative;
  margin-bottom: 18px;
}
.proto-loading__spinner::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid transparent;
  border-top-color: #c14a2b;
  animation: protoSpin 0.9s linear infinite;
}
@keyframes protoSpin {
  to { transform: rotate(360deg); }
}
.proto-loading__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: #ece7dd;
  margin: 0 0 6px;
}
.proto-loading__text {
  font-size: 14px;
  color: #aa9e8a;
}

/* ===== Connected summary state ===== */
.proto-summary {
  margin-top: 4px;
}
.proto-summary__panel {
  margin: 18px 0 22px;
  padding: 18px 20px;
  background: rgba(193, 74, 43, 0.06);
  border: 1px solid rgba(193, 74, 43, 0.22);
  border-radius: 10px;
}
.proto-summary__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aa9e8a;
  margin-bottom: 10px;
}
.proto-summary__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.proto-summary__chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(236, 231, 221, 0.05);
  border: 1px solid rgba(236, 231, 221, 0.10);
  color: #d4cfc4;
}
.proto-summary__chip--high { background: rgba(193, 74, 43, 0.14); border-color: rgba(193, 74, 43, 0.42); color: #e89178; }
.proto-summary__chip--low  { background: rgba(176, 122, 62, 0.14); border-color: rgba(176, 122, 62, 0.42); color: #d4a972; }

.proto-recs {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}
.proto-recs__item {
  display: grid;
  grid-template-columns: 24px 60px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(236, 231, 221, 0.06);
}
.proto-recs__item:first-child { border-top: none; }
.proto-recs__rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: #c14a2b;
  padding-top: 4px;
}
.proto-recs__media {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(236, 231, 221, 0.05);
  border: 1px solid rgba(236, 231, 221, 0.08);
}
.proto-recs__media--ease {
  filter: grayscale(0.6) brightness(0.78);
  opacity: 0.78;
}
.proto-recs__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proto-recs__body {
  min-width: 0;
}
.proto-recs__pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  margin-bottom: 5px;
}
.proto-recs__pill--rec {
  background: rgba(193, 74, 43, 0.16);
  border: 1px solid rgba(193, 74, 43, 0.42);
  color: #e89178;
}
.proto-recs__pill--ease {
  background: rgba(170, 158, 138, 0.10);
  border: 1px solid rgba(170, 158, 138, 0.28);
  color: #aa9e8a;
}
.proto-recs__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  color: #ece7dd;
  line-height: 1.25;
  margin: 0 0 3px;
}
.proto-recs__why {
  font-size: 13px;
  color: #aa9e8a;
  line-height: 1.5;
}

/* ===== Error state ===== */
.proto-error {
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(193, 74, 43, 0.08);
  border: 1px solid rgba(193, 74, 43, 0.28);
  color: #e89178;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.proto-error strong { color: #ece7dd; font-weight: 500; }

/* ===== Personalization markers — appear on dish/mode cards when connected ===== */

/* Personalized dish badge */
.dish__card { position: relative; }
.proto-tag {
  display: none; /* hidden until body.proto-connected */
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(193, 74, 43, 0.92);
  color: #fff;
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.proto-tag--rec  { background: rgba(193, 74, 43, 0.92); }
.proto-tag--ease { background: rgba(176, 122, 62, 0.92); }

body.proto-connected .proto-tag { display: inline-block; }

/* Inline ember-red insight line under dish title */
.proto-note {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  border-left: 2px solid #c14a2b;
  background: rgba(193, 74, 43, 0.06);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #d4cfc4;
  border-radius: 0 6px 6px 0;
}
.proto-note strong { color: #ece7dd; font-weight: 500; }
body.proto-connected .proto-note { display: block; }

/* When connected, brand badge gets ember dot + "Personalized" */
.proto-personalized-banner {
  display: none;
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: rgba(26, 15, 12, 0.92);
  border: 1px solid rgba(193, 74, 43, 0.42);
  backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ece7dd;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.75);
  align-items: center;
  gap: 10px;
}
.proto-personalized-banner::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #c14a2b;
  box-shadow: 0 0 8px rgba(193, 74, 43, 0.7);
  display: inline-block;
}
.proto-personalized-banner button {
  background: transparent;
  border: none;
  color: #aa9e8a;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0 0 0 8px;
  letter-spacing: 0.10em;
  border-left: 1px solid rgba(236, 231, 221, 0.15);
  margin-left: 4px;
}
.proto-personalized-banner button:hover { color: #ece7dd; }
body.proto-connected .proto-personalized-banner { display: inline-flex; }

/* ============================================================ */
/* Tornado tint overrides — supper-club oxblood + amber          */
/* ============================================================ */
#pbtn.is-connected, .pbtn.is-connected {
  border-color: var(--accent-2, #d68a3a) !important;
  color: var(--accent-2, #d68a3a) !important;
  box-shadow: 0 0 0 4px var(--ring, rgba(214,138,58,0.18)) !important;
}
#pbtn.is-connected::after, .pbtn.is-connected::after {
  content:''; position:absolute; top:-2px; right:-2px; width:9px; height:9px;
  border-radius:50%; background:var(--accent, #b8341c);
  box-shadow:0 0 0 2px var(--bg, #0a0606), 0 0 10px rgba(184,52,28,0.65);
}
.proto-modal__icon { background:var(--accent,#b8341c)!important; color:var(--text,#f0e7d6)!important; }
.proto-summary__chip--high { border-color:rgba(184,52,28,0.45)!important; background:rgba(184,52,28,0.10)!important; color:#e08a72!important; }
.proto-summary__chip--low { border-color:rgba(214,138,58,0.45)!important; background:rgba(214,138,58,0.10)!important; color:var(--accent-2,#d68a3a)!important; }
.proto-btn--primary { background:var(--accent,#b8341c)!important; border-color:var(--accent,#b8341c)!important; color:var(--text,#f0e7d6)!important; }
.proto-btn--primary:hover { background:var(--accent-soft,#d6442a)!important; border-color:var(--accent-soft,#d6442a)!important; }
.proto-tag--rec { background:rgba(214,138,58,0.12)!important; color:var(--accent-2,#d68a3a)!important; border-color:rgba(214,138,58,0.4)!important; }
.proto-tag--ease { background:rgba(178,160,138,0.10)!important; color:var(--text-muted,#b2a08a)!important; border-color:rgba(178,160,138,0.3)!important; }
.proto-recs__rank { color:var(--accent-2,#d68a3a)!important; }
.proto-recs__pill--rec { background:rgba(214,138,58,0.14)!important; color:var(--accent-2,#d68a3a)!important; }
.proto-personalized-banner { background:var(--accent,#b8341c)!important; color:var(--text,#f0e7d6)!important; }
