/* Jackass Meshworks — site styles
   Layout: logo + nav top-left, one centered column per page, small footer bottom-left.
   Light pages sit on tan with the horseshoe pattern; product pages sit on dark brown
   and pick up that product's accent color from --accent on <body>. */

:root {
  /* Master brand (measured from the original Framer site) */
  --tan: #9e987d;
  --ink: #2f2d28;          /* active nav, strong text on tan */
  --ink-soft: #5e5a50;     /* inactive nav on tan */
  --brown: #4c4134;        /* headlines on tan, background of product pages */
  --cream: #f9eed2;        /* text on dark */
  --chip: #33312d;         /* dark pill */
  --snow: #fffafa;         /* footer text, card copy */
  --circle: #3e5230;       /* donkey badge green */

  --accent: #fc9b27;       /* overridden per product */

  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;

  --gutter: clamp(16px, 7vw, 48px);
  --ease-pop: cubic-bezier(.2, 1.35, .4, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  color: var(--ink);
  background-color: var(--tan);
  background-image: url("../assets/horseshoes.webp");
  background-size: max(1440px, 100vw) auto;
  background-position: center top;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: var(--cream); padding: 8px 12px; z-index: 20;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  padding-top: 22px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.logo { display: block; width: 199px; max-width: 60vw; line-height: 0; text-decoration: none; }
.logo img { width: 100%; height: auto; }

.nav { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 4px; }
.nav a {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 0;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: color .2s, background-size .25s var(--ease-out);
}
.nav a:hover { color: var(--ink); background-size: 100% 2px; }
.nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Main + footer ---------- */
main {
  flex: 1;
  width: 100%;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  padding-block: 32px 48px;
  position: relative;
  z-index: 1;
}

.site-footer {
  padding-left: max(55px, env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  padding-block: 0 32px;
  font-size: 12px;
  color: var(--snow);
  position: relative;
  z-index: 2;
}
.site-footer p { margin: 0; }

/* ---------- Home / About hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.badge {
  display: block;
  width: min(525px, 82vw);
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
}

/* Loop (7s), circle pops in once, then:
   rise up out of the circle with ears pointing down -> ears spring up -> hold and blink
   -> ears lift a little higher -> duck back down out of sight -> repeat.
   The circle (plus the space above its middle) masks him; hover flicks the ears. */
.badge g { transform-box: fill-box; }
.b-circle { transform-origin: 50% 50%; animation: pop .5s var(--ease-pop) both; }
.b-rise   { transform-box: view-box; animation: rise-loop 7s .15s infinite backwards; }
.b-ear-l  { transform-origin: 88% 92%; animation: ear-l-loop 7s .15s infinite backwards; }
.b-ear-r  { transform-origin: 8% 88%;  animation: ear-r-loop 7s .15s infinite backwards; }
.b-lids   { opacity: 0; animation: blink-loop 7s .15s infinite backwards; }
/* The hover flick lives on an inner layer, so it never restarts the ears' loop
   (restarting it put the ears out of step with the body). */
.b-ear-l .b-flick { transform-origin: 88% 92%; }
.b-ear-r .b-flick { transform-origin: 8% 88%; }
.badge:hover .b-ear-l .b-flick { animation: flick-l .45s ease-in-out; }
.badge:hover .b-ear-r .b-flick { animation: flick-r .45s .05s ease-in-out; }

@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise-loop {
  0%        { transform: translateY(820px); animation-timing-function: cubic-bezier(.25, 1.12, .45, 1); }
  12%       { transform: none; }
  79%       { transform: none; animation-timing-function: cubic-bezier(.55, 0, .85, .35); }
  90%, 100% { transform: translateY(820px); }
}
/* ears: flipped down while rising, flip up with a spring (no sideways sweep outside the
   circle), lift a little higher before ducking, stretch long as he drops, reset while hidden */
@keyframes ear-l-loop {
  0%, 9%    { transform: scale(.85, -.85); animation-timing-function: cubic-bezier(.2, 1.6, .4, 1); }
  18%       { transform: none; }
  73%       { transform: none; animation-timing-function: ease-out; }
  78%       { transform: rotate(14deg); animation-timing-function: cubic-bezier(.3, 1.4, .5, 1); }
  84%, 90%  { transform: rotate(16deg) scale(.92, 1.24); }
  95%, 100% { transform: scale(.85, -.85); }
}
@keyframes ear-r-loop {
  0%, 10%   { transform: scale(.85, -.85); animation-timing-function: cubic-bezier(.2, 1.6, .4, 1); }
  19%       { transform: none; }
  73%       { transform: none; animation-timing-function: ease-out; }
  78%       { transform: rotate(-16deg); animation-timing-function: cubic-bezier(.3, 1.4, .5, 1); }
  84%, 90%  { transform: rotate(-18deg) scale(.92, 1.24); }
  95%, 100% { transform: scale(.85, -.85); }
}
@keyframes blink-loop {
  0%, 35%, 38.5%, 60%, 63.5%, 100% { opacity: 0; }
  36%, 38%, 61%, 63% { opacity: 1; }
}
@keyframes flick-l { 50% { transform: rotate(-9deg); } }
@keyframes flick-r { 50% { transform: rotate(9deg); } }

.tagline {
  margin: 0;
  font-weight: 600;
  font-size: clamp(24px, 4.6vw, 35px);
  line-height: 1.2;
  color: var(--brown);
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 34em;
  font-weight: 500;
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.4;
  color: var(--brown);
  text-wrap: balance;
}

/* ---------- Plugins grid ---------- */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 345px));
  justify-content: center;
  gap: 22px;
  margin: 0 auto;
}

