/* ==========================================================================
   Scratch Synth — website styles
   Sections: 1 Fonts · 2 Tokens · 3 Base · 4 Nav · 5 Buttons · 6 Hero
             7 Feature blocks · 8 Screenshots (3D) · 9 Download · 10 Footer
             11 Responsive · 12 Reduced motion
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: Inter; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter; font-weight: 700; font-display: swap;
  src: url(../fonts/inter-latin-700.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-cyrillic-400.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter; font-weight: 700; font-display: swap;
  src: url(../fonts/inter-cyrillic-700.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* 2. Design tokens -------------------------------------------------------- */
@property --a { syntax: "<angle>"; inherits: true; initial-value: 0deg; } /* orbit angle, animated */

:root {
  --bg: #0b0c0e;
  --panel: #101113;
  --line: rgba(255, 255, 255, .09);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #6e6e73;

  /* palette taken from the plugin's platter */
  --teal: #25a8d0;
  --rose: #b2506b;
  --amber: #d98c45;

  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: inherit; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
section { padding: 120px max(24px, 5vw); }
.wrap { max-width: 1180px; margin: 0 auto; }

h1, h2 { text-wrap: balance; font-weight: 700; }
h1 {
  max-width: 1040px; margin: 0 auto 22px;
  font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -.045em;
}
h2 {
  margin: 0 0 18px;
  font-size: clamp(32px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -.035em;
}

/* Starfield canvas, drawn by js/background.js */
#sky {
  position: fixed; inset: 0; z-index: -1;
  width: 100%; height: 100%; pointer-events: none;
}

/* 4. Navigation ----------------------------------------------------------- */
nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 52px; padding: 0 max(24px, 5vw);
  background: rgba(11, 12, 14, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
/* keeps the iPhone status-bar area dark under the sticky nav */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 30;
  height: env(safe-area-inset-top, 0px); background: rgba(11, 12, 14, .72);
}
.logo { display: block; width: clamp(150px, 18vw, 208px); transition: opacity .3s; }
.logo img { display: block; width: 100%; height: auto; }
.logo:hover { opacity: .7; }
.flogo { width: 150px; opacity: .85; }

.links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.links a:not(.btn) { transition: color .3s; }
.links a:not(.btn):hover { color: var(--text); }

/* 5. Buttons -------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .04); color: var(--text);
  font: 600 16px var(--font); letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .35s var(--ease), background-color .35s, border-color .35s;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.btn.sm { min-height: 38px; padding: 0 20px; font-size: 14px; }

/* Primary: white pill. Hover = tight colored rim light + soft pointer glow */
.btn.main {
  border: 0; background: #f5f5f7; color: #0b0c0e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 10px 28px -10px rgba(0, 0, 0, .7);
}
.btn.main:hover { background: #fff; }
.btn.main::before { /* rim light behind the button */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: conic-gradient(from var(--a), var(--teal), var(--rose), var(--amber), var(--teal));
  filter: blur(6px); transform: scale(1.02); opacity: 0;
  transition: opacity .6s var(--ease);
  animation: orbit 8s linear infinite paused;
}
.btn.main:hover::before, .btn.main:focus-visible::before { opacity: .5; animation-play-state: running; }
.btn.main::after { /* glow that follows the cursor */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(36px circle at var(--mx, 50%) var(--my, 50%), rgba(37, 168, 208, .32), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.btn.main:hover::after { opacity: 1; }
/* nav / label colors must not override the primary button's dark text */
.links a.btn.main, .links a.btn.main:hover { color: #0b0c0e; }

/* Secondary: glass. Hover = 1px orbiting gradient outline */
.btn.ghost {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn.ghost:hover { background: rgba(255, 255, 255, .09); }
.btn.ghost::before {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--a), var(--teal), var(--rose), var(--amber), var(--teal));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .5s;
  animation: orbit 8s linear infinite paused;
}
.btn.ghost:hover::before { opacity: 1; animation-play-state: running; }

@keyframes orbit { to { --a: 360deg; } }

/* 6. Hero ----------------------------------------------------------------- */
.hero { position: relative; padding-top: 64px; text-align: center; }
.lead {
  max-width: 660px; margin: 0 auto 34px;
  color: var(--muted); font-size: clamp(18px, 2vw, 23px); line-height: 1.45; letter-spacing: -.01em;
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.note { margin-top: 16px; color: var(--dim); font-size: 14px; }

/* page-load sequence */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes show { from { opacity: 0; } to { opacity: 1; } }
.hero h1, .hero .lead, .hero .cta, .hero .note { animation: rise 1.1s var(--ease) both; }
.hero .lead { animation-delay: .12s; }
.hero .cta  { animation-delay: .24s; }
.hero .note { animation-delay: .32s; }

/* 7. Feature blocks ------------------------------------------------------- */
.feat { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.feat.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feat.rev .txt { order: 2; }
.band { background: linear-gradient(180deg, transparent, rgba(16, 17, 19, .55) 20%, rgba(16, 17, 19, .55) 80%, transparent); }

.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  color: var(--teal); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, var(--teal), transparent); }

.txt p { max-width: 52ch; margin: 0 0 18px; color: var(--muted); }
.txt ul { position: relative; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.txt ul::before {
  content: ""; position: absolute; top: -1px; left: 0; width: 72px; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--rose), transparent);
}
.txt li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; transition: opacity .4s; }
.txt ul:hover li { opacity: .38; }
.txt ul li:hover { opacity: 1; }
.txt li b { display: block; font-weight: 700; }
.txt li span { color: var(--muted); font-size: 15px; }

/* 8. Screenshots in 3D (tilt is driven by js/tilt.js) --------------------- */
.stage { position: relative; perspective: 1700px; perspective-origin: 50% 35%; }
.tilt { position: relative; transform-origin: 50% 60%; will-change: transform; }
.tilt::before { /* soft aura behind the screenshot */
  content: ""; position: absolute; inset: 6% 4% -6%; z-index: -1; border-radius: 40%; pointer-events: none;
  background: conic-gradient(from 210deg, var(--teal), var(--rose), var(--amber), var(--teal));
  filter: blur(56px); opacity: .28;
}
.frame { position: relative; border-radius: 14px; isolation: isolate; }
.shot {
  display: block; width: 100%; height: auto; border-radius: 14px;
  box-shadow: 0 60px 110px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07);
}
.frame::before { /* light catching the glass edge */
  content: ""; position: absolute; inset: 0; z-index: 2; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .05) 35%, transparent 62%, rgba(217, 140, 69, .32));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.frame::after { /* pointer glare */
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .07), transparent 70%);
  opacity: 0; transition: opacity .5s;
}
.frame:hover::after { opacity: 1; }

