/* ==========================================================================
   GRAINHOUSE — design tokens
   Тема: цветокоррекция / кинолента. Teal & Orange — классическая пара
   цветокоррекции (тени / света), поэтому она здесь не декоративная, а смысловая.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --bg: #15171b;
  --bg-raise: #1d2023;
  --bg-raise-2: #24272b;
  --border: #34383d;
  --border-soft: #2a2d31;

  --text: #edeae3;
  --text-dim: #b9b6ae;
  --muted: #8b8e88;

  --teal: #3e9c93;
  --teal-dim: #2c6d67;
  --orange: #e2924a;
  --orange-dim: #a86934;
  --red: #c4483c;

  --radius: 3px;
  --radius-lg: 6px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sprocket: repeating-linear-gradient(
    90deg,
    var(--bg-raise-2) 0px, var(--bg-raise-2) 10px,
    transparent 10px, transparent 26px
  );
}

*{ box-sizing: border-box; margin:0; padding:0; }

html{ scroll-behavior:smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing: antialiased;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; }
button{ font-family:inherit; cursor:pointer; }
input, select{ font-family:inherit; }

.wrap{
  max-width:1180px;
  margin:0 auto;
  padding:0 32px;
}

@media (max-width:640px){
  .wrap{ padding:0 20px; }
}

/* -------------------- typography -------------------- */

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight:700;
  letter-spacing:-0.01em;
  color:#fff;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size:12px;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color: var(--orange);
  display:flex;
  align-items:center;
  gap:10px;
}
.eyebrow::before{
  content:"";
  width:16px; height:1px;
  background: var(--orange);
  display:inline-block;
}

.mono{ font-family: var(--font-mono); }

/* -------------------- sprocket strip (signature) -------------------- */

.sprocket-strip{
  height:14px;
  width:100%;
  background:
    radial-gradient(circle, var(--bg) 3px, transparent 3.2px) 14px 50% / 28px 100%,
    var(--bg-raise-2);
  border-top:1px solid var(--border-soft);
  border-bottom:1px solid var(--border-soft);
}

/* -------------------- nav -------------------- */

.site-header{
  position:sticky; top:0; z-index:50;
  background: rgba(21,23,27,0.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--border-soft);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:68px;
}

.logo{
  font-family: var(--font-display);
  font-weight:700;
  font-size:19px;
  letter-spacing:-0.02em;
  display:flex;
  align-items:center;
  gap:10px;
}
.logo .mark{
  width:22px; height:22px;
  border-radius:2px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal) 48%, var(--orange) 52%, var(--orange) 100%);
  flex-shrink:0;
}
.logo .accent{ color: var(--orange); }

