:root {
  --bg: #eef2f6;
  --bg-elevated: #ffffff;
  --ink: #12171e;
  --ink-soft: #4b5563;
  --line: rgba(18, 23, 30, 0.1);
  --accent: #dd5a20;
  --accent-deep: #b84412;
  --accent-soft: #ffe8db;
  --steel: #1565c0;
  --steel-soft: #e3effc;
  --danger: #b91c1c;
  --shadow: 0 16px 40px rgba(18, 23, 30, 0.07);
  --radius: 16px;
  --font: "Outfit", system-ui, sans-serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 420px at 0% 0%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 380px at 100% 5%, #ffe8db 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 45%, #e8eef5 100%);
  line-height: 1.55;
  min-height: 100vh;
}

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

a {
  color: var(--steel);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-deep);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(221, 90, 32, 0.22);
}

.btn:hover {
  background: var(--accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

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

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.btn--small {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 16, 24, 0.2) 0%, rgba(12, 16, 24, 0.52) 48%, rgba(12, 16, 24, 0.9) 100%),
    linear-gradient(95deg, rgba(12, 16, 24, 0.58) 0%, transparent 58%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 5.5rem 0 3.5rem;
  max-width: 40rem;
  animation: rise 0.9s ease both;
}

.brand-mark {
  margin: 0 0 0.75rem;
  font-size: clamp(2.5rem, 7.5vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  line-height: 1.3;
  max-width: 22ch;
}

.hero__lead {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  max-width: 34ch;
}

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

.hero .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.section {
  padding: 4.5rem 0;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.section__lead {
  margin: 0 0 2rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.split__text p {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.split__figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.split__figure img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

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

.req-grid li {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.req-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
}

.req-grid h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.req-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.apply {
  background: linear-gradient(180deg, transparent, rgba(227, 239, 252, 0.55) 30%, transparent 85%);
}

.apply__wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2rem;
  align-items: start;
}

.apply__intro p {
  color: var(--ink-soft);
}

.hint-box {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--steel-soft);
  border-radius: 12px;
  border-left: 3px solid var(--steel);
}

.hint-box p {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.apply-form {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-block {
  margin: 0 0 1.5rem;
  padding: 0;
  border: none;
}

.form-block legend {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.form-block--optional legend span {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.field {
  margin-bottom: 1rem;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(221, 90, 32, 0.55);
  box-shadow: 0 0 0 3px rgba(221, 90, 32, 0.12);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.field-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.form-alert {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.2);
  font-weight: 500;
}

.form-actions {
  display: grid;
  gap: 0.75rem;
}

.form-footnote {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

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

.gallery__row img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.community__box {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.community__box p {
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0 auto 1.25rem;
}

.community__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.bot-commands {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.bot-commands code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
}

.site-footer p {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.lead-success {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 600;
  animation: rise 0.45s ease both;
}

.lead-success[hidden] {
  display: none !important;
}

.lead-success p {
  margin: 0;
}

.error-403 {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.error-403[hidden] {
  display: none !important;
}

.error-403__inner {
  text-align: center;
  max-width: 28rem;
}

.error-403__code {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #111;
}

.error-403__text {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.error-403__link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.ai-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  width: min(100% - 2rem, 360px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.ai-widget__toggle {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(18, 23, 30, 0.25);
}

.ai-widget__pulse {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(18, 23, 30, 0.25);
  animation: pulse 2.2s ease infinite;
  pointer-events: none;
}

.ai-panel {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
  animation: rise 0.3s ease both;
}

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

.ai-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #fff4ec, #e8f1fb);
  border-bottom: 1px solid var(--line);
}

.ai-panel__head strong {
  display: block;
}

.ai-panel__head span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.ai-panel__tools {
  display: flex;
  gap: 0.35rem;
  align-items: start;
}

.lang-switch,
.ai-close {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
}

.ai-panel__messages {
  padding: 0.9rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 220px;
  flex: 1;
}

.ai-msg {
  max-width: 92%;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.ai-msg--bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--ink);
}

.ai-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.ai-panel__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.55rem;
}

.ai-panel__quick button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.ai-panel__quick button:hover {
  border-color: rgba(221, 90, 32, 0.35);
  color: var(--ink);
}

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

.ai-panel__form input {
  flex: 1;
  min-width: 0;
}

@keyframes hero-drift {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.08) translateY(-1.5%); }
}

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

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .split,
  .apply__wrap,
  .req-grid,
  .gallery__row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: min(88vh, 720px);
  }

  .hero__content {
    padding-top: 6rem;
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .header-row .btn--small {
    display: none;
  }

  .ai-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__media img,
  .ai-widget__pulse,
  .hero__content,
  .ai-panel,
  .lead-success {
    animation: none;
    transition: none;
  }
}
