:root {
  --ink: #101412;
  --muted: #5c635e;
  --paper: #efece4;
  --paper-2: #e4dfd4;
  --white: #faf9f6;
  --signal: #16382e;
  --signal-mid: #1f4f41;
  --signal-soft: #2d6b57;
  --accent-line: #1a3d32;
  --line: rgba(16, 20, 18, 0.1);
  --line-strong: rgba(16, 20, 18, 0.2);
  --shadow: 0 22px 55px rgba(16, 20, 18, 0.08);
  --shadow-lg: 0 30px 80px rgba(16, 20, 18, 0.12);
  --font-brand: "Archivo Black", Impact, sans-serif;
  --font-body: "Figtree", Georgia, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(180deg, #f4f1ea 0%, var(--paper) 35%, var(--paper-2) 100%);
  overflow-x: hidden;
}

.noise,
.aurora {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.noise {
  opacity: 0.035;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.aurora {
  background:
    radial-gradient(700px 380px at 12% -5%, rgba(45, 107, 87, 0.18), transparent 60%),
    radial-gradient(560px 320px at 88% 8%, rgba(16, 20, 18, 0.07), transparent 55%),
    radial-gradient(480px 280px at 70% 70%, rgba(45, 107, 87, 0.06), transparent 60%);
  animation: auroraShift 18s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-1.5%, 1%, 0) scale(1.03); }
}

.top, main, footer, .chat-fab, .chat-panel { position: relative; z-index: 1; }

.top {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.78);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-brand);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
}

nav a,
.nav-support,
.linkish {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

nav a:hover,
.nav-support:hover,
.linkish:hover { color: var(--ink); }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 5.5rem) 1.5rem 3.5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  min-height: calc(100vh - 4.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal-mid);
  opacity: 0;
  animation: rise 0.8s ease forwards 0.05s;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #9b1c1c;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(155, 28, 28, 0.4); }
  70% { box-shadow: 0 0 0 9px rgba(155, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(155, 28, 28, 0); }
}

.brand {
  margin: 0 0 1rem;
  font-family: var(--font-brand);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 11ch;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards 0.12s;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  line-height: 1.3;
  max-width: 22ch;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards 0.26s;
}

.lead {
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 42ch;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards 0.38s;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s ease forwards 0.5s;
}

.hero-pills {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  opacity: 0;
  animation: rise 0.9s ease forwards 0.62s;
}

.hero-pills li {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--signal-mid);
  border: 1px solid rgba(22, 56, 46, 0.25);
  background: rgba(255, 255, 255, 0.45);
  padding: 0.4rem 0.65rem;
}

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

.hero-panel {
  background:
    linear-gradient(160deg, rgba(22, 56, 46, 0.95), rgba(16, 20, 18, 0.92));
  color: #f4f7f5;
  padding: 1.6rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-lg);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  animation: rise 1s ease forwards 0.35s, panelGlow 4.5s ease-in-out infinite alternate;
}

@keyframes panelGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.05); }
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 64px;
  margin-bottom: 1.25rem;
}

