/* Kaotic Chainz: life is chaos, our apps are the links that hold it together. */
@import url("/assets/fonts.css");

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --ink: #141414;
  --ink-soft: #4a4640;
  --line: #141414;
  --tomato: #ff4d2e;
  --lime: #c6f432;
  --sun: #ffc93c;
  --mint: #2ec4b6;
  --sky: #4d8dff;
  --pink: #ff7ab6;
  --leaf: #2f9e44;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 22px;
  --display: "Bagel Fat One", "Arial Black", sans-serif;
  --body: "Bricolage Grotesque", ui-sans-serif, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151412;
    --paper-2: #1e1c19;
    --ink: #f6f1e7;
    --ink-soft: #bdb6a9;
    --line: #f6f1e7;
    --shadow: 6px 6px 0 #000;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tomato); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.35rem; letter-spacing: .5px; }
.brand svg { width: 42px; height: 28px; transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--paper-2); }
.nav .cta { background: var(--ink); color: var(--paper); }
.nav .cta:hover { background: var(--tomato); color: #141414; }
@media (max-width: 720px) { .nav a:not(.cta) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.05rem var(--body);
  padding: 14px 22px; border-radius: 999px;
  border: 2.5px solid var(--line);
  background: var(--lime); color: #141414;
  box-shadow: var(--shadow);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 9px 16px; font-size: .95rem; box-shadow: 4px 4px 0 var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 72px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.kicker {
  display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--sun); color: #141414; border: 2px solid var(--line); padding: 6px 12px; border-radius: 999px;
  transform: rotate(-2deg);
}
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 7.4vw, 6.2rem); line-height: .95; letter-spacing: -.01em;
  margin: 22px 0 18px;
}
.hero h1 .scribble { position: relative; display: inline-block; color: var(--tomato); }
.hero h1 .scribble svg { position: absolute; left: -4%; bottom: -.18em; width: 108%; height: .32em; overflow: visible; }
.hero h1 .scribble path { stroke: var(--ink); stroke-width: 5; fill: none; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.1s .9s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--ink-soft); max-width: 36ch; margin: 0 0 30px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 16px; }
.reveal { opacity: 0; transform: translateY(18px); animation: up .7s cubic-bezier(.2,.8,.2,1) forwards; }
.reveal.d1 { animation-delay: .1s } .reveal.d2 { animation-delay: .25s } .reveal.d3 { animation-delay: .4s } .reveal.d4 { animation-delay: .55s }
@keyframes up { to { opacity: 1; transform: none; } }

/* the hanging chain */
.chain-stage { position: relative; height: 520px; display: flex; justify-content: center; }
@media (max-width: 900px) { .chain-stage { height: 380px; } }
.chain { position: absolute; top: -80px; transform-origin: 50% 0; animation: swing 4.2s ease-in-out infinite; display: flex; flex-direction: column; align-items: center; }
@keyframes swing { 0%,100% { transform: rotate(5deg); } 50% { transform: rotate(-5deg); } }
.link-o { width: 92px; height: 132px; border-radius: 46px; border: 18px solid var(--c, var(--sun)); box-shadow: inset 0 0 0 2.5px var(--ink), 0 0 0 2.5px var(--ink); margin: -30px 0; position: relative; z-index: 1; }
.link-i { width: 26px; height: 132px; border-radius: 13px; background: var(--c, var(--sky)); box-shadow: 0 0 0 2.5px var(--ink); margin: -30px 0; position: relative; z-index: 2; }
.tag {
  margin-top: 6px; z-index: 3; background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 20px 14px; font-family: var(--display); font-size: 1.45rem; transform: rotate(-4deg); text-align: center; line-height: 1.05;
}
.tag small { display: block; font: 600 .82rem var(--body); color: var(--ink-soft); margin-top: 6px; }
.chain-stage:hover .chain { animation-duration: 1.2s; }

