/* Титульна сторінка. Той самий «папір і чорнило»: тихе тло,
   кольорові лише чорнила сторін (темно-синє компанії, фіолетове кандидата). */

.landing {
  --lp-gutter: clamp(16px, 5vw, 56px);
  --lp-max: 1120px;
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--steel) 22%, transparent), transparent 70%),
    radial-gradient(900px 520px at -10% 110%, color-mix(in srgb, var(--employee) 10%, transparent), transparent 70%),
    var(--paper);
}
@media (prefers-color-scheme: dark) {
  .landing {
    background:
      radial-gradient(1200px 600px at 85% -10%, rgba(132, 151, 176, 0.18), transparent 70%),
      radial-gradient(900px 520px at -10% 110%, rgba(96, 55, 144, 0.22), transparent 70%),
      var(--paper);
  }
}

/* тонка «міліметрівка» під ілюстрацією */
.lp-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(600px 420px at 78% 32%, #000 10%, transparent 75%);
          mask-image: radial-gradient(600px 420px at 78% 32%, #000 10%, transparent 75%);
}

.lp-head, .lp-main, .lp-foot {
  position: relative; z-index: 1;
  width: 100%; max-width: calc(var(--lp-max) + 2 * var(--lp-gutter));
  margin: 0 auto;
  padding-left: max(var(--lp-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--lp-gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Шапка ---------- */
.lp-head {
  display: flex; align-items: center; gap: 14px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: 12px;
}
.lp-logo { display: block; height: 40px; width: auto; }
.lp-head-sub {
  color: var(--muted); font-size: 0.9rem; line-height: 1.2;
  padding-left: 14px; border-left: 1px solid var(--line-strong);
}

/* ---------- Головний блок ---------- */
.lp-main { flex: 1; display: grid; gap: clamp(40px, 7vw, 72px); padding-top: clamp(24px, 6vw, 64px); padding-bottom: 40px; }

.lp-hero {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 80px);
}
.lp-copy { display: grid; gap: 20px; justify-items: start; min-width: 0; }

.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--employee); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.lp-eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: currentColor; }

.lp-hero h1 {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem);
  line-height: 1.08; letter-spacing: -0.025em; font-weight: 600;
  max-width: 14ch; text-wrap: balance;
}
.lp-hand {
  position: relative; display: inline-block;
  font-family: var(--hand); font-weight: 600; font-size: 1.18em; letter-spacing: 0;
  color: var(--employee); line-height: 0.9;
}
.lp-lead { color: var(--muted); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); line-height: 1.6; max-width: 46ch; }

.lp-cta { display: grid; gap: 12px; justify-items: start; margin-top: 8px; }
.lp-login {
  min-height: 52px; padding: 12px 24px; gap: 12px;
  font-size: 1rem; font-weight: 600; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(51, 63, 80, 0.18), 0 10px 24px -8px rgba(51, 63, 80, 0.45);
}
.lp-ms { flex: none; background: #fff; padding: 2px; border-radius: 2px; box-sizing: content-box; }
.lp-note { color: var(--muted); font-size: 0.875rem; max-width: 42ch; }

/* ---------- Немає доступу ---------- */
.lp-denied {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; max-width: 520px;
  padding: 14px 16px; border-radius: 8px;
  background: var(--sheet); border: 1px solid var(--line); border-left: 3px solid var(--employee);
  box-shadow: var(--shadow); color: var(--ink); font-size: 0.925rem;
}
.lp-denied > svg { flex: none; color: var(--employee); margin-top: 1px; }
.lp-denied > div { display: grid; gap: 4px; min-width: 0; }
.lp-denied-title { font-weight: 600; color: var(--heading); }
.lp-denied-link {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--info); font-weight: 500; text-underline-offset: 3px;
}

/* ---------- Ілюстрація ---------- */
.lp-art { position: relative; justify-self: center; width: 100%; max-width: 440px; padding: 12px 18px 24px 0; }
.lp-sheet {
  position: relative; z-index: 1;
  display: grid; gap: 22px;
  padding: 26px 26px 22px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 4px rgba(51, 63, 80, 0.06), 0 24px 48px -16px rgba(51, 63, 80, 0.28);
  transform: rotate(-1.5deg);
}
.lp-sheet-back {
  position: absolute; inset: 24px 0 6px 22px; z-index: 0; height: auto;
  transform: rotate(3deg); opacity: 0.65; box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) {
  .lp-sheet { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.6); }
  .lp-sheet-back { opacity: 0.5; }
}

.lp-sheet-head { display: flex; align-items: center; gap: 12px; }
.lp-sheet-mark { width: 20px; height: auto; flex: none; }
.lp-sheet-title { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.lp-sheet-title span { font-weight: 600; color: var(--heading); font-size: 0.95rem; }
.lp-sheet-title small { color: var(--muted); font-size: 0.75rem; }
.lp-sheet-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 3px 10px; border-radius: 999px;
  background: var(--ok-wash); color: var(--ok); font-size: 0.75rem; font-weight: 600;
}

.lp-lines { display: grid; gap: 9px; }
.lp-lines i { display: block; height: 7px; border-radius: 4px; background: var(--line); }
.lp-lines i:nth-child(4) { margin-bottom: 8px; }

