/* =============================================================================
 * styles.css -- Kaze Sushi chat demo.
 *
 * Aesthetic: refined Japanese minimalism. Warm "washi" paper background, deep
 * indigo (ai-iro) for structure, vermillion (the torii-gate red) as the single
 * sharp accent. Calm, premium, restaurant-grade -- so the demo reads as a real
 * product, not a tech toy.
 *
 * All brand-able colors live in the :root variable block. Change them in one
 * place to re-skin the whole demo.
 * ========================================================================== */

/* ---- Fonts: distinctive display serif + clean humanist body ------------- */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap");

:root {
  /* Palette (swap here to re-skin) */
  --paper:        #f4efe6;   /* washi off-white */
  --paper-deep:   #ece4d6;   /* slightly deeper paper for panels */
  --ink:          #1f2433;   /* near-black indigo for text */
  --indigo:       #2b3a67;   /* ai-iro, structural brand color */
  --indigo-soft:  #3d4f80;
  --vermillion:   #d2492a;   /* torii red, the single accent */
  --vermillion-d: #b13a1f;
  --gold:         #c9a14a;   /* faint warm accent for hairlines */
  --muted:        #6b6357;   /* warm grey for secondary text */
  --line:         #d9cfbe;   /* hairline on paper */

  /* Bubbles */
  --bubble-bot:   #ffffff;
  --bubble-user:  var(--indigo);
  --bubble-user-text: #f4efe6;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Zen Kaku Gothic New", "Helvetica Neue", Arial, sans-serif;

  /* Shape + depth */
  --radius:       18px;
  --radius-sm:    12px;
  --shadow-soft:  0 1px 2px rgba(31, 36, 51, 0.04),
                  0 8px 24px rgba(31, 36, 51, 0.08);
  --shadow-lift:  0 18px 50px rgba(31, 36, 51, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* Layered atmosphere: a soft radial warmth + a faint paper grain via SVG
     noise. No external image -- everything is inline so it works offline. */
  background-image:
    radial-gradient(120% 90% at 85% -10%, rgba(210, 73, 42, 0.06), transparent 55%),
    radial-gradient(110% 80% at -10% 110%, rgba(43, 58, 103, 0.08), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---- Layout shell ------------------------------------------------------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top brand bar (the consulting practice) ---------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--indigo);
}

.brandmark .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--vermillion);
  box-shadow: 0 0 0 4px rgba(210, 73, 42, 0.14);
  flex: none;
}

.topbar small {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
  max-width: 320px;
}

/* ---- Restaurant header card -------------------------------------------- */
.hero {
  text-align: center;
  margin-bottom: 26px;
  position: relative;
}

.hero .kanji {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--vermillion);
  line-height: 1;
  display: inline-block;
  margin-bottom: 6px;
  opacity: 0.92;
}

.hero h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--ink);
}

.hero .blurb {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 auto;
  max-width: 460px;
  font-style: italic;
}

/* Thin decorative rule with a center diamond -- a quiet editorial flourish. */
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px auto 0;
  max-width: 220px;
  color: var(--gold);
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}
.rule .diamond {
  width: 7px; height: 7px;
  transform: rotate(45deg);
  background: var(--vermillion);
  flex: none;
}

/* ---- Chat panel --------------------------------------------------------- */
.chat {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--indigo);
  color: var(--paper);
}

.chat__head .who {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 500;
}

.chat__head .who .mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--vermillion);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  flex: none;
}

.chat__head .who .sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.7;
  font-weight: 400;
}

/* Mode badge -- demo vs live. */
.badge {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.16);
  color: var(--paper);
  border: 1px solid rgba(244, 239, 230, 0.28);
  white-space: nowrap;
}
.badge.is-live {
  background: var(--vermillion);
  border-color: var(--vermillion);
}

/* ---- Message thread ----------------------------------------------------- */
.thread {
  padding: 22px 18px;
  height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background:
    linear-gradient(var(--paper-deep), var(--paper-deep)) padding-box;
}

/* Custom, restrained scrollbar. */
.thread::-webkit-scrollbar { width: 10px; }
.thread::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 3px solid var(--paper-deep);
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: 86%;
  animation: rise 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg--assistant { align-self: flex-start; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--vermillion);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  flex: none;
  box-shadow: var(--shadow-soft);
}

.bubble {
  background: var(--bubble-bot);
  border: 1px solid var(--line);
  padding: 11px 15px;
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}
.msg--user .bubble {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-color: var(--indigo);
  border-radius: 16px;
  border-bottom-right-radius: 5px;
}

.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul {
  margin: 4px 0 8px;
  padding-left: 18px;
}
.bubble li { margin: 1px 0; }
.bubble br { line-height: 0.4; }

/* Typing indicator */
.bubble--typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
}
.bubble--typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
  animation: blink 1.2s infinite ease-in-out;
}
.bubble--typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble--typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.35; }
  40%           { transform: scale(1);   opacity: 0.9; }
}

/* ---- Suggested prompts -------------------------------------------------- */
.suggestions {
  padding: 4px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}
.suggest-group { margin-top: 12px; }
.suggest-heading {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 7px;
  font-weight: 700;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--indigo);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease,
              background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.chip:hover {
  border-color: var(--vermillion);
  color: var(--vermillion-d);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.chip:active { transform: translateY(0); }
.chip:focus-visible {
  outline: 2px solid var(--vermillion);
  outline-offset: 2px;
}

/* ---- Composer ----------------------------------------------------------- */
.composer {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.composer input[type="text"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer input[type="text"]::placeholder { color: #9a9183; }
.composer input[type="text"]:focus {
  outline: none;
  border-color: var(--indigo-soft);
  box-shadow: 0 0 0 3px rgba(43, 58, 103, 0.12);
}
.composer input:disabled { opacity: 0.6; }

.composer button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--vermillion);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 22px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.composer button:hover:not(:disabled) { background: var(--vermillion-d); }
.composer button:active:not(:disabled) { transform: translateY(1px); }
.composer button:disabled { opacity: 0.55; cursor: default; }
.composer button:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* ---- Footer ------------------------------------------------------------- */
.foot {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}
.foot strong { color: var(--indigo); font-weight: 600; }
.foot .sep { opacity: 0.4; margin: 0 8px; }

/* ---- Motion respect ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 560px) {
  .page { padding: 22px 14px 40px; }
  .topbar small { display: none; }
  .thread { height: 60vh; }
  .msg { max-width: 92%; }
  .hero h1 { font-size: 2rem; }
}
