/* =========================================================
   Motaltech — "sketchbook studio" theme
   Brand palette
     Ink      #14162B   primary text, outlines
     Paper    #F5F0E6   background
     Coral    #FF5B3A   primary accent / action
     Volt     #3D5AFE   secondary accent
     Marker   #FFD23F   highlight
   ========================================================= */

:root {
  --paper: #F5F0E6;
  --paper-2: #EDE5D3;
  --card: #FFFDF8;
  --ink: #14162B;
  --ink-soft: #4A4E6A;
  --coral: #FF5B3A;
  --blue: #3D5AFE;
  --yellow: #FFD23F;
  --grid: rgba(61, 90, 254, 0.07);
  --hatch: rgba(20, 22, 43, 0.55);
  --noise-blend: multiply;
  --noise-opacity: 0.35;

  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --radius: 14px;
  --wrap: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="blueprint"] {
  --paper: #0F2654;
  --paper-2: #0B1F47;
  --card: #133066;
  --ink: #E9F0FF;
  --ink-soft: #A8BCE8;
  --coral: #FF7A5C;
  --blue: #8EA8FF;
  --yellow: #FFD23F;
  --grid: rgba(255, 255, 255, 0.075);
  --hatch: rgba(233, 240, 255, 0.45);
  --noise-blend: screen;
  --noise-opacity: 0.12;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M3 23l2-7L18 3l5 5L10 21z' fill='%23FFD23F' stroke='%2314162B' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M3 23l2-7 5 5z' fill='%2314162B'/%3E%3C/svg%3E") 2 24, auto;
}
/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
a, button, label, select, summary { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, h4 { line-height: 1.08; margin: 0 0 .5em; letter-spacing: -0.02em; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--yellow); color: #14162B; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px dashed var(--coral); outline-offset: 4px; border-radius: 6px; }

.eyebrow {
  font-family: var(--hand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: .4em;
  letter-spacing: .01em;
}

/* ---------- rough.js sketch frames ---------- */
[data-rough] { position: relative; isolation: isolate; border: 2px solid var(--ink); border-radius: 12px; }
[data-rough].roughed { border-color: transparent; background: transparent !important; }
.rough-svg { position: absolute; z-index: -1; pointer-events: none; overflow: visible; }

/* ---------- buttons ---------- */
.btn {
  --rough-fill: var(--card);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: 600 1rem/1 var(--font);
  padding: 15px 24px;
  text-decoration: none;
  color: var(--ink);
  background: var(--rough-fill);
  transition: transform .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -3px) rotate(-1deg); }
.btn:active { transform: translate(1px, 1px); }
.btn--coral { --rough-fill: var(--coral); color: #14162B; }
.btn--ink { --rough-fill: var(--ink); color: var(--paper); }
.btn--ghost { --rough-fill: transparent; }
.btn--paper { --rough-fill: #FFFDF8; color: #14162B; border: 2px solid #14162B; border-radius: 10px; }
.btn--ink:not([data-rough]) { border: 2px solid var(--ink); border-radius: 10px; }
.btn--sm { padding: 11px 16px; font-size: .92rem; }
.btn--block { width: 100%; }
button.btn { border: 0; }
button.btn[data-rough]:not(.roughed) { border: 2px solid var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 2px dashed transparent;
  transition: border-color .3s, background-color .5s;
}
.nav.scrolled { border-bottom-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 44px; height: 44px; transition: transform .5s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }
.brand__frame { fill: #14162B; stroke: #F5F0E6; stroke-width: 2; }
.brand__mt { fill: none; stroke: #F5F0E6; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.brand__cursor { fill: var(--coral); animation: caret 1.1s steps(1) infinite; }
.brand__word { font-weight: 700; font-size: 1.45rem; letter-spacing: -0.04em; }
.brand__word em { font-style: normal; color: var(--coral); }

.nav__links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav__links > a:not(.btn) { text-decoration: none; font-weight: 500; position: relative; padding: 4px 0; }
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: -2px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C 25 2, 50 9, 75 4 S 95 5, 98 6' fill='none' stroke='%23FF5B3A' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav__links > a:not(.btn):hover::after, .nav__links > a.active::after { transform: scaleX(1); }

.nav__tools { display: flex; align-items: center; gap: 10px; }
.mode {
  position: relative; display: inline-flex;
  font: 700 1.1rem/1 var(--hand);
  background: transparent; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; padding: 3px;
}
.mode__opt { position: relative; z-index: 1; padding: 6px 10px; border-radius: 999px; transition: color .3s; }
.mode::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--yellow); transition: transform .4s var(--ease);
}
.mode__opt--paper { color: #14162B; }
:root[data-theme="blueprint"] .mode::before { transform: translateX(100%); width: calc(54% - 3px); }
:root[data-theme="blueprint"] .mode__opt--paper { color: var(--ink); }
:root[data-theme="blueprint"] .mode__opt--blue { color: #14162B; }

.burger { display: none; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); padding: 10px 9px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 30px; position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 24px; align-items: center; min-height: min(78vh, 680px); }
.hero__title { font-size: clamp(2.8rem, 6.4vw, 5.4rem); font-weight: 700; letter-spacing: -0.045em; line-height: .98; margin-bottom: .35em; }
.hero__lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--ink-soft); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.scribble { position: relative; display: inline-block; white-space: nowrap; }
.scribble svg { position: absolute; left: -2%; bottom: -.08em; width: 104%; height: .32em; overflow: visible; }
.scribble path { fill: none; stroke: var(--coral); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; filter: url(#wobble); }
.in .scribble path, .scribble.in path, .reveal.in .scribble path { animation: draw 1.1s .4s var(--ease) forwards; }

.hl {
  position: relative; white-space: nowrap;
  background-image: linear-gradient(100deg, transparent 0 1%, color-mix(in srgb, var(--yellow) 85%, transparent) 2% 97%, transparent 98%);
  background-repeat: no-repeat; background-position: 0 88%; background-size: 0% 46%;
  transition: background-size 1s .35s var(--ease);
  padding: 0 .08em;
}
.reveal.in .hl, .hl.in { background-size: 100% 46%; }
.hl--blue { background-image: linear-gradient(100deg, transparent 0 1%, color-mix(in srgb, var(--blue) 35%, transparent) 2% 97%, transparent 98%); }
.hl--coral { background-image: linear-gradient(100deg, transparent 0 1%, color-mix(in srgb, var(--coral) 40%, transparent) 2% 97%, transparent 98%); }

.note { font-family: var(--hand); font-size: 1.5rem; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.note svg { width: 60px; height: 38px; }
.note path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.note--hero { margin-top: 30px; transform: rotate(-3deg); }

.hero__stage { position: relative; height: clamp(360px, 52vw, 600px); }
#hero3d { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#hero3d:active { cursor: grabbing; }
.stage__label {
  position: absolute; font: 700 1.35rem var(--hand); color: var(--ink);
  background: var(--card); border: 2px solid var(--ink); border-radius: 10px;
  padding: 2px 12px; pointer-events: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.stage__label--a { top: 12%; left: 2%; transform: rotate(-6deg); animation: bob 5s ease-in-out infinite; }
.stage__label--b { bottom: 14%; right: 4%; transform: rotate(5deg); background: var(--yellow); color: #14162B; border-color: #14162B; animation: bob 6s 1s ease-in-out infinite; }
.no-webgl .hero__stage { background: url("../assets/logo.svg") center/50% no-repeat; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 30px; }
.stat { border-top: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent); padding-top: 14px; }
.stat b { display: inline-block; font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.04em; }
.stat span { display: block; font-family: var(--hand); font-size: 1.35rem; color: var(--ink-soft); line-height: 1.1; }

/* ---------- marquee ---------- */
.marquee {
  background: var(--ink); color: var(--paper);
  transform: rotate(-1.6deg); margin: 50px -20px 20px;
  overflow: hidden; padding: 16px 0;
  border-top: 3px solid var(--coral); border-bottom: 3px solid var(--coral);
}
.marquee__track { display: flex; gap: 28px; width: max-content; animation: marquee 32s linear infinite; align-items: center; }
.marquee span { font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
.marquee i { font-style: normal; color: var(--yellow); font-size: 1.3rem; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section--alt { background: color-mix(in srgb, var(--paper-2) 75%, transparent); }
.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; }
.about__text > p { color: var(--ink-soft); font-size: 1.1rem; max-width: 56ch; }
.engines { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 34px; }
.sticky {
  position: relative; padding: 26px 22px 20px; color: #14162B;
  box-shadow: 0 14px 22px -12px rgba(0,0,0,.35), 0 2px 0 rgba(0,0,0,.05);
  border-radius: 2px 2px 18px 2px;
  transition: transform .4s var(--ease);
}
.sticky::before { content: ""; position: absolute; top: -12px; left: 50%; width: 86px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.06); }
.sticky h3 { font-family: var(--hand); font-size: 2rem; margin-bottom: .2em; }
.sticky p { margin: 0; font-size: .98rem; }
.sticky--yellow { background: #FFE27A; transform: rotate(-2deg); }
.sticky--blue { background: #BFD0FF; transform: rotate(2deg); }

.about__cube { position: relative; height: 380px; display: grid; place-items: center; perspective: 1000px; }
.cube { --s: 180px; width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; animation: spin 16s linear infinite; }
.about__cube:hover .cube { animation-duration: 5s; }
.cube__face {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 2.4rem var(--hand); color: var(--ink);
  background: var(--card);
  border: 3px solid var(--ink); border-radius: 6px;
  backface-visibility: visible;
  box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--card) 100%, transparent), inset 0 0 0 9.5px color-mix(in srgb, var(--ink) 25%, transparent);
}
.cube__face img { width: 60%; }
.f1 { transform: translateZ(calc(var(--s) / 2)); background: var(--yellow); color: #14162B; }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: var(--coral); color: #14162B; }
.f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: var(--blue); color: #fff; }
.cube__shadow {
  position: absolute; bottom: 30px; width: 200px; height: 34px; border-radius: 50%;
  background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 7px);
  opacity: .55; animation: shadow 4s ease-in-out infinite;
}
.note--cube { position: absolute; top: 4px; right: 0; transform: rotate(6deg); font-size: 1.4rem; }

/* ---------- service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.card {
  --rough-fill: var(--card);
  background: var(--rough-fill);
  padding: 30px 26px 26px;
  transform-style: preserve-3d;
  transition: transform .2s ease-out;
  will-change: transform;
}
.card__icon { width: 54px; height: 54px; margin-bottom: 18px; }
.card__icon * { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card:nth-child(3n+1) .card__icon { background: radial-gradient(circle at 60% 60%, color-mix(in srgb, var(--coral) 45%, transparent) 0 42%, transparent 43%); }
.card:nth-child(3n+2) .card__icon { background: radial-gradient(circle at 60% 60%, color-mix(in srgb, var(--blue) 40%, transparent) 0 42%, transparent 43%); }
.card:nth-child(3n) .card__icon { background: radial-gradient(circle at 60% 60%, color-mix(in srgb, var(--yellow) 70%, transparent) 0 42%, transparent 43%); }
.card p { color: var(--ink-soft); }
.card__tag { font: 700 1.2rem var(--hand); color: var(--coral); }
.card h3, .card__icon { transform: translateZ(30px); }

/* ---------- products (3D flip) ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.flip { perspective: 1200px; height: 360px; outline: none; }
.flip__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.flip:hover .flip__inner, .flip.flipped .flip__inner { transform: rotateY(180deg) rotateZ(-2deg); }
.flip__face {
  position: absolute; inset: 0; padding: 30px 26px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column;
}
.flip__front { --rough-fill: var(--card); background: var(--rough-fill); color: var(--ink); border: 0; width: 100%; font: inherit; text-align: left; appearance: none; }
.flip__front h3 { font-size: 2rem; margin-top: auto; }
.flip__front p { color: var(--ink-soft); margin: 0; }
.flip__hint { position: absolute; top: 26px; right: 24px; font: 700 1.25rem var(--hand); color: var(--ink-soft); }
.flip__back {
  transform: rotateY(180deg);
  background: var(--coral); color: #14162B;
  border: 2.5px solid #14162B; border-radius: 14px;
  box-shadow: 8px 8px 0 #14162B;
}
.flip__back--blue { background: #8EA8FF; }
.flip__back--yellow { background: var(--yellow); }
.flip__back h3 { font-size: 2.2rem; }
.flip__back ul { list-style: none; padding: 0; margin: 4px 0 auto; }
.flip__back li { padding: 8px 0 8px 32px; position: relative; font-weight: 500; border-bottom: 1.5px dashed rgba(20,22,43,.35); }
.flip__back li::before { content: "✓"; position: absolute; left: 4px; font: 700 1.4rem/1 var(--hand); top: 8px; }
.flip__back .btn { align-self: flex-start; margin-top: 20px; }

.pmark { width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; border: 2.5px solid #14162B; box-shadow: 4px 4px 0 #14162B; transform: rotate(-4deg); }
.pmark svg { width: 56px; height: 56px; }
.pmark * { fill: none; stroke: #14162B; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pmark--coral { background: var(--coral); }
.pmark--blue { background: #8EA8FF; transform: rotate(3deg); }
.pmark--yellow { background: var(--yellow); }
.flip:hover .pmark { animation: wiggle .6s var(--ease); }

.badge { position: absolute; top: 26px; left: 140px; font: 700 1.2rem/1 var(--hand); padding: 4px 10px 5px; border-radius: 999px; background: #2EC27E; color: #fff; transform: rotate(4deg); }
.badge--blue { background: var(--blue); color: #fff; }
.badge--yellow { background: var(--yellow); color: #14162B; }
:root[data-theme="blueprint"] .badge--blue { color: #14162B; }

/* ---------- process ---------- */
.process { position: relative; }
.process__line { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 120px; overflow: visible; }
.process__line path { fill: none; stroke: var(--coral); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 12; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; position: relative; }
.step { padding-top: 20px; }
.step__n {
  display: grid; place-items: center; width: 80px; height: 80px; margin-bottom: 22px;
  font: 700 2.8rem/1 var(--hand); color: #14162B;
  background: var(--yellow); border: 3px solid #14162B;
  border-radius: 52% 48% 55% 45% / 48% 55% 45% 52%;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .4s var(--ease);
}
.step:nth-child(2) .step__n { background: #8EA8FF; margin-top: 30px; }
.step:nth-child(3) .step__n { background: var(--coral); }
.step:nth-child(4) .step__n { background: #2EC27E; margin-top: 30px; }
.step:hover .step__n { transform: rotate(-10deg) scale(1.08); }
.step p { color: var(--ink-soft); }

/* ---------- testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.quote {
  margin: 0; padding: 34px 28px 24px; position: relative;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px;
  transform: rotate(-1.5deg);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 85%, transparent);
  background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--blue) 18%, transparent) 31px 32px);
  background-position: 0 18px;
  transition: transform .2s ease-out;
}
.quote::before { content: "“"; position: absolute; top: -36px; left: 16px; font: 700 6rem/1 var(--font); color: var(--coral); }
.quote--b { transform: rotate(1.5deg); }
.quote--c { transform: rotate(-.6deg); }
.quote p { font-size: 1.08rem; line-height: 2rem; }
.quote footer { font: 700 1.3rem var(--hand); color: var(--ink-soft); }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(6, 1fr); gap: 34px 22px; }
@media (max-width: 1100px) { .team { grid-template-columns: repeat(3, 1fr); } }
.polaroid {
  margin: 0; background: #FFFDF8; color: #14162B;
  padding: 12px 12px 16px; border-radius: 3px;
  box-shadow: 0 16px 26px -14px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.12);
  transform: rotate(var(--r, -2deg));
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  position: relative;
}
.polaroid::before { content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; background: color-mix(in srgb, var(--yellow) 55%, transparent); transform: translateX(-50%) rotate(var(--r, -2deg)); }
.polaroid:nth-child(2) { --r: 2.5deg; }
.polaroid:nth-child(3) { --r: -1deg; }
.polaroid:nth-child(4) { --r: 3deg; }
.polaroid:nth-child(5) { --r: -3deg; }
.polaroid:nth-child(6) { --r: 1.5deg; }
.polaroid:hover { transform: rotate(0) translateY(-10px) scale(1.04); box-shadow: 0 26px 36px -16px rgba(0,0,0,.5); z-index: 2; }
.avatar { aspect-ratio: 1; border-radius: 2px; overflow: hidden; border: 2px solid #14162B; }
.avatar svg { width: 100%; height: 100%; }
.polaroid figcaption { padding: 12px 4px 0; }
.polaroid figcaption b { display: block; font: 700 1.6rem/1.1 var(--hand); }
.polaroid figcaption span { font-size: .9rem; color: #4A4E6A; }
.polaroid__links { display: flex; gap: 8px; padding: 10px 4px 0; }
.polaroid__links a { font: 700 .8rem/1 var(--font); text-decoration: none; padding: 6px 8px; border: 1.5px solid #14162B; border-radius: 6px; }
.polaroid__links a:hover { background: var(--yellow); }
.polaroid .avatar svg .blink { animation: blink 5s infinite; transform-origin: center; transform-box: fill-box; }

.polaroid--join { background: transparent; box-shadow: none; padding: 0; }
.polaroid--join::before { display: none; }
.join {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  height: 100%; min-height: 280px; padding: 20px; text-decoration: none; color: var(--ink);
  border: 3px dashed color-mix(in srgb, var(--ink) 55%, transparent); border-radius: 6px;
  transition: background-color .3s, border-color .3s;
}
.join:hover { background: color-mix(in srgb, var(--yellow) 30%, transparent); border-color: var(--ink); }
.join__plus { font: 700 4rem/1 var(--hand); color: var(--coral); transition: transform .5s var(--ease); }
.join:hover .join__plus { transform: rotate(180deg); }
.join b { font: 700 2rem var(--hand); }
.join span:last-child { color: var(--ink-soft); font-size: .95rem; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: start; }
.contact__info > p { color: var(--ink-soft); font-size: 1.1rem; max-width: 44ch; }
.contact__list { list-style: none; padding: 0; margin: 30px 0; }
.contact__list li { display: flex; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 2px dashed color-mix(in srgb, var(--ink) 20%, transparent); font-weight: 500; }
.contact__list span { font: 700 1.3rem var(--hand); color: var(--coral); width: 64px; flex: none; }
.contact__list a { text-decoration: none; }
.contact__list a:hover { text-decoration: underline wavy var(--coral); text-underline-offset: 5px; }
.socials { display: flex; gap: 14px; }
.socials a { --rough-fill: var(--card); background: var(--rough-fill); width: 48px; height: 48px; display: grid; place-items: center; text-decoration: none; font-weight: 700; transition: transform .25s var(--ease); }
.socials a:hover { transform: translateY(-4px) rotate(-6deg); }

.form { --rough-fill: var(--card); background: var(--rough-fill); padding: 40px 34px 30px; }
.form__tape { position: absolute; top: -16px; left: 50%; width: 120px; height: 30px; transform: translateX(-50%) rotate(-2deg); background: color-mix(in srgb, var(--coral) 45%, transparent); }
.field { border: 0; padding: 0; margin: 0 0 22px; }
.field label, .field legend { display: block; font: 700 1.35rem var(--hand); margin-bottom: 4px; padding: 0; }
.field input, .field textarea, .field select {
  width: 100%; font: 500 1rem var(--font); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid color-mix(in srgb, var(--ink) 45%, transparent);
  padding: 10px 2px; border-radius: 0; outline: none;
  transition: border-color .25s, background-size .4s var(--ease);
  background-image: linear-gradient(var(--coral), var(--coral)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 2px;
}
.field select { appearance: none; background-image: linear-gradient(var(--coral), var(--coral)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23FF5B3A' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-position: 0 100%, right 6px center; background-size: 0 2px, 14px 9px; }
.field select option { color: #14162B; }
.field input:focus, .field textarea:focus, .field select:focus { background-size: 100% 2px; border-bottom-color: transparent; }
.field select:focus { background-size: 100% 2px, 14px 9px; }
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--ink) 38%, transparent); }
.field.invalid input, .field.invalid textarea { border-bottom-color: var(--coral); }
.field.invalid label::after { content: "  ← needs this"; color: var(--coral); font-size: 1.15rem; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.chips label { margin: 0; font: inherit; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 7px 14px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 500; font-size: .92rem; transition: background-color .2s, transform .2s var(--ease); }
.chips label:hover span { transform: rotate(-3deg); }
.chips input:checked + span { background: var(--yellow); color: #14162B; border-color: #14162B; box-shadow: 2px 2px 0 var(--ink); }
.chips input:focus-visible + span { outline: 3px dashed var(--coral); outline-offset: 3px; }
.form__status { font: 700 1.4rem var(--hand); margin: 14px 0 0; min-height: 1.6em; text-align: center; }
.form__status.ok { color: #2EC27E; }
.form__status.err { color: var(--coral); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding: 70px 0 28px; margin-top: 40px; position: relative; }
.footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 20px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20 V10 Q 25 2 50 10 T 100 10 T 150 10 T 200 10 V20z'/%3E%3C/svg%3E") 0 0/400px 100% repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20 V10 Q 25 2 50 10 T 100 10 T 150 10 T 200 10 V20z'/%3E%3C/svg%3E") 0 0/400px 100% repeat-x;
}
.footer__inner { display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.footer__brand p { color: color-mix(in srgb, var(--paper) 70%, transparent); margin-top: 16px; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer h4 { font: 700 1.5rem var(--hand); color: var(--yellow); margin-bottom: 10px; letter-spacing: 0; }
.footer__cols a { display: block; text-decoration: none; padding: 4px 0; color: color-mix(in srgb, var(--paper) 80%, transparent); transition: color .2s, transform .2s; }
.footer__cols a:hover { color: var(--paper); transform: translateX(4px); }
.footer__base { display: flex; justify-content: space-between; margin-top: 50px; padding-top: 20px; border-top: 1.5px dashed color-mix(in srgb, var(--paper) 25%, transparent); font-size: .9rem; color: color-mix(in srgb, var(--paper) 65%, transparent); }
.totop { text-decoration: none; font: 700 1.25rem var(--hand); color: var(--yellow); }

/* ---------- reveal ---------- */
.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal:not(.in) { opacity: 0; transform: translateY(26px); }
.sticky.reveal.in.sticky--yellow { transform: rotate(-2deg); }
.sticky.reveal.in.sticky--blue { transform: rotate(2deg); }
.quote.reveal.in { transform: rotate(-1.5deg); }
.quote--b.reveal.in { transform: rotate(1.5deg); }
.quote--c.reveal.in { transform: rotate(-.6deg); }
.polaroid.reveal.in { transform: rotate(var(--r, -2deg)); }
.polaroid.reveal.in:hover { transform: rotate(0) translateY(-10px) scale(1.04); }

/* ---------- keyframes ---------- */
@keyframes caret { 50% { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }
@keyframes shadow { 50% { transform: scale(.82); opacity: .35; } }
@keyframes bob { 50% { translate: 0 -8px; } }
@keyframes pulse { 50% { transform: scale(1.35); } }
@keyframes wiggle { 25% { rotate: 6deg; } 50% { rotate: -6deg; } 75% { rotate: 3deg; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .cards, .products, .quotes { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .about__cube { height: 320px; }
}

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav__links {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 2px solid var(--ink);
    padding: 8px 24px 22px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .3s var(--ease), opacity .3s, visibility 0s .3s;
  }
  .nav__links.open { transform: none; opacity: 1; visibility: visible; transition: transform .3s var(--ease), opacity .3s; }
  .nav__links > a:not(.btn) { padding: 14px 0; font-size: 1.15rem; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 20%, transparent); }
  .nav__links .btn { margin-top: 16px; }

  .hero__grid { grid-template-columns: 1fr; min-height: 0; }
  .hero__stage { height: 380px; order: -1; margin: 0 -16px; }
  .note--hero { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; gap: 40px; }
  .footer__inner { grid-template-columns: 1fr; }

  .process__line { display: none; }
  .steps { grid-template-columns: 1fr; gap: 0; border-left: 3px dashed var(--coral); margin-left: 38px; }
  .step { display: grid; grid-template-columns: 80px 1fr; column-gap: 20px; padding: 0 0 28px; margin-left: -41px; }
  .step .step__n, .step:nth-child(n) .step__n { grid-row: span 2; margin: 0; }
  .step h3 { align-self: end; margin-top: 12px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .cards, .products, .quotes, .engines { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); gap: 26px 16px; }
  .polaroid figcaption b { font-size: 1.35rem; }
  .mode__opt { padding: 5px 7px; font-size: 1rem; }
  .brand__word { font-size: 1.25rem; }
  .nav__inner { gap: 10px; }
  .form { padding: 34px 20px 24px; }
  .flip { height: 330px; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); }
  .footer__base { flex-direction: column; gap: 10px; }
  .hero__cta .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .brand__word { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .scribble path { stroke-dashoffset: 0; }
}
