:root {
  --ink: #1a2744;
  --ink-soft: #4a5a78;
  --paper: #f2f5f9;
  --paper-deep: #e3eaf2;
  --leaf: #1f5f8b;
  --leaf-deep: #164a6e;
  --sun: #e07a3d;
  --line: rgba(26, 39, 68, 0.12);
  --shadow: 0 18px 50px rgba(26, 39, 68, 0.12);
  --radius: 18px;
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Be Vietnam Pro", sans-serif;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(224, 122, 61, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(31, 95, 139, 0.14), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, var(--paper) 40%, #eef2f7 100%);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: rgba(242, 245, 249, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffc089 0 28%, transparent 29%),
    linear-gradient(145deg, var(--leaf) 0%, var(--leaf-deep) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.nav {
  display: flex;
  gap: 1.4rem;
}

.nav a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.25s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  background: var(--leaf);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f7f9fc;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(26, 39, 68, 0.58), rgba(26, 39, 68, 0.18)),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=2000&q=80")
      center/cover no-repeat;
  transform: scale(1.04);
  animation: hero-zoom 18s var(--ease) infinite alternate;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 39, 68, 0.12) 0%, rgba(26, 39, 68, 0.52) 55%, rgba(26, 39, 68, 0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  animation: rise-in 0.9s var(--ease) both;
}

.hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: rgba(247, 249, 252, 0.92);
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 36ch;
  font-size: 1.05rem;
  color: rgba(247, 249, 252, 0.82);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--sun);
  color: #fff;
}

.btn-primary:hover {
  background: #eb8748;
}

.btn-ghost {
  background: rgba(247, 249, 252, 0.1);
  border-color: rgba(247, 249, 252, 0.35);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(247, 249, 252, 0.18);
}

/* Sections */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-inner {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.section h2,
.page-hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.intro p,
.contact p,
.assistant-copy p,
.page-hero p {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.intro,
.contact {
  text-align: center;
}

.intro .section-inner,
.contact .section-inner {
  display: grid;
  justify-items: center;
}

.contact {
  border-top: 1px solid var(--line);
}

/* Assistant */
.assistant-section {
  background:
    linear-gradient(180deg, rgba(227, 234, 242, 0.65), transparent 30%),
    transparent;
}

.assistant-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.assistant-copy h2 {
  max-width: 14ch;
}

.assistant-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: panel-in 0.8s var(--ease) both;
  animation-delay: 0.1s;
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 245, 249, 0.85);
}

.assistant-head strong {
  display: block;
  font-size: 0.98rem;
}

.assistant-head small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.assistant-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d4894a;
  box-shadow: 0 0 0 0 rgba(212, 137, 74, 0.45);
  animation: pulse-dot 2.2s ease-out infinite;
}

.assistant-messages {
  min-height: 280px;
  max-height: 360px;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent),
    #fbfcfe;
}

.msg {
  max-width: 92%;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  animation: msg-in 0.35s var(--ease) both;
}

.msg-bot {
  align-self: flex-start;
  background: #e6eef5;
  color: var(--ink);
}

.msg-user {
  align-self: flex-end;
  background: var(--leaf);
  color: #f7f9fc;
}

.msg-bot .note {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.msg-links {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.msg-links a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--leaf-deep);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.msg-links a:hover {
  background: #fff;
  border-color: rgba(31, 95, 139, 0.35);
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.assistant-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.assistant-form input:focus {
  border-color: rgba(31, 95, 139, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.12);
}

.assistant-form .btn {
  min-height: 46px;
  padding-inline: 1.15rem;
}

.assistant-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1.1rem 1rem;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.hint {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hint:hover {
  background: #e6eef5;
  border-color: rgba(31, 95, 139, 0.3);
}

/* Plans page */
.page-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 1rem;
}

.plan-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.plan-filters label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.plan-filters select {
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  color: var(--ink);
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.plan-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  animation: rise-in 0.45s var(--ease) both;
}

.plan-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.plan-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.plan-item a {
  color: var(--leaf-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.plan-empty {
  color: var(--ink-soft);
  padding: 1rem 0;
}

/* Footer */
.site-footer {
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

/* Motion */
@keyframes hero-zoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(212, 137, 74, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(212, 137, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 137, 74, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media,
  .hero-content,
  .assistant-panel,
  .msg,
  .plan-item,
  .assistant-status {
    animation: none !important;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .assistant-copy h2 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: rgba(242, 245, 249, 0.97);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--line);
  }

  .nav a[aria-current="page"]::after {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .assistant-form {
    grid-template-columns: 1fr;
  }
}
