/* ============================================================================
 * Partner.Coffee — styles
 * Cinematic scroll-scrubbed hero + "liquid glass" UI over a coffee/green palette
 * ========================================================================== */
:root {
  --espresso:   #120c07;
  --espresso-2: #1d140c;
  --bean:       #2a1d12;
  --cream:      #f3ead9;
  --cream-dim:  #cdbfa8;
  --green:      #2f5d40;
  --green-lite: #5d9b6f;
  --crema:      #d2a56a;   /* caramel / coffee crema accent */
  --crema-lite: #e8c189;
  --ink:        #efe6d6;

  --glass-bg:     rgba(28, 22, 15, 0.42);
  --glass-bg-lite:rgba(255, 248, 238, 0.10);
  --glass-brd:    rgba(255, 244, 228, 0.18);
  --glass-hi:     rgba(255, 255, 255, 0.35);

  --maxw: 1180px;
  --r-lg: 26px;
  --r-md: 18px;
  --font: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--espresso);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--crema); color: var(--espresso); }

/* ----------------------------------------------------------- liquid glass */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-lg);
  box-shadow:
    0 18px 50px -18px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20);
  overflow: hidden;
}
/* specular sheen */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 38%);
  pointer-events: none;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: inherit; font-weight: 600; font-size: 0.98rem;
  padding: 0.78em 1.5em; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease, color .25s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--crema-lite), var(--crema));
  color: #2a1a08;
  box-shadow: 0 10px 24px -10px rgba(210,165,106,0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(210,165,106,0.8); }
.btn-ghost {
  background: var(--glass-bg-lite);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-color: var(--glass-brd); color: var(--ink);
}
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255,248,238,0.18); }
.btn-tg {
  background: #2aabee; color: #fff;
  box-shadow: 0 10px 24px -10px rgba(42,171,238,0.7);
}
.btn-tg:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------------- loader */
#loader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; background: var(--espresso);
  transition: opacity .6s ease, visibility .6s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark { font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: .5px; color: var(--cream); }
.loader-mark b { color: var(--crema); font-weight: 600; }
.loader-bar { width: min(240px, 60vw); height: 3px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--green-lite), var(--crema)); transition: width .2s ease; }
.loader-txt { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-dim); }

/* ------------------------------------------------------------------- nav */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem clamp(1rem, 4vw, 2.4rem);
  transition: background .4s ease, box-shadow .4s ease, padding .4s ease;
}
#nav.scrolled {
  background: rgba(18, 12, 7, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255,244,228,0.10);
}
.brand { font-family: var(--serif); font-size: 1.22rem; font-weight: 600; letter-spacing: .3px; color: var(--cream); }
.brand b { color: var(--crema); font-weight: 600; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a { font-size: .92rem; color: var(--cream-dim); transition: color .2s; }
.nav-links a:hover { color: var(--cream); }
.nav-right { display: flex; align-items: center; gap: .8rem; }

/* language switcher */
.lang { display: flex; gap: .15rem; padding: .25rem; border-radius: 999px; }
.lang button {
  font: inherit; font-size: .76rem; font-weight: 600; letter-spacing: .04em;
  color: var(--cream-dim); background: transparent; border: 0; cursor: pointer;
  padding: .35em .6em; border-radius: 999px; transition: color .2s, background .2s;
}
.lang button:hover { color: var(--cream); }
.lang button.active { color: #2a1a08; background: var(--crema); }

.nav-burger { display: none; background: transparent; border: 0; cursor: pointer; padding: .4rem; }
.nav-burger span { display: block; width: 22px; height: 2px; margin: 4px 0; background: var(--cream); border-radius: 2px; transition: .3s; }

/* ---------------------------------------------------------- scrolly hero */
#scrolly { position: relative; height: 720vh; }
.stage {
  position: sticky; top: 0; height: 100vh; width: 100%;
  overflow: hidden; background: var(--espresso);
}
#frame-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 30%, transparent 40%, rgba(8,5,3,0.55) 100%),
    linear-gradient(180deg, rgba(8,5,3,0.45) 0%, transparent 22%, transparent 60%, rgba(8,5,3,0.75) 100%);
}

/* hero intro panel */
.hero {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem;
}
.hero-brand { font-family: var(--serif); font-weight: 600; color: var(--cream);
  font-size: clamp(2.6rem, 9vw, 6.2rem); line-height: 1; letter-spacing: -0.5px;
  text-shadow: 0 8px 40px rgba(0,0,0,0.55); }
.hero-brand b { color: var(--crema); }
.hero-tagline { margin-top: 1rem; font-size: clamp(1rem, 2.6vw, 1.5rem); color: var(--cream); max-width: 22ch; text-shadow: 0 2px 16px rgba(0,0,0,0.6); }
.hero-sub { margin-top: .5rem; font-size: .9rem; letter-spacing: .22em; text-transform: uppercase; color: var(--crema-lite); }
.scroll-cue { position: absolute; bottom: 7vh; display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--cream-dim); font-size: .78rem; letter-spacing: .12em; }
.scroll-cue .mouse { width: 22px; height: 34px; border: 2px solid var(--cream-dim); border-radius: 12px; position: relative; }
.scroll-cue .mouse::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 6px; background: var(--cream); border-radius: 2px; transform: translateX(-50%); animation: wheel 1.6s infinite; }
@keyframes wheel { 0%{opacity:0; transform: translate(-50%,0);} 30%{opacity:1;} 100%{opacity:0; transform: translate(-50%,10px);} }

