:root {
  --ink: #1c1412;
  --ink-soft: #3a2e2a;
  --blush: #e8b4a8;
  --blush-deep: #c47a6a;
  --petal: #f7ebe6;
  --mist: #f3e4dc;
  --foam: #fffaf7;
  --line: rgba(28, 20, 18, 0.12);
  --shadow: 0 24px 60px rgba(28, 20, 18, 0.14);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --radius: 2px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--foam);
  line-height: 1.55;
  min-height: 100vh;
}

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

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

button,
input {
  font: inherit;
}

.site-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  cursor: pointer;
  padding: 0.85rem 1.5rem;
  background: var(--ink);
  color: var(--foam);
  border-radius: var(--radius);
  transition: transform 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--ink-soft);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--foam);
  border: 1px solid rgba(255, 250, 247, 0.55);
}

.btn-ghost:hover {
  background: rgba(255, 250, 247, 0.12);
}

.btn-block {
  width: 100%;
}

/* —— Landing hero —— */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  color: var(--foam);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(28, 20, 18, 0.25) 0%, rgba(28, 20, 18, 0.72) 68%, rgba(28, 20, 18, 0.88) 100%),
    url("/img/photo-1570172619644-dfd03ed5d881.avif")
      center / cover no-repeat;
  animation: hero-in 1.1s ease both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(232, 180, 168, 0.28), transparent 55%);
  pointer-events: none;
  animation: glow-drift 8s ease-in-out infinite alternate;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  max-width: 40rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 10vw, 6.5rem);
  line-height: 0.95;
  margin: 0 0 1.25rem;
  letter-spacing: 0.02em;
  animation: rise 0.9s 0.15s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  margin: 0 0 0.85rem;
  line-height: 1.25;
  animation: rise 0.9s 0.3s ease both;
}

.hero p {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  color: rgba(255, 250, 247, 0.86);
  font-size: 1.05rem;
  animation: rise 0.9s 0.45s ease both;
}

.hero .btn {
  animation: rise 0.9s 0.6s ease both;
}

/* —— Procedures —— */
.procedures {
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 10% 0%, rgba(232, 180, 168, 0.35), transparent 40%),
    linear-gradient(180deg, var(--mist), var(--foam) 55%);
}

.section-head {
  max-width: 36rem;
  margin-bottom: 2.75rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.procedure-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.procedure-list li {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 1rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s ease forwards;
}

.procedure-list li:nth-child(1) { animation-delay: 0.05s; }
.procedure-list li:nth-child(2) { animation-delay: 0.12s; }
.procedure-list li:nth-child(3) { animation-delay: 0.19s; }
.procedure-list li:nth-child(4) { animation-delay: 0.26s; }
.procedure-list li:nth-child(5) { animation-delay: 0.33s; }
.procedure-list li:nth-child(6) { animation-delay: 0.4s; }

.procedure-list h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.procedure-list p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 42rem;
}

.site-footer {
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* —— Auth / chat shells —— */
.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232, 180, 168, 0.45), transparent 45%),
    radial-gradient(ellipse at 90% 80%, rgba(196, 122, 106, 0.18), transparent 40%),
    linear-gradient(160deg, var(--mist), var(--foam));
}

.panel {
  width: min(100%, 26rem);
  animation: rise 0.7s ease both;
}

.panel-brand {
  font-family: var(--font-display);
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.panel-copy {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 247, 0.85);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--blush-deep);
  box-shadow: 0 0 0 3px rgba(196, 122, 106, 0.2);
}

.form-error {
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
  color: #9b2c2c;
  font-size: 0.92rem;
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.back-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* —— Chat —— */
.chat-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(180deg, var(--mist), var(--foam));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 247, 0.8);
  backdrop-filter: blur(10px);
}

.chat-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
}

.chat-header p {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.notify-btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.notify-btn.is-on {
  background: var(--blush);
  color: var(--ink);
  border-color: transparent;
}

.notify-btn.is-on:hover {
  background: var(--blush-deep);
  color: var(--foam);
}

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

.chat-messages {
  overflow-y: auto;
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.msg {
  max-width: min(100%, 34rem);
  animation: rise 0.35s ease both;
}

.msg.own {
  align-self: flex-end;
}

.msg-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.msg-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.msg-bubble {
  padding: 0.75rem 0.95rem;
  background: rgba(255, 250, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.own .msg-bubble {
  background: var(--ink);
  color: var(--foam);
  border-color: var(--ink);
  border-radius: 12px 4px 12px 12px;
}

.msg.system {
  align-self: center;
  max-width: 28rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.35rem 0.75rem;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 247, 0.92);
}

.chat-compose input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--foam);
  outline: none;
}

.chat-compose input:focus {
  border-color: var(--blush-deep);
  box-shadow: 0 0 0 3px rgba(196, 122, 106, 0.2);
}

.name-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(28, 20, 18, 0.45);
  backdrop-filter: blur(6px);
}

.name-gate[hidden] {
  display: none;
}

.name-gate .panel {
  background: var(--foam);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

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

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

@keyframes glow-drift {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 640px) {
  .procedure-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .site-nav .brand {
    color: var(--foam);
  }
}
