/* =========================================================
   Emmy Bellamora — Creative Director Demo Page Styles
   Stack: vanilla CSS, custom properties, no framework
   Palette: deep ink / rose-mauve accent / warm cream
   Accessibility: WCAG AA contrast throughout
   Motion: prefers-reduced-motion respected
   ========================================================= */

/* ─── Design tokens ─────────────────────────────────────── */

:root {
  /* Brand palette */
  --ink:        #1c1824;   /* deep ink — primary text, dark surfaces */
  --ink-mid:    #3d3548;   /* mid ink — secondary text */
  --ink-light:  #6b6278;   /* light ink — muted text */
  --rose:       #c0687b;   /* rose-mauve — accent, CTAs, avatar */
  --rose-dark:  #9e4f62;   /* rose dark — hover states */
  --cream:      #fdf8f5;   /* warm cream — page background */
  --surface:    #f4eff8;   /* lavender-tinted surface — cards, chat messages */
  --border:     #e2d8ea;   /* soft border — dividers */
  --white:      #ffffff;   /* pure white — panel backgrounds */

  /* Typography */
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ─── Reset & base ──────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--rose-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Utility ───────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Demo banner ───────────────────────────────────────── */

.demo-banner {
  background-color: var(--ink);
  color: #d6cfe0;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem 1rem;
  line-height: 1.4;
}

.demo-banner a {
  color: var(--rose);
  font-weight: 600;
}

/* ─── Site header ───────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
  background-color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wordmark__name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.2;
  font-family: var(--font-serif);
}

.wordmark__sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  font-family: var(--font-sans);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-mid);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-cta {
  background-color: var(--rose);
  color: var(--white) !important;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: background-color 0.2s;
}

.nav-cta:hover {
  background-color: var(--rose-dark);
}

@media (prefers-reduced-motion: reduce) {
  .nav-cta { transition: none; }
}

/* ─── Hero ──────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 60vh;
  max-width: 72rem;
  margin: 0 auto;
  gap: 0;
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
}

.hero__image-frame {
  background-color: var(--ink);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__image-placeholder {
  color: var(--ink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.brush-icon {
  width: 80px;
  height: 80px;
  opacity: 0.4;
  color: var(--rose);
}

.hero__text {
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .hero__text { padding: 2.5rem 1.5rem; }
}

.hero__text h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--ink);
  font-family: var(--font-serif);
}

.hero__text p {
  font-size: 1.025rem;
  color: var(--ink-mid);
  max-width: 44ch;
}

/* ─── Buttons ───────────────────────────────────────────── */

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  align-self: flex-start;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary, .btn-secondary { transition: none; }
}

.btn-primary {
  background-color: var(--rose);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--rose-dark);
  color: var(--white);
}

.btn-secondary {
  border: 1.5px solid var(--rose);
  color: var(--rose-dark);
}

.btn-secondary:hover {
  background-color: var(--rose);
  color: var(--white);
}

/* ─── Services section ──────────────────────────────────── */

.services {
  max-width: 72rem;
  margin: 5rem auto;
  padding: 0 2rem;
}

.services h2 {
  font-size: 1.65rem;
  margin-bottom: 2.5rem;
  color: var(--ink);
  font-family: var(--font-serif);
}

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

.service-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem;
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-card h3 {
  font-size: 1.05rem;
  color: var(--ink);
  font-family: var(--font-serif);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* ─── Philosophy section ────────────────────────────────── */

.philosophy {
  background-color: var(--surface);
  padding: 5rem 2rem;
}

.philosophy__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 720px) {
  .philosophy__inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

.philosophy__text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.philosophy__text h2 {
  font-size: 1.65rem;
  color: var(--ink);
  line-height: 1.2;
  font-family: var(--font-serif);
}

.philosophy__text p {
  font-size: 1rem;
  color: var(--ink-mid);
  max-width: 48ch;
}

.philosophy__accent {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pull-quote {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--rose-dark);
  border-left: 3px solid var(--rose);
  padding-left: 1.5rem;
  max-width: 32ch;
}

/* ─── Footer ────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink-light);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-demo-note {
  font-size: 0.75rem;
  font-style: italic;
  color: #a899b4;
}

/* ─── Chat toggle button ─────────────────────────────────── */

.chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;

  display: flex;
  align-items: center;
  gap: 0.5rem;

  background-color: var(--rose);
  color: var(--white);
  border: none;
  border-radius: 40px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(28, 24, 36, 0.25);

  transition: background-color 0.2s, transform 0.15s;
}

.chat-toggle:hover {
  background-color: var(--rose-dark);
}

.chat-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-toggle { transition: none; }
}

.chat-toggle__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.chat-toggle__icon--close {
  display: none;
}

.chat-toggle[aria-expanded="true"] .chat-toggle__icon--open { display: none; }
.chat-toggle[aria-expanded="true"] .chat-toggle__icon--close { display: block; }
.chat-toggle[aria-expanded="true"] .chat-toggle__label { content: 'Close'; }

/* ─── Chat panel ─────────────────────────────────────────── */

.chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 200;

  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 7rem);

  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(28, 24, 36, 0.18);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Open animation */
  transform-origin: bottom right;
  animation: panel-open 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel { animation: none; }
}

@keyframes panel-open {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* Full-screen on narrow viewports */
@media (max-width: 480px) {
  .chat-panel {
    position: fixed;
    inset: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
}

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

/* Panel header */
.chat-panel__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--cream);
  flex-shrink: 0;
}

.chat-panel__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--rose);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  font-family: var(--font-serif);
}

.chat-panel__identity {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chat-panel__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.2;
  font-family: var(--font-serif);
}

.chat-panel__subtitle {
  font-size: 0.72rem;
  color: var(--ink-light);
  font-family: var(--font-sans);
}

.chat-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-panel__close svg {
  width: 18px;
  height: 18px;
}

.chat-panel__close:hover { color: var(--ink); }

.chat-panel__close:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}

/* Messages area */
.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel__messages { scroll-behavior: auto; }
}

/* Message bubbles */
.message {
  display: flex;
  max-width: 90%;
  animation: message-in 0.15s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .message { animation: none; }
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.message--assistant {
  align-self: flex-start;
}

.message--user {
  align-self: flex-end;
}

.message p, .message span {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
  font-family: var(--font-sans);
}

.message--assistant p,
.message--assistant span {
  background-color: var(--surface);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.message--user p,
.message--user span {
  background-color: var(--rose);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.message--typing span {
  background-color: var(--surface);
  color: var(--ink-light);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--ink-light);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-dot { animation: none; opacity: 1; }
}

/* Input row */
.chat-panel__input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background-color: var(--cream);
  flex-shrink: 0;
}

.chat-panel__input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.4;
  resize: none;
  background-color: var(--white);
  color: var(--ink);
  max-height: 120px;
  overflow-y: auto;
}

.chat-panel__input::placeholder {
  color: #b0a8ba;
}

.chat-panel__input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(192, 104, 123, 0.15);
}

.chat-panel__send {
  background-color: var(--rose);
  color: var(--white);
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel__send { transition: none; }
}

.chat-panel__send svg {
  width: 17px;
  height: 17px;
}

.chat-panel__send:hover:not(:disabled) {
  background-color: var(--rose-dark);
}

.chat-panel__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-panel__send:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Disclaimer */
.chat-panel__disclaimer {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: #b0a8ba;
  text-align: center;
  padding: 0.4rem 1rem 0.6rem;
  background-color: var(--cream);
  flex-shrink: 0;
}

.chat-panel__disclaimer a {
  color: var(--ink-light);
  font-size: inherit;
}