/* narrative beat panels (synced to scroll progress via JS) */
.beats { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.beat {
  position: absolute; left: clamp(1rem, 6vw, 5rem); bottom: clamp(4rem, 16vh, 9rem);
  max-width: 440px; padding: 1.6rem 1.7rem;
  opacity: 0; transform: translateY(40px) scale(.98);
  transition: opacity .6s ease, transform .6s ease;
  pointer-events: none;
}
.beat.in { opacity: 1; transform: translateY(0) scale(1); }
.beat .tag { font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--crema-lite); }
.beat h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.4vw, 2.1rem); margin: .5rem 0 .55rem; color: var(--cream); line-height: 1.12; }
.beat p { font-size: 1rem; color: var(--cream); opacity: .92; }

.progress-rail { position: absolute; right: clamp(1rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: .7rem; }
.progress-rail .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,244,228,0.25); transition: background .3s, transform .3s; }
.progress-rail .dot.on { background: var(--crema); transform: scale(1.5); }

/* --------------------------------------------------------- content flow */
main { position: relative; z-index: 10; }
.section {
  position: relative;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.1rem, 5vw, 2.4rem);
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(47,93,64,0.12), transparent 55%),
    var(--espresso);
}
.section + .section { border-top: 1px solid rgba(255,244,228,0.06); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.eyebrow { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--crema); margin-bottom: .8rem; }
.section h2.title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 3rem); color: var(--cream); line-height: 1.08; }
.section .lead { margin-top: .9rem; max-width: 60ch; color: var(--cream-dim); font-size: clamp(1rem, 1.6vw, 1.12rem); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* portfolio cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.6rem; }
.card { padding: 1.6rem 1.5rem 1.7rem; display: flex; flex-direction: column; }
.card .badge { align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .35em .7em; border-radius: 999px; background: rgba(93,155,111,0.22); color: var(--crema-lite); border: 1px solid rgba(232,193,137,0.25); }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: .9rem 0 .4rem; color: var(--cream); }
.card .desc { color: var(--cream-dim); font-size: .95rem; min-height: 2.8em; }
.card .specs { list-style: none; margin-top: 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.card .specs li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; padding-bottom: .55rem; border-bottom: 1px dashed rgba(255,244,228,0.12); }
.card .specs li:last-child { border-bottom: 0; padding-bottom: 0; }
.card .specs .k { color: var(--cream-dim); flex: 0 0 auto; }
.card .specs .v { color: var(--cream); text-align: right; font-weight: 500; }

/* definition list (quality / terms) */
.deflist { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.4rem; }
.def { padding: 1.3rem 1.4rem; }
.def .dk { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--crema); }
.def .dv { margin-top: .45rem; color: var(--cream); font-size: 1.02rem; }