.hero .stage { max-width: 1120px; margin: 56px auto 0; animation: show 1.6s .4s both; }
.hero .stage::after { /* floor glow under the hero screenshot */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -8%; z-index: -1; height: 22%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(37, 168, 208, .16), rgba(178, 80, 107, .08) 60%, transparent);
  filter: blur(36px);
}

/* 9. Download ------------------------------------------------------------- */
.head { max-width: 720px; margin: 0 auto; text-align: center; }
.head p { margin: 0; color: var(--muted); }
.head .eyebrow { justify-content: center; }
.head .eyebrow::before { display: none; }

.get { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel);
}
.card h3 { margin: 0; font-size: 26px; }
.card p { margin: 0; color: var(--muted); }
.card .btn { margin-top: auto; }
.card.hl { /* featured card: colored light from two corners + gradient edge */
  border-color: transparent;
  background:
    radial-gradient(70% 60% at 12% 0%, rgba(37, 168, 208, .15), transparent 70%),
    radial-gradient(60% 60% at 100% 100%, rgba(217, 140, 69, .11), transparent 70%),
    linear-gradient(var(--panel), var(--panel)),
    linear-gradient(135deg, rgba(37, 168, 208, .65), rgba(255, 255, 255, .09) 38%, rgba(255, 255, 255, .09) 62%, rgba(217, 140, 69, .6));
  background-origin: border-box;
  background-clip: padding-box, padding-box, padding-box, border-box;
}

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin: 44px 0 0; padding: 0; list-style: none; counter-reset: step;
}
.steps li { padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; counter-increment: step; }
.steps li::before { content: counter(step); display: block; width: max-content; color: var(--text); font-size: 30px; font-weight: 700; }
code { padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--text); font: inherit; font-size: .92em; word-break: break-word; }

/* 10. Footer -------------------------------------------------------------- */
footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 40px max(24px, 5vw); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}

/* 11. Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .links a:not(.btn) { display: none; }
  section { padding: 72px 20px; }
  .feat, .feat.rev, .get, .steps { grid-template-columns: 1fr; }
  .feat { gap: 32px; }
  .feat.rev .txt { order: 0; }
}

/* 12. Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1, .hero .lead, .hero .cta, .hero .note, .hero .stage { animation: none; }
  .btn::before { animation: none !important; }
}
