:root {
  --yucaipa-blue: #5a7a52;
  --yucaipa-blue-dark: #3f5739;
  --yucaipa-gold: #d4c4a8;
  --yucaipa-gold-dark: #b8a67a;
  --yucaipa-text: #222;
  --yucaipa-muted: #5a6270;
  --font-main: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--yucaipa-text);
  background: #f4f5f8;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e6ef;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link img {
  height: 72px;
  width: auto;
  display: block;
}

.search-bar {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-bar input {
  width: 100%;
  height: 52px;
  border: 2px solid var(--yucaipa-blue);
  border-radius: 6px;
  padding: 0 3rem 0 1.25rem;
  font-size: 1rem;
  font-family: var(--font-main);
}

.search-bar button {
  position: absolute;
  right: 0.5rem;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--yucaipa-blue);
  cursor: pointer;
}

.search-bar svg {
  width: 22px;
  height: 22px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--yucaipa-blue);
}

.main-nav a {
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Demo banner */
.demo-banner {
  background: #fff8e6;
  border-bottom: 1px solid #f0e0a8;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: #5c4a12;
}

.demo-banner a {
  color: var(--yucaipa-blue);
  font-weight: 600;
  margin: 0 0.35rem;
}

.mode-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eee;
  color: #555;
}

.mode-pill.live {
  background: #e6f7ee;
  color: #0d6b3a;
}

.mode-pill.demo {
  background: #fff3cd;
  color: #856404;
}

/* Hero */
.hero {
  position: relative;
  background: #001030;
  overflow: hidden;
}

.hero-slides {
  position: relative;
  height: min(52vh, 520px);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  background: var(--slide-image) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-caption {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
  max-width: min(720px, 92vw);
}

.hero-caption h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
}

.hero-photo-credit {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.hero-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
}

.hero-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.hero-dots {
  display: flex;
  gap: 0.4rem;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
}

.hero-dot.is-active {
  background: #fff;
}

/* Quick links */
.quick-links {
  max-width: 1200px;
  margin: -2.5rem auto 0;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  position: relative;
  z-index: 3;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  border-left: 3px solid var(--yucaipa-gold);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(90, 122, 82, 0.08);
  transition: background 0.2s, transform 0.15s;
}

.quick-link:hover {
  background: #fffdf5;
  transform: translateY(-2px);
}

.quick-link img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.quick-link span {
  color: var(--yucaipa-blue);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
}