.card {
  --accent: var(--card-accent, #fc9b27);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 28px;
  border-radius: 16px;
  background: rgb(91 87 79 / .42);
  border: 2px solid #a7a185;   /* same color as the background horseshoes */
  backdrop-filter: blur(6px);
  overflow: hidden;
  text-decoration: none;
  color: var(--snow);
  transition: transform .25s var(--ease-out), background-color .25s;
  animation: rise .5s var(--ease-out) both;
}
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:hover { transform: translateY(-4px); background: rgb(91 87 79 / .55); }

.card-media { aspect-ratio: 16 / 9; background: rgb(47 45 40 / .35); }
.card-media video, .card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body { display: flex; flex-direction: column; gap: 10px; padding-inline: 28px; }
.card h2 { margin: 0; font-weight: 500; font-size: 35px; line-height: 1.1; color: var(--accent); }
.card p { margin: 0; font-weight: 500; font-size: 19px; line-height: 1.2; text-wrap: pretty; }

@keyframes rise { from { transform: translateY(16px); opacity: .3; } to { transform: none; opacity: 1; } }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.pill {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 14px;
  border-radius: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: .02em;
  text-transform: uppercase; text-decoration: none;
  background: var(--chip); color: var(--cream);
}
.pill-accent { background: var(--accent); color: var(--chip); }
.pill-quiet  { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px rgb(249 238 210 / .5); }

/* ---------- Product pages (dark) ---------- */
body.product {
  background-color: var(--product-bg, var(--brown)); color: var(--cream);
  /* a wash of the page color over the pattern keeps the horseshoes subtle on dark pages */
  background-image: linear-gradient(rgb(26 20 33 / var(--pattern-wash, 0)), rgb(26 20 33 / var(--pattern-wash, 0))), url("../assets/horseshoes.webp");
}
body.product .nav a { color: var(--accent); }
body.product .nav a:hover, body.product .nav a[aria-current="page"] { color: var(--cream); }

.product-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 22px; max-width: 760px; margin: 0 auto;
}

.product-mark { width: 120px; height: auto; animation: pop .5s var(--ease-pop) both; }

.product-name {
  margin: 0;
  font-weight: 600;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--cream);
}
.product-name .beta {
  display: inline-block; vertical-align: .55em;
  margin-left: .25em; padding: .18em .45em;
  border-radius: 8px;
  font-size: .28em; letter-spacing: .1em;
  background: var(--accent); color: var(--chip);
}

.product-pitch {
  margin: 0;
  font-weight: 600;
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1.3;
  color: var(--accent);
  text-wrap: balance;
}

.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: 12px;
  font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none;
  background: var(--accent); color: var(--chip);
  transition: transform .2s var(--ease-out), filter .2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px rgb(249 238 210 / .45); }

.fine { margin: 0; font-size: 14px; color: rgb(249 238 210 / .7); }

.demo {
  width: 100%; max-width: 960px; margin: 48px auto 0;
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: rgb(0 0 0 / .25);
  box-shadow: 0 20px 50px rgb(0 0 0 / .3);
  border: 2px solid #a7a185;   /* same rule as the plugin card */
}
.demo video, .demo img { width: 100%; height: 100%; object-fit: cover; }

.section { max-width: 960px; margin: 64px auto 0; }
.section-title {
  margin: 0 0 22px;
  text-align: center;
  font-weight: 600; font-size: 22px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream);
}