.nav-links{
  display:flex;
  gap:34px;
  align-items:center;
}
.nav-links a{
  font-size:14px;
  color: var(--text-dim);
  transition: color .15s ease;
  position:relative;
}
.nav-links a:hover{ color:#fff; }
.nav-links a.active{ color:#fff; }
.nav-links a.active::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-22px;
  height:2px;
  background: var(--orange);
}

.nav-cta{
  display:flex; align-items:center; gap:14px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 20px;
  border-radius: var(--radius);
  font-size:14px;
  font-weight:600;
  border:1px solid transparent;
  transition: all .15s ease;
  white-space:nowrap;
}
.btn-primary{
  background: var(--orange);
  color:#171310;
}
.btn-primary:hover{ background:#ec9f5c; }

.btn-ghost{
  border-color: var(--border);
  color: var(--text);
  background:transparent;
}
.btn-ghost:hover{ border-color:#565b61; background: var(--bg-raise); }

.btn-sm{ padding:8px 14px; font-size:13px; }
.btn-block{ width:100%; }

.menu-toggle{
  display:none;
  background:none; border:none; color:#fff;
  font-size:22px;
}

@media (max-width: 860px){
  .nav-links{
    position:fixed; top:68px; left:0; right:0;
    background: var(--bg-raise);
    border-bottom:1px solid var(--border);
    flex-direction:column;
    align-items:flex-start;
    padding:20px 24px;
    gap:18px;
    transform:translateY(-130%);
    transition: transform .2s ease;
  }
  .nav-links.open{ transform:translateY(0); }
  .nav-links a.active::after{ display:none; }
  .menu-toggle{ display:block; }
  .nav-cta .btn-ghost{ display:none; }
}

/* -------------------- hero -------------------- */

.hero{
  padding:76px 0 64px;
  position:relative;
  overflow:hidden;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap:56px;
  align-items:center;
}

@media (max-width:900px){
  .hero-grid{ grid-template-columns:1fr; }
}

.hero h1{
  font-size:52px;
  line-height:1.04;
  margin:18px 0 22px;
}
@media (max-width:640px){ .hero h1{ font-size:36px; } }

.hero p.lead{
  font-size:17px;
  color: var(--text-dim);
  max-width:480px;
  margin-bottom:32px;
}

.hero-actions{
  display:flex;
  gap:14px;
  margin-bottom:36px;
  flex-wrap:wrap;
}

.hero-meta{
  display:flex;
  gap:28px;
  font-family: var(--font-mono);
  font-size:12px;
  color: var(--muted);
  flex-wrap:wrap;
}
.hero-meta b{ color:#fff; font-weight:600; }

/* contact-sheet swatch panel */

.contact-sheet{
  background: var(--bg-raise);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:10px;
}
.contact-sheet-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 8px 12px;
  font-family:var(--font-mono);
  font-size:11px;
  color:var(--muted);
  letter-spacing:.05em;
}
.dot-row{ display:flex; gap:6px; }
.dot-row span{ width:8px; height:8px; border-radius:50%; background:var(--border); }

.swatch-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.swatch{
  aspect-ratio:4/5;
  border-radius:2px;
  position:relative;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.06);
  transition: transform .25s ease;
  cursor:default;
}
.swatch:hover{ transform:translateY(-3px); }
.swatch span{
  position:absolute; left:6px; bottom:6px;
  font-family:var(--font-mono);
  font-size:9px;
  letter-spacing:.03em;
  color:rgba(255,255,255,0.85);
  text-shadow:0 1px 2px rgba(0,0,0,.6);
}

/* preset swatch gradients — each represents an actual grade */
.sw-01{ background:linear-gradient(160deg,#0f2e33,#3e9c93 55%,#e2c184); }
.sw-02{ background:linear-gradient(160deg,#241318,#7a2f2f 45%,#e2924a); }
.sw-03{ background:linear-gradient(160deg,#101820,#274a5c 50%,#8fb8c9); }
.sw-04{ background:linear-gradient(160deg,#1a1a1a,#4a4a4a 60%,#c9c2b4); filter:grayscale(1) contrast(1.15); }
.sw-05{ background:linear-gradient(160deg,#2b1d0e,#a86934 55%,#f0c98a); }
.sw-06{ background:linear-gradient(160deg,#161d2e,#3a4d8f 55%,#c9a6e0); }
.sw-07{ background:linear-gradient(160deg,#0d1f14,#2f6d4a 55%,#d7e29a); }
.sw-08{ background:linear-gradient(160deg,#22120f,#c4483c 55%,#f0b98a); }
.sw-09{ background:linear-gradient(160deg,#0c0c0c,#5a5a5a 60%,#f2ede2); filter:grayscale(1); }

/* -------------------- sections -------------------- */

section{ padding:70px 0; }
.section-head{
  max-width:560px;
  margin-bottom:44px;
}
.section-head h2{
  font-size:34px;
  margin-top:14px;
}
.section-head p{
  color:var(--text-dim);
  margin-top:12px;
  font-size:15.5px;
}

.divider{
  border:none;
  border-top:1px solid var(--border-soft);
}

/* feature grid */
.feature-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1px;
  background:var(--border-soft);
  border:1px solid var(--border-soft);
}
@media (max-width:800px){ .feature-grid{ grid-template-columns:1fr; } }

.feature-card{
  background:var(--bg);
  padding:30px 26px;
}
.feature-card .num{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--teal);
  margin-bottom:16px;
  display:block;
}
.feature-card h3{
  font-size:18px;
  margin-bottom:10px;
}
.feature-card p{
  font-size:14px;
  color:var(--text-dim);
}

/* preset cards (store) */
.filter-row{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-bottom:34px;
}
.chip{
  font-family:var(--font-mono);
  font-size:12px;
  padding:8px 14px;
  border:1px solid var(--border);
  border-radius:20px;
  color:var(--text-dim);
  background:var(--bg-raise);
}
.chip.active{
  border-color:var(--orange);
  color:var(--orange);
  background:rgba(226,146,74,0.08);
}

.preset-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
}
@media (max-width:960px){ .preset-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .preset-grid{ grid-template-columns:1fr; } }

.preset-card{
  background:var(--bg-raise);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
}
.preset-card .thumb{
  aspect-ratio:4/3;
  position:relative;
}
.preset-card .thumb .tag{
  position:absolute; top:10px; left:10px;
  font-family:var(--font-mono);
  font-size:10px;
  padding:3px 8px;
  background:rgba(0,0,0,0.55);
  color:#fff;
  border-radius:2px;
  letter-spacing:.04em;
}
.preset-card .body{ padding:16px; }
.preset-card h4{
  font-family:var(--font-display);
  font-size:15px;
  color:#fff;
  margin-bottom:4px;
}
.preset-card .meta{
  font-family:var(--font-mono);
  font-size:11.5px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--border-soft);
}

/* pricing */
.pricing-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  align-items:start;
}
@media (max-width:960px){ .pricing-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .pricing-grid{ grid-template-columns:1fr; } }

.plan{
  background:var(--bg-raise);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:28px 22px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.plan.featured{
  border-color:var(--orange);
  background:linear-gradient(180deg, rgba(226,146,74,0.07), var(--bg-raise) 40%);
}
.plan-name{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.08em;
  color:var(--muted);
  text-transform:uppercase;
}
.plan.featured .plan-name{ color:var(--orange); }
.plan-price{
  font-family:var(--font-display);
  font-size:36px;
  color:#fff;
}
.plan-price span{
  font-size:14px;
  color:var(--muted);
  font-family:var(--font-body);
}
.plan-list{ display:flex; flex-direction:column; gap:10px; font-size:13.5px; color:var(--text-dim); }
.plan-list li{ display:flex; gap:8px; align-items:flex-start; }
.plan-list li::before{ content:"—"; color:var(--teal); flex-shrink:0; }

/* code / api blocks */
.endpoint{
  background:var(--bg-raise);
  border:1px solid var(--border);
  border-radius:var(--radius);
  margin-bottom:14px;
  overflow:hidden;
}
.endpoint-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  flex-wrap:wrap;
}
.method{
  font-family:var(--font-mono);
  font-size:11px;
  font-weight:700;
  padding:3px 8px;
  border-radius:2px;
  letter-spacing:.03em;
}
.method.get{ background:rgba(62,156,147,0.15); color:var(--teal); }
.method.post{ background:rgba(226,146,74,0.15); color:var(--orange); }

.endpoint-path{ font-family:var(--font-mono); font-size:13.5px; color:#fff; }
.endpoint-desc{ font-size:13px; color:var(--muted); margin-left:auto; }

.endpoint-body{
  border-top:1px solid var(--border-soft);
  padding:16px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}

.response-box{
  font-family:var(--font-mono);
  font-size:12.5px;
  background:#100e0d;
  border:1px solid var(--border-soft);
  border-radius:2px;
  padding:14px 16px;
  color:var(--text-dim);
  white-space:pre-wrap;
  display:none;
  margin-top:14px;
}
.response-box.show{ display:block; }
.response-box .status-line{
  color:var(--red);
  font-weight:700;
  margin-bottom:8px;
  display:block;
}

/* login / cabinet */
.auth-shell{
  min-height:calc(100vh - 69px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:60px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(62,156,147,0.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(226,146,74,0.07), transparent 40%);
}
.auth-card{
  width:100%;
  max-width:400px;
  background:var(--bg-raise);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:38px 34px 32px;
}
.auth-card .eyebrow{ justify-content:center; margin-bottom:14px; }
.auth-card h1{
  font-size:23px;
  text-align:center;
  margin-bottom:6px;
}
.auth-card .sub{
  text-align:center;
  font-size:13.5px;
  color:var(--muted);
  margin-bottom:28px;
}

.field{ margin-bottom:16px; }
.field label{
  display:block;
  font-family:var(--font-mono);
  font-size:11.5px;
  letter-spacing:.04em;
  color:var(--text-dim);
  margin-bottom:7px;
  text-transform:uppercase;
}
.field input{
  width:100%;
  background:var(--bg);
  border:1px solid var(--border);
  color:var(--text);
  padding:11px 13px;
  border-radius:var(--radius);
  font-size:14px;
  transition:border-color .15s ease;
}
.field input:focus{
  outline:none;
  border-color:var(--teal);
}
.field input.err{ border-color:var(--red); }

.form-row-between{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:22px;
  font-size:12.5px;
}
.form-row-between a{ color:var(--teal); }
.form-row-between a:hover{ text-decoration:underline; }

.remember{ display:flex; align-items:center; gap:7px; color:var(--muted); }

.auth-error{
  display:none;
  align-items:flex-start;
  gap:10px;
  background:rgba(196,72,60,0.1);
  border:1px solid rgba(196,72,60,0.35);
  color:#e79e97;
  font-size:13px;
  padding:12px 14px;
  border-radius:var(--radius);
  margin-bottom:18px;
}
.auth-error.show{ display:flex; }

.shake{ animation: shake .4s; }
@keyframes shake{
  10%,90%{ transform:translateX(-1px); }
  20%,80%{ transform:translateX(2px); }
  30%,50%,70%{ transform:translateX(-4px); }
  40%,60%{ transform:translateX(4px); }
}

.auth-footer{
  text-align:center;
  font-size:13px;
  color:var(--muted);
  margin-top:22px;
}
.auth-footer a{ color:var(--orange); }

/* -------------------- footer -------------------- */

.site-footer{
  border-top:1px solid var(--border-soft);
  padding:50px 0 30px;
  margin-top:40px;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.4fr repeat(3,1fr);
  gap:32px;
  margin-bottom:40px;
}
@media (max-width:760px){ .footer-grid{ grid-template-columns:repeat(2,1fr); } }

.footer-grid h5{
  font-family:var(--font-mono);
  font-size:11.5px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:16px;
}
.footer-grid ul{ display:flex; flex-direction:column; gap:10px; }
.footer-grid a{ font-size:13.5px; color:var(--text-dim); }
.footer-grid a:hover{ color:#fff; }

.footer-bottom{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-top:24px;
  border-top:1px solid var(--border-soft);
  font-size:12.5px;
  color:var(--muted);
  flex-wrap:wrap;
  gap:12px;
}

/* toast */
.toast{
  position:fixed;
  bottom:24px; left:50%;
  transform:translate(-50%, 20px);
  background:var(--bg-raise-2);
  border:1px solid var(--border);
  color:var(--text);
  padding:12px 18px;
  border-radius:var(--radius);
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transition:all .25s ease;
  z-index:100;
  font-family:var(--font-mono);
}
.toast.show{
  opacity:1;
  transform:translate(-50%, 0);
}

/* misc */
.badge-count{
  font-family:var(--font-mono);
  font-size:11px;
  background:var(--bg-raise-2);
  color:var(--text-dim);
  padding:2px 8px;
  border-radius:10px;
}

.cta-band{
  background:var(--bg-raise);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:48px 40px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  flex-wrap:wrap;
}
.cta-band h2{ font-size:26px; margin-bottom:6px; }
.cta-band p{ color:var(--text-dim); font-size:14px; }
