/* =========================================================
   《欢迎来龙餐馆》· 马俊生
   Green theme sampled from the supplied background image (#18311a),
   brass accent, warm paper. Sits on top of the template stylesheet.
   ========================================================= */

:root {
  --noir: #0a1710;
  --noir-deep: #050d08;
  --noir-soft: #11251a;
  --paper: #e9e2d0;
  --paper-bright: #f5eedd;
  --paper-deep: #d9cfb9;
  --ink: #16241a;
  --ink-soft: #4b5b4e;
  --ink-faint: #7d8c7e;
  --amber: #c2a169;
  --amber-bright: #ddc18c;
  --amber-dim: #8d7243;
  --red: #8a3a2c;
  --red-deep: #5f251c;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --quote: "Noto Serif SC", "Kaiti SC", "KaiTi", "STKaiti", "FangSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

html {
  background: #050d08;
}

body {
  background:
    linear-gradient(180deg, rgba(4, 10, 7, 0.58) 0%, rgba(4, 10, 7, 0.76) 46%, rgba(3, 8, 5, 0.92) 100%),
    #07110b url("../img/forest.jpg") center top / cover no-repeat fixed;
}

::selection {
  background: var(--amber);
  color: #0a1710;
}

/* ---------- Header ---------- */

.site-header.is-scrolled,
.chat-open .site-header {
  background: rgba(6, 15, 10, 0.86);
  border-bottom-color: rgba(233, 226, 208, 0.1);
}

.brand-seal {
  background: var(--red-deep);
  box-shadow:
    inset 0 0 0 1px rgba(245, 238, 221, 0.3),
    inset 0 0 0 5px var(--red-deep),
    inset 0 0 0 6px rgba(245, 238, 221, 0.12);
}

.nav-archive:hover {
  background: rgba(194, 161, 105, 0.09);
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(circle at 74% 38%, rgba(136, 160, 112, 0.15), transparent 31%),
    radial-gradient(circle at 12% 18%, rgba(37, 76, 46, 0.3), transparent 30%),
    linear-gradient(116deg, rgba(7, 18, 11, 0.84) 0%, rgba(12, 30, 19, 0.7) 52%, rgba(4, 10, 7, 0.92) 100%);
}

.hero::after {
  -webkit-text-stroke: 1px rgba(194, 161, 105, 0.075);
}

.hero-light {
  background: radial-gradient(circle, rgba(146, 170, 120, 0.16) 0%, rgba(66, 104, 66, 0.08) 36%, transparent 68%);
}

.hero-title span {
  text-shadow: 0 16px 62px rgba(0, 0, 0, 0.42);
}

.hero-quote {
  border-left-color: rgba(194, 161, 105, 0.55);
}

.hero-lede {
  max-width: 620px;
  color: rgba(233, 226, 208, 0.64);
}

.hero-fineprint {
  color: rgba(233, 226, 208, 0.32);
  line-height: 1.9;
}

/* Portrait: the supplied still is cinematic 2.4:1 — crop it to 4:3
   around the face and the hand that frames the eye. */

.portrait-slot {
  aspect-ratio: 4 / 3;
  border-color: rgba(194, 161, 105, 0.3);
  background: #0b1a11;
}

.portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% 30%;
  filter: saturate(0.9) contrast(1.08) brightness(1.03);
}

.portrait-slot::before,
.portrait-slot::after {
  width: 30px;
  height: 30px;
  z-index: 2;
}

.hero-seal {
  background: var(--red-deep);
  font-size: clamp(16px, 1.65vw, 22px);
  letter-spacing: 0.04em;
  text-indent: 0.04em;
  box-shadow:
    inset 0 0 0 1px rgba(245, 238, 221, 0.26),
    inset 0 0 0 6px var(--red-deep),
    inset 0 0 0 7px rgba(245, 238, 221, 0.13);
}

@media (min-width: 821px) and (max-height: 900px) {
  .hero-seal {
    font-size: 18px;
  }
}

.art-kicker {
  left: -18px;
  color: rgba(233, 226, 208, 0.4);
}

.art-caption {
  color: rgba(233, 226, 208, 0.3);
}

.life-link {
  color: rgba(233, 226, 208, 0.45);
}

/* ---------- Section furniture ---------- */

.life-section {
  background:
    radial-gradient(circle at 78% 22%, rgba(84, 116, 72, 0.15), transparent 31%),
    linear-gradient(180deg, rgba(7, 18, 11, 0.9) 0%, rgba(4, 10, 7, 0.96) 100%);
}

.life-section::before {
  -webkit-text-stroke: 1px rgba(233, 226, 208, 0.04);
}

.section-heading-row h2 em {
  color: var(--amber);
}

.life-grid {
  border-color: rgba(233, 226, 208, 0.12);
}

.life-card:hover {
  background: rgba(194, 161, 105, 0.055);
}

.life-card::after {
  background: var(--amber);
}

.life-card h3 {
  font-weight: 600;
}