.lp-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lp-sig { display: grid; gap: 4px; min-width: 0; }
.lp-sig svg { display: block; width: 100%; height: auto; aspect-ratio: 200 / 70; overflow: visible; }
.lp-stroke { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.lp-sig-company { --ink-c: var(--company); }
.lp-sig-employee { --ink-c: var(--employee); }
.lp-sig .lp-stroke { stroke: var(--ink-c); }
.lp-sig-line { height: 1px; background: var(--line-strong); }
.lp-sig-who {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--muted);
}
.lp-sig-who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-c); }

.lp-stamp {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  padding-top: 14px; border-top: 1px dashed var(--line-strong);
  font-size: 0.75rem; color: var(--muted);
}
.lp-hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.02em; }

/* ---------- Кроки ---------- */
.lp-steps ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  counter-reset: step;
}
.lp-steps li {
  position: relative; counter-increment: step;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px; border-radius: 10px;
  background: color-mix(in srgb, var(--sheet) 80%, transparent);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lp-steps li::after {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 14px; right: 16px;
  font-size: 0.75rem; font-weight: 600; color: var(--steel); letter-spacing: 0.04em;
}
@media (prefers-color-scheme: dark) { .lp-steps li::after { color: var(--muted); } }
.lp-steps h3 { font-size: 1rem; padding-right: 22px; }
.lp-steps p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.lp-step-icon {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--company-wash); color: var(--company);
}
.lp-steps li:last-child .lp-step-icon { background: var(--employee-wash); color: var(--employee); }
.lp-step-icon svg, .lp-candidate svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Кандидатам ---------- */
.lp-candidate {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: 10px;
  border: 1px dashed var(--line-strong); color: var(--muted); font-size: 0.925rem;
  max-width: 720px;
}
.lp-candidate svg { flex: none; margin-top: 1px; color: var(--steel); }
@media (prefers-color-scheme: dark) { .lp-candidate svg { color: var(--muted); } }
.lp-candidate strong { color: var(--heading); font-weight: 600; }

.lp-foot {
  padding-top: 8px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  color: var(--muted); font-size: 0.8rem;
}

/* ---------- Адаптивність ---------- */
@media (max-width: 880px) {
  .lp-hero { grid-template-columns: minmax(0, 1fr); }
  .lp-art { max-width: 400px; }
  .lp-steps ol { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lp-glow { -webkit-mask-image: radial-gradient(420px 380px at 60% 62%, #000 10%, transparent 75%); mask-image: radial-gradient(420px 380px at 60% 62%, #000 10%, transparent 75%); }
}
@media (max-width: 520px) {
  .lp-head-sub { font-size: 0.85rem; }
  .lp-logo { height: 34px; }
  .lp-cta, .lp-login { width: 100%; justify-items: stretch; }
  .lp-login { min-height: 54px; }
  .lp-art { padding-right: 12px; }
  .lp-sheet { padding: 20px 18px 18px; gap: 18px; }
  .lp-sigs { gap: 12px; }
  .lp-steps li { padding: 16px; }
}

/* ---------- Рух ---------- */
@media (prefers-reduced-motion: no-preference) {
  .lp-copy > *, .lp-art, .lp-steps li, .lp-candidate { animation: lp-rise 600ms cubic-bezier(.2, .7, .2, 1) both; }
  .lp-copy > :nth-child(2) { animation-delay: 40ms; }
  .lp-copy > :nth-child(3) { animation-delay: 90ms; }
  .lp-copy > :nth-child(4) { animation-delay: 140ms; }
  .lp-copy > :nth-child(5) { animation-delay: 190ms; }
  .lp-art { animation-delay: 160ms; }
  .lp-steps li:nth-child(1) { animation-delay: 260ms; }
  .lp-steps li:nth-child(2) { animation-delay: 330ms; }
  .lp-steps li:nth-child(3) { animation-delay: 400ms; }
  .lp-candidate { animation-delay: 470ms; }

  /* підписи «пишуться» по черзі, потім з’являється позначка «Підписано» */
  .lp-sig .lp-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lp-write 1500ms cubic-bezier(.45, .05, .35, 1) forwards; }
  .lp-sig-company .lp-stroke { animation-delay: 700ms; }
  .lp-sig-employee .lp-stroke { animation-delay: 2100ms; }
  .lp-sheet-badge { animation: lp-pop 420ms cubic-bezier(.3, 1.4, .5, 1) 3500ms both; }
  .lp-stamp { animation: lp-fade 500ms ease 3700ms both; }


  .lp-login { transition: filter 150ms ease, box-shadow 200ms ease, transform 200ms ease; }
  .lp-login:hover { box-shadow: 0 1px 2px rgba(51, 63, 80, 0.2), 0 14px 28px -8px rgba(51, 63, 80, 0.55); }
  .lp-login:active { transform: translateY(1px); }

  @keyframes lp-rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes lp-write { to { stroke-dashoffset: 0; } }
  @keyframes lp-pop { from { opacity: 0; transform: scale(0.6); } }
  @keyframes lp-fade { from { opacity: 0; } }
}
