/* ============================================================
   MY YINGST BUILD — buyer portal base styles
   yingstgroup.com / myyingstbuild.com
   Built Day 5 (mockup pass).
   ============================================================
   Visual tone vs trade portal:
     - More white space (less density)
     - Larger Cardo serif headlines
     - Accent-green for milestones (celebratory)
     - Photographic hero (photo leads, copy follows)
     - Same color palette / fonts as InstaBuild family
   ============================================================ */

:root {
  /* Fonts — same as InstaBuild family */
  --font-serif: "Cardo", Georgia, serif;
  --font-sans:  "Assistant", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* ============================================================
     CANONICAL YINGST BRAND TOKENS (mirrored from InstaBuild)
     These are the source-of-truth names per Yingst's branding guide.
     Use these — not "ink" / "gold" / etc — when adding new styles.
     ============================================================ */
  --iron:           #373133;     /* primary dark text */
  --corduroy:       #b28130;     /* warm gold accent */
  --corduroy-light: #c9993d;     /* lighter gold for hover */
  --concrete:       #dadad8;     /* soft neutral base (used as backdrop) */
  --burnt-umber:    #77260e;     /* deep accent / negative hover */
  --vivid-orange:   #de6e21;     /* action color — use sparingly */
  --cream:          #f0eeea;     /* primary warm background */
  --warm-white:     #f7f5f2;     /* card-soft / nav background */
  --accent-green:   #3d5a47;     /* milestone / positive confirmation */

  /* Semantic aliases for readable code (matches InstaBuild's pattern) */
  --ink:        var(--iron);
  --brown:      var(--burnt-umber);
  --gold:       var(--corduroy);
  --gold-light: var(--corduroy-light);
  --card-bg:    #ffffff;          /* matches InstaBuild card-bg */
  --border:     #d8d4cf;          /* matches InstaBuild border */
  --border-soft:#e6e0d6;
  --muted:      #857a75;          /* matches InstaBuild muted */
  --muted-soft: #a39b95;

  /* Utility tints derived from accent-green for use in soft backgrounds */
  --accent-green-tint: rgba(61, 90, 71, 0.07);

  /* Spacing — slightly more generous than trade side */
  --space-xs: 4px;
  --space-sm: 10px;
  --space-md: 18px;
  --space-lg: 28px;
  --space-xl: 40px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; }

a, button { -webkit-tap-highlight-color: rgba(178, 129, 48, 0.15); }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Reusable Cardo serif headline scale */
.myb-h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}
.myb-h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.008em;
  color: var(--ink);
  margin: 0;
}
.myb-h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}

/* ============================================================
   APP HEADER — minimal, brand-forward, less utility-driven than trade
   ============================================================ */
.myb-header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 14px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.myb-brand-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.myb-brand {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--iron);
}
.myb-brand .accent { color: var(--corduroy); font-style: italic; font-weight: 700; }
.myb-buyer-name {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.myb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--iron);
  font-family: inherit;
  cursor: pointer;
}
.myb-avatar:hover { border-color: var(--corduroy); }

/* ============================================================
   CONTENT CONTAINER — generous max-width for desktop, full on mobile
   ============================================================ */
.myb-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) 90px;
}

/* ============================================================
   HERO — the emotional centerpiece of the home page.
   Photo above, plan name + lot info below in serif.
   ============================================================ */
