/* Некъ — public entry. Caucasus dawn · stone · sand (readable on photo) */

:root {
  --ink: #fff8ec;
  --ink-soft: #f3e8d4;
  --muted: rgba(255, 248, 236, 0.86);
  --sand: #e8c98a;
  --sand-bright: #f3d9a4;
  --moss: #8fbf97;
  --danger: #ffb4a4;
  --line: rgba(255, 248, 236, 0.34);
  --glass: rgba(10, 16, 12, 0.42);
  --glass-strong: rgba(10, 16, 12, 0.55);
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #121a14;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--sand-bright);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.hero-plane {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-photo {
  position: absolute;
  inset: -3%;
  background: url('../drewo/bg-day-2.jpg') center 42% / cover no-repeat;
  transform: scale(1.06);
  animation: kenburns 28s var(--ease) infinite alternate;
  filter: saturate(1.02) contrast(1.06) brightness(0.88);
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(6, 10, 8, 0.72) 0%,
      rgba(6, 10, 8, 0.48) 36%,
      rgba(6, 10, 8, 0.86) 100%
    ),
    radial-gradient(ellipse 75% 55% at 50% 100%, rgba(8, 12, 10, 0.88), transparent 68%);
}

.hero-glow {
  position: absolute;
  inset: auto -10% -20% -10%;
  height: 55%;
  background: radial-gradient(ellipse at 50% 0%, rgba(232, 201, 138, 0.18), transparent 60%);
  animation: glowPulse 7s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.2%, -0.8%, 0);
  }
}

@keyframes glowPulse {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding:
    calc(1.5rem + var(--safe-top))
    1.35rem
    calc(2rem + var(--safe-bottom));
  max-width: 34rem;
  margin: 0 auto;
}

.brand {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 12vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(0, 0, 0, 0.35);
  animation: rise 0.9s var(--ease) both;
}

.headline {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink-soft);
  max-width: 18ch;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
  animation: rise 0.9s var(--ease) 0.08s both;
}

.lead {
  margin: 0 0 1.55rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 30ch;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  animation: rise 0.9s var(--ease) 0.16s both;
}

.cta {
  display: grid;
  gap: 0.7rem;
  animation: rise 0.9s var(--ease) 0.24s both;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease),
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-compact {
  min-height: 2.55rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.92rem;
}

/* Premium glass — demo */
.btn-demo {
  color: var(--ink);
  background:
    linear-gradient(165deg, rgba(255, 248, 236, 0.14), rgba(255, 248, 236, 0.05));
  border-color: rgba(232, 201, 138, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 236, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.btn-demo:hover {
  border-color: rgba(243, 217, 164, 0.7);
  background:
    linear-gradient(165deg, rgba(255, 248, 236, 0.2), rgba(255, 248, 236, 0.08));
}

/* Stronger glass/sand — have a code */
.btn-code {
  color: #1a140c;
  background:
    linear-gradient(160deg, #f0d7a0 0%, #d4b06a 100%);
  border-color: rgba(255, 248, 236, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.btn-code:hover {
  background:
    linear-gradient(160deg, #f6e0b0 0%, #dfbc78 100%);
}

/* Order — quiet sand text with understated border */
.btn-order {
  color: var(--sand-bright);
  background: rgba(10, 16, 12, 0.28);
  border-color: rgba(232, 201, 138, 0.28);
  backdrop-filter: blur(10px);
  font-weight: 600;
}

.btn-order:hover {
  color: #fff3d4;
  border-color: rgba(243, 217, 164, 0.55);
  background: rgba(10, 16, 12, 0.4);
}

.code-panel {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
  animation: rise 0.55s var(--ease) both;
}

.code-panel label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.hint-inline {
  color: var(--sand);
  font-weight: 500;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.code-panel input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  backdrop-filter: blur(12px);
}

.code-panel input::placeholder {
  color: rgba(255, 248, 236, 0.45);
}

.code-panel input:focus {
  outline: 2px solid rgba(232, 201, 138, 0.55);
  outline-offset: 1px;
}

.code-hint {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.code-hint code {
  color: var(--sand-bright);
  font-size: 0.84em;
}

.code-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.linkish {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.35rem 0 0;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}

.linkish:hover {
  color: var(--ink-soft);
}

.recent {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  animation: rise 0.7s var(--ease) 0.3s both;
}

.recent a {
  color: var(--sand-bright);
  border-bottom: 1px solid rgba(232, 201, 138, 0.4);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.pwa-banner {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(232, 201, 138, 0.28);
  background: var(--glass);
  backdrop-filter: blur(14px);
  animation: rise 0.7s var(--ease) both;
}

.pwa-banner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 560;
}

.pwa-banner p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stage.is-code .cta {
  display: none;
}

.stage.is-code .lead {
  max-width: 34ch;
}

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

@media (min-width: 720px) {
  .stage {
    justify-content: center;
    padding-bottom: calc(3rem + var(--safe-bottom));
    max-width: 38rem;
  }

  .brand {
    font-size: 5rem;
  }

  .headline {
    max-width: 22ch;
  }

  .cta {
    grid-template-columns: 1fr 1fr;
    max-width: 28rem;
  }

  .cta .btn-order {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo,
  .hero-glow,
  .brand,
  .headline,
  .lead,
  .cta,
  .code-panel,
  .recent,
  .pwa-banner {
    animation: none;
  }

  .hero-photo {
    transform: none;
  }
}