/* ---------- marquee ---------- */
.marquee { border-block: 2.5px solid var(--line); background: var(--ink); color: var(--paper); overflow: hidden; transform: rotate(-1.2deg); margin: 30px -10px 10px; }
.marquee-track { display: flex; gap: 40px; width: max-content; padding: 14px 0; animation: scroll 38s linear infinite; font-family: var(--display); font-size: 1.6rem; white-space: nowrap; }
.marquee-track span::after { content: "✶"; margin-left: 40px; color: var(--lime); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { padding: 90px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 40px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; margin: 0; }
.section-head p { margin: 0; max-width: 46ch; color: var(--ink-soft); }

/* ---------- app cards ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px; }
.card {
  --tilt: 0deg;
  position: relative; background: var(--c); color: #141414;
  border: 2.5px solid #141414; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 22px 20px; transform: rotate(var(--tilt));
  transition: transform .35s cubic-bezier(.3,1.6,.5,1), box-shadow .2s;
  display: flex; flex-direction: column; gap: 8px; min-height: 230px;
}
.card:nth-child(4n+1) { --tilt: -1.6deg } .card:nth-child(4n+2) { --tilt: 1.2deg }
.card:nth-child(4n+3) { --tilt: -.6deg } .card:nth-child(4n) { --tilt: 1.8deg }
.card:hover { transform: rotate(0) translateY(-6px) scale(1.02); }
.card .num { position: absolute; top: -14px; right: 18px; background: #141414; color: #f6f1e7; font: 800 .8rem var(--body); padding: 5px 10px; border-radius: 999px; letter-spacing: .06em; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; margin: 6px 0 0; line-height: 1; }
.card .line { font-weight: 700; margin: 0; }
.card p { margin: 0; font-size: 1rem; }
.card .vibe { margin-top: auto; font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.card.wide { grid-column: span 2; }
@media (max-width: 620px) { .card.wide { grid-column: auto; } }

/* Thirsty demo */
.thirsty-demo { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; margin-top: 6px; }
@media (max-width: 620px) { .thirsty-demo { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.plant { width: 150px; height: 170px; }
.plant .stem, .plant .leaves { transform-origin: 75px 130px; transition: transform 1.1s cubic-bezier(.5,0,.3,1), filter 1.1s; }
.plant.dead .leaves { transform: rotate(78deg) translateY(10px); filter: saturate(.1) brightness(.75); }
.plant.dead .stem { transform: rotate(34deg); }
.plant.alive .leaves { animation: boing .8s cubic-bezier(.3,1.8,.5,1); }
@keyframes boing { 0% { transform: scale(.6) } 60% { transform: scale(1.15) } 100% { transform: none } }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.gems { font-weight: 800; }

.drama {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(circle, rgba(20,20,20,.55), rgba(20,20,20,.9));
  opacity: 0; transition: opacity .2s;
}
.drama.show { opacity: 1; }
.drama-text {
  font-family: var(--display); color: var(--sun); text-align: center; line-height: .95;
  font-size: clamp(2.4rem, 9vw, 7.5rem); -webkit-text-stroke: 3px #141414; text-shadow: 8px 8px 0 #141414;
  transform: scale(.2) rotate(-8deg);
}
.drama.show .drama-text { animation: scream 1.6s cubic-bezier(.2,1.6,.4,1) forwards; }
.drama-text small { display: block; font: 700 1.1rem var(--body); -webkit-text-stroke: 0; text-shadow: none; color: #f6f1e7; margin-top: 18px; }
@keyframes scream { 0% { transform: scale(.2) rotate(-8deg) } 30% { transform: scale(1.08) rotate(3deg) } 45% { transform: scale(1) rotate(-2deg) } 100% { transform: scale(1) rotate(0) } }
body.shake main { animation: shake .5s linear 2; }
@keyframes shake { 0%,100% { transform: none } 20% { transform: translate(-8px, 4px) rotate(-.6deg) } 40% { transform: translate(7px, -5px) rotate(.6deg) } 60% { transform: translate(-6px, -3px) } 80% { transform: translate(5px, 5px) } }

/* PickOne wheel */
.wheel-box { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.wheel-wrap { position: relative; width: 130px; height: 130px; }
.wheel-wrap::after { content: ""; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); border: 10px solid transparent; border-top: 16px solid #141414; }
.wheel { width: 130px; height: 130px; border-radius: 50%; border: 3px solid #141414; transition: transform 3.2s cubic-bezier(.12,.8,.12,1);
  background: conic-gradient(var(--tomato) 0 25%, var(--sun) 0 50%, var(--mint) 0 75%, var(--sky) 0 100%); }
.verdict { font-family: var(--display); font-size: 1.3rem; min-height: 1.4em; }

/* ---------- principles ---------- */
.principles { background: var(--ink); color: var(--paper); border-block: 2.5px solid var(--line); }
.principles .section-head p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border: 2px solid currentColor; border-radius: var(--radius); overflow: hidden; }
.p-item { padding: 28px 26px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
.p-item b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 6px; color: var(--lime); }
.p-item:nth-child(3n+2) b { color: var(--sun); } .p-item:nth-child(3n) b { color: var(--pink); }
.p-item p { margin: 0; color: color-mix(in srgb, var(--paper) 80%, transparent); }
@media (prefers-color-scheme: dark) { .principles { background: #0b0b0a; color: #f6f1e7; } }

/* ---------- beta form ---------- */
.beta .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .beta .wrap { grid-template-columns: 1fr; } }
.beta h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; margin: 0 0 16px; }
.form-card { background: var(--paper-2); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.form-card label.field { display: block; font-weight: 700; margin-bottom: 8px; }
.form-card input[type=email] {
  width: 100%; font: 500 1.1rem var(--body); padding: 14px 16px; border-radius: 14px;
  border: 2.5px solid var(--line); background: var(--paper); color: var(--ink);
}
fieldset { border: 0; padding: 0; margin: 22px 0 0; }
legend { font-weight: 700; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 7px 13px; border: 2px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s, transform .15s; user-select: none; }
.chip input:checked + span { background: var(--ink); color: var(--paper); transform: rotate(-2deg); }
.chip input:focus-visible + span { outline: 3px solid var(--tomato); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .98rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--tomato); flex: none; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 22px; }
.form-msg { font-weight: 700; min-height: 1.5em; margin: 14px 0 0; }
.form-msg.ok { color: var(--leaf); } .form-msg.err { color: var(--tomato); }
.cf-turnstile { margin-top: 18px; min-height: 65px; }

/* ---------- footer ---------- */
.site-foot { border-top: 2.5px solid var(--line); padding: 40px 0 60px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-foot a { font-weight: 600; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.site-foot .fine { color: var(--ink-soft); font-size: .92rem; }

/* ---------- legal pages ---------- */
.doc { padding: 56px 0 30px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; margin: 0 0 14px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 2.2rem 0 .6rem; }
.doc .lead { color: var(--ink-soft); font-size: 1.15rem; }
.doc .tldr { background: var(--lime); color: #141414; border: 2.5px solid #141414; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px; margin: 26px 0; transform: rotate(-.6deg); }
.doc .tldr ul { margin: 6px 0 0; padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.lost h1 { font-family: var(--display); font-weight: 400; font-size: clamp(4rem, 16vw, 11rem); margin: 0; line-height: .9; color: var(--tomato); -webkit-text-stroke: 3px var(--ink); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero h1 .scribble path { stroke-dashoffset: 0; }
}

/* "A Kaotic Chainz Production" stamp on every app */
.card .prod {
  align-self: flex-start; font: 800 .68rem var(--body); letter-spacing: .14em; text-transform: uppercase;
  border: 2px solid #141414; border-radius: 6px; padding: 3px 8px; transform: rotate(-3deg); opacity: .85;
}

/* fixes after visual review */
[hidden] { display: none !important; }
.card .prod { white-space: nowrap; font-size: .6rem; letter-spacing: .12em; }
@media (min-width: 900px) { .p-grid { grid-template-columns: repeat(3, 1fr); } }
.card.more { background: var(--paper); color: var(--ink); border-style: dashed; justify-content: center; }
.card.more h3 { color: var(--tomato); }
@media (max-width: 900px) { .chain { top: -10px; } .chain-stage { height: 480px; margin-top: 8px; } }