.myb-hero {
  margin-bottom: var(--space-lg);
}
.myb-hero-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: linear-gradient(135deg, #6b6260, #908680);
  margin-bottom: var(--space-md);
  overflow: hidden;
}
.myb-hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #5a4f4a 0%, #8a7c70 100%);
}
.myb-hero-photo-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
  padding: 24px 12px 8px;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.myb-hero-photo-caption-prefix {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  margin-right: 6px;
}
.myb-hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}
.myb-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.myb-pill-stage { background: var(--accent-green); color: #fff; }
.myb-pill-soft  { background: var(--cream); color: var(--ink); border: 1px solid var(--border); }
.myb-pill-warm  { background: var(--gold); color: #fff; }

.myb-hero-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 0 0 6px;
}
/* Signature emphasis: italic corduroy gold on the special word
   (mirrors InstaBuild's hero em pattern). Used for plan names,
   community names, anything that's the *thing* the buyer chose. */
.myb-hero-title em {
  font-style: italic;
  font-weight: 700;
  color: var(--corduroy);
}
.myb-hero-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   SECTION EYEBROWS — top of each section block
   ============================================================ */
.myb-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-lg) 0 var(--space-sm);
  gap: var(--space-md);
}
.myb-eyebrow-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.myb-eyebrow-line {
  flex: 0 0 16px;
  height: 1px;
  background: var(--ink);
}
.myb-eyebrow-text {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.myb-eyebrow-action {
  font-size: 11px;
  color: var(--corduroy);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.myb-eyebrow-action:hover { color: var(--corduroy-light); }

/* ============================================================
   CURRENT BUILD STATE block — "what's happening now"
   ============================================================ */
.myb-build-state-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.myb-build-state-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.myb-stage-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-green-tint);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.myb-stage-icon .ti {
  font-size: 24px;
  color: var(--accent-green);
}
.myb-build-state-text { flex: 1; min-width: 0; }
.myb-build-state-stage {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 2px;
}
.myb-build-state-headline {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
}
.myb-build-state-detail {
  font-size: 13px;
  color: var(--muted);
}

/* Milestone progress: condensed dots+labels for at-a-glance */
.myb-progress-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.myb-progress-step {
  text-align: center;
}
.myb-progress-dot {
  width: 18px;
  height: 18px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  position: relative;
}
.myb-progress-step.is-done .myb-progress-dot {
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.myb-progress-step.is-current .myb-progress-dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(178, 129, 48, 0.18);
}
.myb-progress-step.is-future .myb-progress-dot {
  background: var(--card-bg);
}
.myb-progress-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.myb-progress-step.is-current .myb-progress-label {
  color: var(--gold);
}
.myb-progress-step.is-done .myb-progress-label {
  color: var(--accent-green);
}

/* ============================================================
   ACTION ITEMS card — only when there are any
   ============================================================ */
.myb-action-card {
  background: var(--card-bg);
  border: 1px solid var(--gold);
  padding: 14px var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.myb-action-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.myb-action-icon .ti { font-size: 18px; }
.myb-action-body { flex: 1; min-width: 0; }
.myb-action-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.myb-action-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.myb-action-chev {
  font-size: 18px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ============================================================
   PHOTO ROW — preview of latest photos
   ============================================================ */
.myb-photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: var(--space-md);
}
.myb-photo-thumb {
  aspect-ratio: 1;
  background: var(--cream);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.myb-photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.myb-photo-thumb-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 6px 4px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0));
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================================
   TEAM SECTION — Pattern B (prominent CC + supporting cards)
   ============================================================ */
.myb-team-primary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--corduroy);
  padding: var(--space-md);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.myb-team-photo-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--iron);
  flex-shrink: 0;
  border: 2px solid var(--corduroy);
}
.myb-team-photo-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.myb-team-info { flex: 1; min-width: 0; }
.myb-team-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--corduroy);
  margin-bottom: 2px;
}
.myb-team-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 2px;
}
.myb-team-role {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.myb-team-actions {
  display: flex;
  gap: 8px;
}
.myb-team-action-btn {
  flex: 1;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--corduroy);
  color: var(--corduroy);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.myb-team-action-btn:hover {
  background: var(--corduroy);
  color: #fff;
}
.myb-team-action-btn .ti { font-size: 14px; }

/* Supporting team cards — grid of smaller cards */
.myb-team-supporting {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: var(--space-md);
}
@media (min-width: 640px) {
  .myb-team-supporting { grid-template-columns: repeat(4, 1fr); }
}
.myb-team-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.myb-team-card:hover { border-color: var(--corduroy); }
.myb-team-photo-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.myb-team-card.is-queue .myb-team-photo-small {
  background: var(--warm-white);
}
.myb-team-card.is-queue .myb-team-photo-small .ti {
  font-size: 18px;
  color: var(--muted);
}
.myb-team-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.myb-team-card-role {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

/* ============================================================
   MESSAGE PREVIEW — recent threads peek
   ============================================================ */
.myb-msg-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 12px var(--space-md);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.myb-msg-card.is-unread { border-left: 3px solid var(--gold); }
.myb-msg-icon {
  width: 32px;
  height: 32px;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.myb-msg-body { flex: 1; min-width: 0; }
.myb-msg-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.myb-msg-card.is-unread .myb-msg-from { font-weight: 700; }
.myb-msg-preview {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.myb-msg-time {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ============================================================
   BOTTOM NAV — same pattern as trade portal
   ============================================================ */
.myb-bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--warm-white);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.myb-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--muted);
  font-family: inherit;
  gap: 3px;
}
.myb-nav-item .ti { font-size: 22px; }
.myb-nav-item-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.myb-nav-item.is-active {
  color: var(--corduroy);
}
.myb-nav-item.is-active .myb-nav-item-label {
  font-weight: 700;
}
.myb-has-bottomnav { padding-bottom: 70px; }