/* pricing table */
.price-card { margin-top: 2.4rem; padding: 0; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th, .ptable td { text-align: left; padding: 1rem 1.3rem; font-size: .98rem; }
.ptable thead th { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--crema); background: rgba(47,93,64,0.18); }
.ptable tbody tr { border-top: 1px solid rgba(255,244,228,0.08); }
.ptable .price { font-weight: 700; color: var(--crema-lite); white-space: nowrap; }
.ptable .status { color: var(--cream-dim); font-size: .88rem; }
.ptable td:last-child, .ptable th:last-child { text-align: right; }
.price-note { margin-top: 1rem; font-size: .85rem; color: var(--cream-dim); }
.price-note.small { font-style: italic; }

/* CTA / form */
#cta .cta-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.4rem; align-items: start; margin-top: 2.6rem; }
.cta-copy .privacy { margin-top: 1.4rem; font-size: .85rem; color: var(--cream-dim); display: flex; gap: .5rem; align-items: flex-start; }
.cta-copy .privacy svg { flex: 0 0 auto; margin-top: 2px; }
.cta-actions { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.form { padding: 1.7rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .8rem; letter-spacing: .04em; color: var(--cream-dim); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .96rem; color: var(--cream);
  background: rgba(10,7,4,0.4); border: 1px solid rgba(255,244,228,0.16);
  border-radius: 12px; padding: .75em .9em; transition: border .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--crema); background: rgba(10,7,4,0.6); }
.field select option { background: var(--bean); color: var(--cream); }
.form .submit-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.form-msg { margin-top: 1rem; font-size: .92rem; padding: .8rem 1rem; border-radius: 12px; display: none; }
.form-msg.ok { display: block; background: rgba(93,155,111,0.18); border: 1px solid rgba(93,155,111,0.4); color: #cfe9d4; }
.form-msg.err { display: block; background: rgba(190,80,60,0.16); border: 1px solid rgba(190,80,60,0.4); color: #f0c9bf; }

/* footer */
footer { padding: 3rem clamp(1.1rem, 5vw, 2.4rem); background: var(--espresso-2); border-top: 1px solid rgba(255,244,228,0.07); }
.foot-wrap { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.foot-brand { font-family: var(--serif); font-size: 1.3rem; color: var(--cream); }
.foot-brand b { color: var(--crema); }
.foot-tagline { color: var(--cream-dim); font-size: .92rem; }
.foot-note { color: var(--cream-dim); font-size: .82rem; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  #cta .cta-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; right: clamp(1rem,4vw,2.4rem);
    background: rgba(18,12,7,0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    padding: 1rem 1.4rem; border-radius: 16px; gap: 1rem; border: 1px solid var(--glass-brd);
  }
  .nav-burger { display: block; }
  .deflist { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form .row { grid-template-columns: 1fr; }
  .beat { left: 1rem; right: 1rem; max-width: none; bottom: 11vh; }
  .progress-rail { display: none; }
  .nav-links.open { left: 1rem; right: 1rem; }
}

/* ------------------------------------------------- reduced motion / fallback */
.no-scrub #scrolly { height: auto !important; }
.no-scrub .stage { position: relative; height: auto; min-height: 70vh; }
.no-scrub #frame-canvas { display: none; }
.no-scrub .stage-bg-fallback { display: block; }
.stage-bg-fallback { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.no-scrub .hero { position: relative; min-height: 70vh; }
.no-scrub .beats { position: static; pointer-events: auto; }
.no-scrub .beat { position: relative; opacity: 1; transform: none; left: auto; bottom: auto; max-width: 640px; margin: 1rem auto; }
.no-scrub .progress-rail, .no-scrub .scroll-cue { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue .mouse::after { animation: none; }
}

/* ------------------------------------------------ revisions (req 1–6) */
/* (1) nav "Заявка" button sized to match the language switcher pill */
.lang { min-height: 38px; align-items: center; }
#nav-cta { height: 38px; padding: 0 1.15em; font-size: .76rem; font-weight: 700; letter-spacing: .04em; }

/* (6) order button on each portfolio card, pinned to the card bottom */
.card .specs { margin-bottom: 1.4rem; }
.card-cta { margin-top: auto; width: 100%; justify-content: center; }

/* (5) order CTA button inside the final narrative panel */
.beat-cta { margin-top: 1.15rem; pointer-events: auto; }
.beat:not(.in) .beat-cta { pointer-events: none; }

/* (2) "Заказать через бота" moved to the end of the CTA section */
.cta-foot { margin-top: 2.4rem; display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.cta-foot-note { color: var(--cream-dim); font-size: .95rem; }