.life-quote {
  color: rgba(233, 226, 208, 0.6);
}

.life-foot p {
  color: var(--amber-bright);
}

/* Ghost button (used next to the quote in the life section) */

.button-ghost {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border: 1px solid rgba(194, 161, 105, 0.42);
  background: transparent;
  color: rgba(233, 226, 208, 0.78);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition:
    border-color 0.25s ease,
    color 0.25s ease,
    background 0.25s ease;
}

.button-ghost span {
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 0.3s var(--ease);
}

.button-ghost:hover {
  border-color: var(--amber);
  background: rgba(194, 161, 105, 0.08);
  color: var(--amber-bright);
}

.button-ghost:hover span {
  transform: translateX(4px);
}

.after-quote {
  max-width: 1000px;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.8;
}

/* ---------- Footer ---------- */

.site-footer {
  background: rgba(3, 8, 5, 0.94);
  border-top-color: rgba(233, 226, 208, 0.08);
}

.footer-quote {
  max-width: 1100px;
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 500;
  line-height: 1.28;
}

.footer-mark {
  -webkit-text-stroke: 1px rgba(194, 161, 105, 0.09);
}

.site-footer .brand-seal {
  display: inline-grid;
  vertical-align: middle;
  width: 30px;
  height: 30px;
  margin-right: 11px;
  font-size: 16px;
}

/* ---------- Two pages ---------- */

.page:not([hidden]) {
  animation: page-in 0.55s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-chat {
  background:
    radial-gradient(circle at 50% 16%, rgba(78, 112, 74, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(6, 15, 10, 0.86) 0%, rgba(3, 8, 5, 0.96) 100%);
}

.chat-window-head {
  background: #0a1710;
  border-bottom-color: rgba(233, 226, 208, 0.1);
  font-size: 9.5px;
}

.chat-window-head .live-dot {
  background: #c2684c;
}

.chat-log {
  scrollbar-color: rgba(138, 58, 44, 0.45) rgba(36, 27, 19, 0.05);
}

.chat-msg.user .chat-bubble {
  background: #1a2b20;
  color: rgba(245, 238, 221, 0.94);
}

.chat-msg.user .chat-avatar {
  display: grid;
  place-items: center;
  background: #fffaf1;
  color: var(--paper);
  font-family: var(--quote);
  font-size: 14px;
  line-height: 1;
}

.chat-aside {
  border-left-color: rgba(138, 58, 44, 0.38);
}

/* Free-text composer */

.ask-form {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.ask-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(36, 27, 19, 0.18);
  border-radius: 999px;
  background: #fbf5ea;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.ask-form input::placeholder {
  color: rgba(36, 27, 19, 0.36);
}

.ask-form input:focus {
  outline: none;
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 3px rgba(194, 161, 105, 0.18);
}

.ask-form input:disabled {
  opacity: 0.6;
}

.ask-form button {
  flex: 0 0 auto;
  width: 58px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.ask-form button:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.question-note {
  margin-top: 7px;
}

/* Question menu */

.question-option.is-asked {
  opacity: 0.5;
}

.question-option.is-asked strong::after {
  content: " · 已问";
  color: var(--red);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.question-menu-head span:last-child {
  color: var(--red);
}

/* Typing indicator */

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: typing-dot 1.2s ease-in-out infinite;
}

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

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

@keyframes typing-dot {
  0%, 60%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Chat opening rule + hint */

.chat-hint {
  margin: auto 0 0;
  padding-top: 15px;
  border-top: 1px solid rgba(36, 27, 19, 0.08);
  color: rgba(36, 27, 19, 0.4);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* Scroll cue sits on a dark hero */
.scroll-cue {
  color: rgba(233, 226, 208, 0.38);
}

.scroll-cue i::after {
  background: var(--amber);
}

/* ---------- Responsive fine-tuning ---------- */

@media (max-width: 820px) {
  body {
    background-attachment: scroll;
  }

  .hero-seal {
    font-size: 18px;
  }

  .footer-break {
    display: none;
  }

  .life-foot {
    flex-wrap: wrap;
    gap: 16px;
  }

  .ask-form {
    margin-top: 8px;
  }

  .ask-form input {
    height: 40px;
  }

  .question-note {
    font-size: 6px;
  }
}

@media (max-width: 420px) {
  .site-nav a[data-route='three'] {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-nav {
    gap: 10px;
  }

  .hero-seal {
    font-size: 16px;
  }

  .nav-archive {
    padding: 8px 9px;
  }

  .footer-quote {
    font-size: 30px;
  }

  .hero-fineprint {
    display: none;
  }

  .quote-break {
    display: none;
  }

  .button-ghost {
    padding: 11px 16px;
    font-size: 11px;
  }

  .ask-form input {
    font-size: 11.5px;
  }

  .ask-form button {
    width: 50px;
  }
}

@media (max-width: 370px) {
  .footer-quote {
    font-size: 26px;
  }

  .after-quote {
    font-size: 18px;
  }
}

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