/* =========================================================
   PosseAI · Landing · Shared · Hand-drawn UI edition
   ========================================================= */

:root {
  /* Paper palette — matches cartoon flyer */
  --paper:     #F5EFE4;
  --paper-2:   #EEE5D0;   /* warmer cream */
  --paper-3:   #E6DBC3;   /* subtle divider */
  --ink:       #2A2018;   /* dark espresso */
  --ink-soft:  #4A3E30;
  --mute:      #8A7F6E;

  --brick:     #C9542E;   /* primary accent */
  --sage:      #6B8E74;
  --ochre:     #D6A24A;
  --sky:       #3B5168;

  --ok:        #6B8E74;
  --warn:      #D6A24A;

  /* Layout */
  --max: 1120px;
  --gutter: 28px;

  /* Type */
  --f-sans:  'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --f-serif: 'Fraunces', Georgia, serif;
  --f-mono:  'JetBrains Mono', ui-monospace, monospace;
  --f-hand:  'Kalam', 'Caveat', cursive;

  --line-w: 1.6px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint paper grain, cheap + crisp */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(42, 32, 24, .06) 1px, transparent 1px),
    radial-gradient(rgba(42, 32, 24, .035) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1.5px 1.5px;
  opacity: .6;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ========= HAND-DRAWN UI PRIMITIVES ========= */

/* Rough filter applied via SVG; classes use it. Defined in index.html <svg defs>. */
.rough        { filter: url(#rough-1); }
.rough-soft   { filter: url(#rough-soft); }
.rough-strong { filter: url(#rough-strong); }

/* Sketched outline — double-stroke look without SVG, using box-shadow layering.
   This works independently and is more performant than filters. */
.ink-box {
  background: var(--paper-2);
  border: var(--line-w) solid var(--ink);
  position: relative;
  /* hand-drawn feel: tiny offset "shadow" border */
  box-shadow:
    3px 3px 0 var(--ink),
    3px 3px 0 1px var(--paper-2),
    6px 6px 0 1px var(--ink);
}
.ink-box::before {
  /* subtle corner squiggle */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(42,32,24,.04) calc(50% - .5px), rgba(42,32,24,.04) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(0deg,  transparent calc(50% - .5px), rgba(42,32,24,.04) calc(50% - .5px), rgba(42,32,24,.04) calc(50% + .5px), transparent calc(50% + .5px));
  background-size: 100% 100%;
  mix-blend-mode: multiply;
  opacity: 0;
}

/* Variant: tinted */
.ink-box.brick { background: #F9E6D9; }
.ink-box.sage  { background: #E4ECDF; }
.ink-box.ochre { background: #F6E9CE; }
.ink-box.sky   { background: #DCE5EE; }

/* Dashed divider */
.hr-dash {
  border: 0;
  border-top: var(--line-w) dashed var(--ink);
  opacity: .55;
  margin: 48px 0;
}

/* Hand-drawn underline accent */
.hand-underline {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'><path d='M2 5 C 30 2, 60 7, 100 4 S 170 7, 198 3' stroke='%23C9542E' stroke-width='2.2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 8px;
  padding-bottom: 6px;
}

/* Hand arrow callout */
.hand-arrow {
  display: inline-block;
  width: 60px; height: 32px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 32' fill='none'><path d='M3 18 Q 20 4, 38 12 T 55 20 M 48 12 L 55 20 L 46 22' stroke='%23C9542E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center/contain;
}

/* Handwritten annotation */
.handwriting {
  font-family: var(--f-hand);
  font-weight: 400;
  color: var(--brick);
  letter-spacing: .01em;
  transform: rotate(-1.5deg);
  display: inline-block;
}

/* ========= TYPOGRAPHY ========= */

.display {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 84px);
  line-height: .98;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}
.display em {
  font-style: italic;
  color: var(--brick);
  font-weight: 500;
}

.h2 {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -.015em;
  color: var(--ink);
}
.h2 em { font-style: italic; color: var(--brick); font-weight: 500; }

.h3 {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brick);
}

.lede {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 64ch;
  text-wrap: pretty;
}

p { color: var(--ink-soft); text-wrap: pretty; }

code, .mono {
  font-family: var(--f-mono);
  font-size: .92em;
}

/* ========= LAYOUT ========= */

.wrap {
  width: 100%;
  max-width: var(--max);
  padding: 0 var(--gutter);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

section { position: relative; z-index: 1; }

/* ========= NAV ========= */

.nav {
  position: sticky; top: 0;
  background: rgba(245, 239, 228, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-3);
  z-index: 50;
  padding: 14px 0;
}
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 30px; height: 30px;
  background: var(--brick);
  color: var(--paper);
  display: grid; place-items: center;
  font: 800 15px/1 var(--f-sans);
  transform: rotate(-2deg);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: -3px;
  border: 1.5px solid var(--ink);
  transform: rotate(1deg);
  pointer-events: none;
}
.brand em { color: var(--brick); font-style: normal; }

.nav-links {
  display: flex; gap: 24px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-links a { position: relative; }
.nav-links a:hover { color: var(--brick); }
.nav-links a:hover::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 4px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 4'><path d='M2 2 C 20 0.5, 40 3.5, 60 1.5 S 78 3, 78 2.5' stroke='%23C9542E' stroke-width='1.6' fill='none'/></svg>") no-repeat center/100% 100%;
}

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  font: 600 13px/1 var(--f-sans);
  transition: transform .15s;
  position: relative;
}
.nav-cta::after {
  content: "";
  position: absolute; inset: 3px;
  border: 1px solid var(--ink);
  opacity: .4;
  pointer-events: none;
}
.nav-cta:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }

.lang-switch {
  display: inline-flex;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .08em;
}
.lang-switch a {
  padding: 4px 10px;
  border: 1px solid var(--ink);
  color: var(--ink-soft);
}
.lang-switch a.on { background: var(--ink); color: var(--paper); }
.lang-switch a + a { border-left: 0; }

/* ========= BUTTONS ========= */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font: 600 15px/1 var(--f-sans);
  letter-spacing: -.01em;
  cursor: pointer;
  position: relative;
  transition: transform .15s, box-shadow .15s;
  border: 1.8px solid var(--ink);
}
.btn-primary {
  background: var(--brick);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--paper-2);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-arrow {
  font-family: var(--f-mono);
  font-weight: 500;
  transition: transform .2s;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ========= SCROLL REVEAL ========= */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease-out, transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ========= FOOTER ========= */

.footer {
  border-top: 1.5px solid var(--ink);
  margin-top: 120px;
  padding: 48px 0 36px;
  background: var(--paper-2);
}
.footer-in {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer small {
  display: block;
  color: var(--mute);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .08em;
  margin-top: 18px;
}
.footer h4 {
  font: 700 12px/1 var(--f-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brick);
  margin-bottom: 14px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--ink-soft); font-size: 14px; }
.footer a:hover { color: var(--brick); }

@media (max-width: 860px) {
  .footer-in { grid-template-columns: 1fr; gap: 40px; }
  .nav-links { display: none; }
}
