:root {
  --ink: #1a2332;
  --ink-soft: #4a5568;
  --paper: #f7f3ec;
  --sand: #e8dfd0;
  --dusk: #2c3e50;
  --rose: #b85c4a;
  --sea: #3d6b7a;
  --line: rgba(26, 35, 50, 0.12);
  --radius: 14px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 60% at 80% -10%, rgba(61, 107, 122, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 100%, rgba(184, 92, 74, 0.14), transparent 50%),
    linear-gradient(165deg, #faf7f1 0%, #efe8dc 45%, #e4ebe8 100%);
  animation: sky-drift 28s ease-in-out infinite alternate;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}

@keyframes sky-drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.04) translate(-1.5%, 1%); }
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.mark {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.ai-pill {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sea);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.ai-pill.ready { color: #2a6b4f; }
.ai-pill.wait { color: #8a6a2a; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  padding: 2.5rem 0 3rem;
  animation: rise 0.9s ease-out both;
}

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

.soft-line {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 6vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero h1 .name {
  color: var(--rose);
  font-style: italic;
}

.letter {
  margin: 0 0 2rem;
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
}

.btn.primary {
  background: var(--dusk);
  color: #f7f3ec;
}

.btn.primary:hover { background: #1f2d3a; }
.btn.primary:active { transform: scale(0.98); }

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.5); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.panel,
.chat-wrap {
  padding: 0.5rem 0 2rem;
  animation: rise 0.55s ease-out both;
}

.panel-head h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.85rem;
}

.panel-head p {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  max-width: 42ch;
}

.step {
  margin-bottom: 1.6rem;
}

.step h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chip:hover { border-color: rgba(61, 107, 122, 0.45); }
.chip.active {
  background: var(--sea);
  border-color: var(--sea);
  color: #f7f3ec;
}

.row-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
}

.step label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.step input[type="text"],
.step input[type="range"] {
  font-family: var(--sans);
  font-weight: 500;
}

.step input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.plan-card {
  margin-top: 1.75rem;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.plan-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
}

.plan-card .meta {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.plan-card .day {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.plan-card .day strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--sea);
}

.chat-log {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.bubble {
  max-width: 88%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

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

.bubble.assistant {
  align-self: flex-start;
  background: var(--sand);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.chat-form {
  display: flex;
  gap: 0.55rem;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.75);
}

.foot {
  text-align: center;
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.foot p { margin: 0; }

.hidden { display: none !important; }

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

/* Host panel */
.host-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.host-gate h1,
.host-top h1 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
}

.host-gate p,
.meta {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.host-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 320px;
  margin-top: 1.5rem;
}

.host-gate-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.host-gate-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-family: var(--sans);
  background: rgba(255, 255, 255, 0.75);
}

.host-err {
  color: var(--rose);
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.host-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.host-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .host-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

.host-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-item {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.session-item:hover { border-color: rgba(61, 107, 122, 0.4); }
.session-item.active {
  border-color: var(--sea);
  background: rgba(61, 107, 122, 0.1);
}

.session-item .when {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.session-item .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.session-item .snip {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.host-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  padding: 1.25rem 1.35rem;
}

.detail-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
}

.host-h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.pref-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}

.pref-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pref-k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.pref-v {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.host-chat {
  max-height: 520px;
}

.bubble-time {
  display: block;
  font-size: 0.7rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}