.eq span {
  flex: 1;
  background: linear-gradient(180deg, #9ad4c0, #2d6b57);
  border-radius: 2px 2px 0 0;
  animation: eq 1.2s ease-in-out infinite;
}

.eq span:nth-child(1) { height: 35%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.eq span:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.eq span:nth-child(4) { height: 90%; animation-delay: 0.05s; }
.eq span:nth-child(5) { height: 55%; animation-delay: 0.25s; }
.eq span:nth-child(6) { height: 75%; animation-delay: 0.15s; }
.eq span:nth-child(7) { height: 40%; animation-delay: 0.3s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.hero-panel-label {
  margin: 0;
  font-family: var(--font-brand);
  letter-spacing: 0.12em;
  font-size: 1.4rem;
}

.hero-panel-sub {
  margin: 0.35rem 0 1.4rem;
  color: rgba(244, 247, 245, 0.7);
  font-size: 0.9rem;
}

.hero-stats {
  margin: 0;
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
}

.hero-stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.hero-stats dt {
  margin: 0;
  color: rgba(244, 247, 245, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
  font-weight: 700;
}

.hero-stats dd { margin: 0; font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.88rem 1.2rem;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--signal); color: var(--white); }
.btn.primary:hover { background: var(--signal-soft); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: rgba(16, 20, 18, 0.04); }
.btn.full { width: 100%; }

.strip {
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.strip-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  justify-content: space-between;
}

.strip-inner p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--signal-mid);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
}

.section-head { margin-bottom: 2rem; max-width: 52ch; }

.section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-brand);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature {
  background: var(--white);
  border-top: 2px solid var(--accent-line);
  padding: 1.35rem 1.25rem 1.45rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.feature:hover { transform: translateY(-3px); }

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.plans-section { padding-bottom: 2rem; }

.plan-group-title {
  margin: 2.25rem 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal-mid);
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.plans.two { grid-template-columns: repeat(2, 1fr); }
.plans.four { grid-template-columns: repeat(4, 1fr); }

.plan {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.5rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.plan.featured {
  border-color: rgba(22, 56, 46, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7f5 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.plan-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  margin: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  border: 1px solid rgba(22, 56, 46, 0.3);
  padding: 0.25rem 0.4rem;
  background: rgba(45, 107, 87, 0.08);
}

.plan-tier {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.plan-price {
  margin: 0.35rem 0 0;
  font-family: var(--font-brand);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.plan-price span {
  font-size: 0.55em;
  margin-left: 0.1rem;
}

.plan-period {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.plan ul {
  margin: 0 0 1.1rem;
  padding-left: 1.05rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
  flex: 1;
}

.plan.compact .plan-price { font-size: 1.55rem; }
.plan.compact { min-height: 100%; }

.fine {
  margin: 1.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 64ch;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.steps li {
  background: var(--white);
  border-top: 2px solid var(--accent-line);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
}

.steps span {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  color: var(--signal-soft);
}

.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.next { padding-bottom: 4rem; }

.roadmap {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.roadmap li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
}

.badge.live {
  color: var(--signal);
  border-color: rgba(22, 56, 46, 0.35);
  background: rgba(22, 56, 46, 0.06);
}

.badge.soon {
  color: var(--muted);
  background: rgba(16, 20, 18, 0.03);
}

.sanmail-card {
  background: var(--white);
  border-left: 3px solid var(--signal);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  max-width: 62ch;
  margin-bottom: 1.5rem;
}

.sanmail-card h3 { margin: 0 0 0.45rem; font-size: 1rem; }
.sanmail-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.94rem; }

.domain { margin: 0; font-size: 0.9rem; }

footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  margin: 0 0 0.25rem !important;
  font-family: var(--font-brand);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
  font-size: 0.95rem !important;
}

footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-links a {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

/* Chat */
.chat-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  border: 0;
  background: var(--signal);
  color: var(--white);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.95rem 1.15rem;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chat-fab:hover { background: var(--signal-soft); }

.chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 4.4rem;
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(560px, calc(100vh - 6rem));
  background: var(--white);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  z-index: 45;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 56, 46, 0.05);
}

.chat-head strong { display: block; font-size: 0.95rem; }
.chat-head p { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--muted); }

.chat-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.chat-gate, .chat-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.chat-gate { padding: 1rem; gap: 0.75rem; }

.chat-gate label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-gate input,
.chat-compose input,
.staff-login input,
.staff-reply input {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
}

.chat-hint { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.chat-meta {
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 220px;
}

.msg {
  max-width: 92%;
  padding: 0.65rem 0.75rem;
  border-radius: 2px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.msg .who {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  opacity: 0.7;
}

.msg.client { align-self: flex-end; background: rgba(22, 56, 46, 0.1); }
.msg.staff { align-self: flex-start; background: rgba(16, 20, 18, 0.05); border-left: 2px solid var(--signal); }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 0.8rem; text-align: center; }

.chat-compose {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.chat-compose .btn { flex: 0 0 auto; }

/* Staff */
.staff-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.staff-page h1 {
  font-family: var(--font-brand);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0.75rem 0 0.4rem;
}

.staff-login, .staff-shell { margin-top: 1.5rem; }

.staff-login {
  max-width: 420px;
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--white);
  border-top: 2px solid var(--signal);
  box-shadow: var(--shadow);
}

.staff-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  min-height: 480px;
}

.session-list {
  background: var(--white);
  border: 1px solid var(--line);
  overflow: auto;
}

.session-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.session-list button.active { background: rgba(22, 56, 46, 0.08); }
.session-list .name { display: block; font-weight: 700; font-size: 0.9rem; }
.session-list .sub { display: block; margin-top: 0.2rem; font-size: 0.75rem; color: var(--muted); }

.staff-thread {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  min-height: 480px;
}

.staff-thread .chat-messages { flex: 1; }

.staff-reply {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.error-text { color: #8a1f1f; font-size: 0.85rem; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel { min-height: 280px; }
  .feature-grid, .plans, .plans.four, .steps { grid-template-columns: 1fr 1fr; }
  .plans.two { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  nav a { display: none; }
  .brand { max-width: none; }
  .feature-grid, .plans, .plans.four, .steps, .staff-shell { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .chat-panel { right: 0.75rem; left: 0.75rem; width: auto; }
}