.features {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 26px 36px;
}
.features li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.features h3 { margin: 0; font-weight: 600; font-size: 19px; color: var(--accent); }
.features p  { margin: 0; font-weight: 400; font-size: 16px; line-height: 1.4; color: var(--cream); }

.benefits { list-style: none; margin: 0 auto; padding: 0; max-width: 620px; display: grid; gap: 12px; }
.benefits li { position: relative; padding-left: 26px; font-size: 18px; line-height: 1.35; }
.benefits li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 10px; height: 10px; border-radius: 3px; background: var(--accent);
}

.callout {
  max-width: 620px; margin: 64px auto 0; padding: 26px 28px;
  border-radius: 14px;
  background: rgb(0 0 0 / .18);
  box-shadow: inset 0 0 0 1px rgb(249 238 210 / .12);
  display: grid; gap: 10px; text-align: center;
}
.callout h2 { margin: 0; font-weight: 600; font-size: 22px; color: var(--accent); }
.callout p { margin: 0; font-size: 17px; line-height: 1.45; }

/* ---------- Contact ---------- */
.contact { max-width: 760px; margin: 0 auto; display: grid; gap: 28px; text-align: center; justify-items: center; }
.email {
  font-weight: 600; font-size: clamp(18px, 3vw, 22px); color: var(--brown);
  text-decoration: none; border-bottom: 2px solid rgb(76 65 52 / .35);
  transition: border-color .2s;
}
.email:hover { border-color: var(--brown); }

/* Large donkey peeking in from the lower right (Plugins, Contact, product pages).
   Sits at the bottom of the page, below the content, never on top of text. */
body { position: relative; overflow-x: hidden; }
body.has-peek main { padding-bottom: min(52vw, 470px); }
.peek {
  position: absolute; right: 0; bottom: 0;
  width: min(560px, 72vw); height: auto;
  z-index: 0; pointer-events: none;
  animation: slide-in .8s .2s var(--ease-pop) both;
}
body.product .peek { opacity: .35; }
body.product .peek[src*="peek-purple"] { opacity: 1; }
@keyframes slide-in { from { transform: translate(12%, 18%); } to { transform: none; } }

/* Placeholder art — remove once real files are in /assets */
.ph {
  display: grid; place-items: center;
  font-weight: 500; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  color: rgb(249 238 210 / .85); text-align: center; padding: 12px;
}
.ph-badge { width: 100%; height: 100%; border-radius: 50%; background: var(--circle); border: 10px solid #000; }
.ph-logo { display: grid; line-height: .9; color: #000; text-transform: uppercase; }
.ph-logo b { font-weight: 700; font-size: 44px; letter-spacing: .01em; }
.ph-logo span { font-weight: 400; font-size: 15px; letter-spacing: .62em; }
body.product .ph-logo { color: var(--cream); }
.ph-mark {
  width: 120px; height: 120px; border-radius: 26px;
  background: var(--accent); color: var(--chip);
  display: grid; place-items: center; font-weight: 700; font-size: 46px;
  animation: pop .5s var(--ease-pop) both;
}

@media (max-width: 520px) {
  .site-footer { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); }
  .card-body { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Product sub-brands ----------
   A product page keeps the master layout (logo, nav, brown ground, peek donkey)
   and swaps in the product's own colors (--accent, --accent-2) and typeface. */
body.product { --accent-2: var(--accent); --product-font: var(--font-display); }
body.product .product-pitch,
body.product .features h3,
body.product .section-title,
body.product .intro,
body.product .callout h2 { font-family: var(--product-font), var(--font-display); }
body.product .btn { background: var(--accent-2); color: #fff; }
body.product .btn-ghost { background: transparent; color: var(--cream); }
body.product .benefits li::before { background: var(--accent-2); }

.cs-icon { display: block; width: 100%; height: 100%; }
.product-hero .cs-icon { width: 150px; height: 150px; }
.product-logo { width: min(520px, 86vw); height: auto; }
.product-hero .beta {
  display: inline-block; padding: 5px 12px; border-radius: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--accent-2); color: #fff;
}
.intro {
  max-width: 44em; margin: 40px auto 0;
  font-size: clamp(17px, 2.2vw, 19px); line-height: 1.55; text-align: center;
  color: var(--cream); text-wrap: pretty;
}
.demo video { background: #000; }

/* Animated icon inside a plugin card */
.card-media-icon {
  background: #1a1421;
  overflow: hidden;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.card h2 img { display: block; width: min(240px, 100%); height: auto; }