/* Spotlight */
.spotlight {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

.spotlight h2 {
  color: var(--yucaipa-blue);
  font-size: 1.75rem;
  margin: 0 0 1.25rem;
  font-weight: 700;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.news-card {
  background: #fff;
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border-top: 4px solid var(--yucaipa-gold);
}

.news-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.news-card h3 {
  margin: 0 0 0.5rem;
  color: var(--yucaipa-blue);
  font-size: 1.1rem;
}

.news-card p {
  margin: 0 0 0.75rem;
  color: var(--yucaipa-muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.news-card a {
  color: var(--yucaipa-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

.news-card a:hover {
  text-decoration: underline;
}

.ypac-strip {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: center;
}

.ypac-copy h2 {
  margin: 0 0 0.75rem;
  color: var(--yucaipa-blue);
  font-size: 1.75rem;
}

.ypac-copy p {
  margin: 0 0 1rem;
  color: var(--yucaipa-muted);
  line-height: 1.5;
}

.ypac-copy a {
  color: var(--yucaipa-blue);
  font-weight: 700;
}

.ypac-image {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
}

/* Two column */
.two-col {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.panel {
  background: #fff;
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.panel h2 {
  margin: 0 0 1rem;
  color: var(--yucaipa-blue);
  font-size: 1.35rem;
}

.panel.accent {
  background: linear-gradient(135deg, var(--yucaipa-blue) 0%, var(--yucaipa-blue-dark) 100%);
  color: #fff;
}

.panel.accent h2 {
  color: #fff;
}

.panel.accent p {
  opacity: 0.92;
  line-height: 1.5;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid #eef0f4;
}

.link-list a {
  display: block;
  padding: 0.55rem 0;
  color: var(--yucaipa-blue);
  font-weight: 500;
}

.link-list a:hover {
  text-decoration: underline;
}

.open-chat-btn {
  margin-top: 0.75rem;
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1.1rem;
  background: var(--yucaipa-gold);
  color: var(--yucaipa-blue-dark);
  font-weight: 700;
  cursor: pointer;
}

.open-chat-btn:hover {
  background: var(--yucaipa-gold-dark);
}

/* Footer */
.site-footer {
  background: var(--yucaipa-blue);
  color: #fff;
  padding: 2rem 1.25rem 1.25rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.site-footer h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.site-footer p,
.footer-list {
  margin: 0;
  line-height: 1.55;
  opacity: 0.92;
  font-size: 0.95rem;
}

.footer-list {
  list-style: none;
  padding: 0;
}

.footer-list li {
  margin-bottom: 0.35rem;
}

.hours {
  margin-top: 0.75rem !important;
}

.footer-note {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  opacity: 0.75;
  text-align: center;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.chat-fab {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: linear-gradient(145deg, var(--yucaipa-blue), var(--yucaipa-blue-dark));
  color: #fff;
  box-shadow: 0 10px 28px rgba(90, 122, 82, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.chat-fab:hover {
  transform: translateY(-2px) scale(1.03);
}

.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(90, 122, 82, 0.4);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.fab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.fab-label {
  position: absolute;
  bottom: -0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-panel {
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 7rem));
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(90, 122, 82, 0.28);
  border: 1px solid #d5e0f5;
  animation: panelIn 0.22s ease both;
  transition: width 0.2s ease, height 0.2s ease;
}

.chat-panel.expanded {
  width: min(760px, calc(100vw - 1.5rem));
  height: min(640px, calc(100vh - 6.5rem));
}

.chat-panel.fullscreen {
  position: fixed;
  inset: 0.75rem;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 14px;
  z-index: 60;
}

.chat-widget:has(.chat-panel.fullscreen) {
  position: fixed;
  inset: 0;
  z-index: 60;
  align-items: stretch;
  justify-content: stretch;
  right: auto;
  bottom: auto;
  padding: 0;
}

.chat-widget:has(.chat-panel.fullscreen) .chat-fab {
  display: none;
}

.chat-panel[hidden] {
  display: none !important;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(115deg, var(--yucaipa-blue-dark) 0%, var(--yucaipa-blue) 100%);
  color: #fff;
}

.chat-header-copy {
  min-width: 0;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.chat-header-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  opacity: 0.88;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e8f7ee;
}

.chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ddea0;
  box-shadow: 0 0 0 3px rgba(93, 222, 160, 0.25);
}

.chat-topic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: #eef1fa;
  border-bottom: 1px solid #dce3f5;
}

.chat-topic-bar span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--yucaipa-blue);
  background: #fff;
  border: 1px solid #d0d9f0;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
}

.chat-header-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.chat-header-actions button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.chat-header-actions button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8f9fc;
}

.bubble {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.92rem;
  word-wrap: break-word;
}

.bubble.user {
  align-self: flex-end;
  background: var(--yucaipa-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f5;
  border-bottom-left-radius: 4px;
}

.bubble.assistant.pending {
  opacity: 1;
  font-style: normal;
  background: linear-gradient(110deg, #eef0fb 0%, #f8f9fe 45%, #eef0fb 90%);
  background-size: 200% 100%;
  animation: thinking-shimmer 1.8s ease-in-out infinite;
}

.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
}

.thinking-dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--yucaipa-blue);
  animation: thinking-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.thinking-label {
  color: var(--yucaipa-blue);
  font-size: 0.82rem;
  font-weight: 500;
  animation: thinking-fade 0.35s ease;
}

@keyframes thinking-fade {
  from {
    opacity: 0.35;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-bounce {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  35% {
    transform: translateY(-0.28rem);
    opacity: 1;
  }
}

@keyframes thinking-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.bubble .md-p {
  margin: 0 0 0.5rem;
}

.bubble .md-p:last-child {
  margin-bottom: 0;
}

.bubble .md-list {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
}

.bubble .md-h {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--yucaipa-blue);
}

.bubble code {
  background: #eef1fa;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.chat-composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e8f5;
  background: #fff;
}

.chat-composer input {
  flex: 1;
  border: 1px solid #ccd5ea;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
}

.chat-composer input:focus {
  outline: 2px solid rgba(90, 122, 82, 0.25);
  border-color: var(--yucaipa-blue);
}

.chat-composer button {
  border: 0;
  border-radius: 10px;
  padding: 0 1rem;
  background: var(--yucaipa-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-composer button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-composer button:not(:disabled):hover {
  background: var(--yucaipa-blue-dark);
}

@media (max-width: 768px) {
  .ypac-strip {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    max-width: none;
  }

  .main-nav {
    flex-wrap: wrap;
  }

  .main-nav a {
    flex: 1 1 45%;
    text-align: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.95rem;
  }

  .quick-links {
    margin-top: 0;
    padding-top: 1rem;
  }

  .hero-slides {
    height: min(40vh, 360px);
  }
}
