/* Field notes: a hand-made layer over the approved SpaceBunny palette.
   Paper grain, label-maker tape, masking tape, hand-drawn marks and the rabbit
   mascot add personality. Text stays on opaque surfaces at AA contrast, and
   textures, tilts and motion drop away for increased contrast, forced colors
   and reduced motion. */
:root {
  --fn-hand: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  --fn-loud: "Chalkboard SE", "Comic Sans MS", "Segoe Print", "Marker Felt", cursive;
  --fn-grain: url("assets/field-notes/grain-ink.svg");
  --fn-grid: color-mix(in srgb, var(--sb-info) 13%, transparent);
  --fn-tape: url("assets/field-notes/tape.svg");
  --fn-label-ink: var(--sb-canvas);
  --fn-label-fill: var(--sb-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) { --fn-grain: url("assets/field-notes/grain-light.svg"); --fn-grid: color-mix(in srgb, var(--sb-info) 11%, transparent); }
}
:root[data-appearance="dark"] { --fn-grain: url("assets/field-notes/grain-light.svg"); --fn-grid: color-mix(in srgb, var(--sb-info) 11%, transparent); }

html { overflow-x: clip; }
body.marketing { background-image: var(--fn-grain); background-size: 220px 220px; }

/* Label-maker tape for section labels, like the labels on a finished rack. */
.marketing :is(.section-head, .trust-lead, .beta-intro, .fn-ba-head) .eyebrow, .marketing :is(.about-intro, .founder-story, .document) > .eyebrow,
.marketing .sbjs-eyebrow {
  display: inline-block;
  padding: 6px 11px 5px;
  border-radius: 3px;
  background: var(--fn-label-fill);
  color: var(--fn-label-ink);
  font: 700 12px/1.4 var(--sb-font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #ffffff2e, inset 0 -2px 0 #0000003d, 0 2px 4px #0014262e;
  rotate: -1.2deg;
}
.marketing .trust-lead .eyebrow { rotate: .9deg; }
.marketing .beta-intro .eyebrow { rotate: -.6deg; }

/* Hand lettering is reserved for short notes; essential content stays in system type. */
.fn-hand { font-family: var(--fn-hand); font-weight: 700; letter-spacing: 0; }

/* Hero: grid-paper backdrop, scribbled emphasis, taped photo and the rabbit. */
.marketing .hero { position: relative; }
.marketing .hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw) 30%;
  background-image: linear-gradient(var(--fn-grid) 1px, transparent 1px), linear-gradient(90deg, var(--fn-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 90% at 30% 20%, #000 35%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 30% 20%, #000 35%, transparent 80%);
  pointer-events: none;
}
.marketing .hero h1 > span { position: relative; display: inline-block; }
.fn-scribble {
  position: absolute;
  left: -2%;
  bottom: -.2em;
  width: 104%;
  height: .32em;
  overflow: visible;
  pointer-events: none;
}
.fn-scribble path { fill: none; stroke: var(--sb-accent); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }

.marketing .hero .beta-label {
  padding: 6px 12px 5px;
  border-radius: 3px;
  background: var(--fn-label-fill);
  color: var(--fn-label-ink);
  font: 700 12px/1.4 var(--sb-font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #ffffff2e, inset 0 -2px 0 #0000003d, 0 2px 4px #0014262e;
  rotate: 1.5deg;
}
.marketing .hero .beta-label i { background: var(--sb-accent); box-shadow: 0 0 0 2px var(--fn-label-fill); }

.marketing .hero-visual { position: relative; }
.marketing .hero-image { rotate: -.35deg; box-shadow: 0 18px 40px #00142624; }
.fn-tape {
  position: absolute;
  z-index: 2;
  width: 132px;
  height: 34px;
  background: var(--fn-tape) center / 100% 100% no-repeat;
  pointer-events: none;
}
.hero-visual > .fn-tape:first-of-type { top: -15px; left: 7%; rotate: -5deg; }
.hero-visual > .fn-tape:last-of-type { top: -13px; right: 9%; rotate: 4deg; }

.fn-mascot {
  position: absolute;
  z-index: 3;
  left: -40px;
  top: 24%;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}
.fn-mascot img {
  width: clamp(200px, 26vw, 380px);
  height: auto;
  filter: drop-shadow(0 10px 14px #00142659);
  rotate: -6deg;
}
.fn-bubble {
  position: relative;
  max-width: 220px;
  margin-top: 10px;
  padding: 12px 16px 13px;
  border: 2px solid var(--sb-text);
  border-radius: 22px 22px 22px 6px;
  background: var(--sb-surface);
  color: var(--sb-text);
  font: 700 18px/1.25 var(--fn-hand);
  box-shadow: 4px 4px 0 var(--sb-accent);
  rotate: 2deg;
}

/* "Keep your stack" starburst: a deliberately loud, flyer-style sticker. */
.marketing .connected .section-head { position: relative; }
.fn-sticker {
  position: absolute;
  z-index: 2;
  right: -34px;
  bottom: -104px;
  max-width: none;
  padding: 0;
  filter: drop-shadow(5px 5px 0 var(--sb-text));
  rotate: 9deg;
  pointer-events: none;
}
.fn-sticker span {
  display: grid;
  place-items: center;
  width: 124px;
  aspect-ratio: 1;
  padding: 24px;
  background: var(--sb-accent);
  color: var(--sb-on-accent);
  font: 700 18px/1.05 var(--fn-loud);
  text-align: center;
  clip-path: polygon(50% 0, 59% 13%, 75% 7%, 77% 23%, 93% 25%, 87% 40%, 100% 50%, 87% 60%, 93% 75%, 77% 77%, 75% 93%, 59% 87%, 50% 100%, 41% 87%, 25% 93%, 23% 77%, 7% 75%, 13% 60%, 0 50%, 13% 40%, 7% 25%, 23% 23%, 25% 7%, 41% 13%);
}

/* Before / after: show the work instead of describing it. */
.fn-ba { padding-top: 0; padding-bottom: 40px; }
.fn-ba-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 42px; }
.fn-ba-head .eyebrow { margin-bottom: 20px; }
.fn-ba-head > p { max-width: 360px; color: var(--muted); padding-bottom: 7px; }
.fn-ba-stage {
  --fn-split: 50%;
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1430 / 993;
  background: var(--sb-raised);
  box-shadow: 0 18px 40px #0014261f;
  rotate: .3deg;
  touch-action: pan-y;
  max-width: 1120px;
  margin-inline: auto;
}
.fn-ba-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fn-ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--fn-split)) 0 0); }
.fn-ba-tag {
  position: absolute;
  z-index: 2;
  top: 16px;
  padding: 6px 13px 7px;
  border: 2px solid var(--sb-text);
  border-radius: 999px;
  background: var(--sb-surface);
  color: var(--sb-text);
  font: 700 17px/1.2 var(--fn-hand);
  pointer-events: none;
}
.fn-ba-tag.before { left: 16px; rotate: -2deg; }
.fn-ba-tag.after { right: 16px; rotate: 2deg; }
.fn-ba-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: var(--fn-split);
  width: 4px;
  translate: -2px 0;
  background: var(--sb-accent);
  pointer-events: none;
}
.fn-ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  translate: -50% -50%;
  border: 3px solid var(--sb-on-accent);
  border-radius: 50%;
  background: var(--sb-accent);
  box-shadow: 0 4px 12px #0014264d;
}
.fn-ba-handle::before {
  content: '‹ ›';
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  translate: -50% -54%;
  color: var(--sb-on-accent);
  font: 700 20px/1 var(--sb-font-body);
  white-space: pre;
}
.fn-ba-range {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.fn-ba-range:focus-visible ~ .fn-ba-handle::after { outline: 3px solid var(--sb-focus); outline-offset: 4px; }
.fn-ba-notes { max-width: 1120px; margin-inline: auto; display: flex; justify-content: space-between; gap: 24px; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* Tape, polaroid tilt and slight imperfection on real screens and people. */
.marketing .sbjs-proof--screen { position: relative; overflow: visible; }
.marketing .sbjs-proof--screen > button { overflow: hidden; border-radius: 15px 15px 0 0; }
.marketing .sbjs-proof--screen::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 50%;
  width: 118px;
  height: 30px;
  translate: -50% 0;
  background: var(--fn-tape) center / 100% 100% no-repeat;
  rotate: -3deg;
  pointer-events: none;
}
.marketing .sbjs-ch:nth-child(even) .sbjs-proof--screen::before { rotate: 4deg; }
.marketing .founder-link img {
  padding: 5px 5px 14px;
  border-radius: 3px;
  background: #fffdf7;
  box-shadow: 0 6px 14px #00142633;
  rotate: -4deg;
}
.marketing .beta-founder img { outline: 3px solid var(--sb-surface); box-shadow: 0 4px 10px #0014262e; }

/* Footer sign-off from the rabbit. */
.fn-signoff { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--muted); }
.fn-signoff img { width: 140px; height: auto; rotate: -3deg; filter: drop-shadow(0 4px 6px #00142633); }
.fn-signoff p { font: 700 17px/1.3 var(--fn-hand); }
.fn-signoff a { display: inline-block; min-height: 44px; padding-block: 12px; color: var(--sb-accent); text-decoration: underline; text-underline-offset: 4px; }

.fn-circled { position: relative; display: inline-block; }
.fn-circled svg { position: absolute; top: -.14em; left: -.32em; width: calc(100% + .64em); height: calc(100% + .26em); overflow: visible; pointer-events: none; }
.fn-circled path { fill: none; stroke: var(--sb-accent); stroke-width: 3.5; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
  .fn-scribble path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: fn-draw .9s .45s cubic-bezier(.6,.05,.3,1) forwards; }
  .fn-mascot img { animation: fn-hop 1.1s .2s cubic-bezier(.3,1.4,.5,1) both; }
  .fn-mascot .fn-bubble { animation: fn-pop .45s 1.1s cubic-bezier(.3,1.5,.5,1) both; }
  .marketing .founder-link img { transition: rotate .25s ease; }
  .marketing .founder-link:hover img { rotate: 0deg; }
  @supports (animation-timeline: view()) {
    .fn-signoff img { animation: fn-peek linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .fn-circled path { stroke-dasharray: 1; animation: fn-draw-in linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
  }
}
@keyframes fn-draw { to { stroke-dashoffset: 0; } }
@keyframes fn-draw-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fn-hop {
  from { translate: -60px 40px; rotate: -30deg; opacity: 0; }
  60% { translate: 6px -14px; rotate: -4deg; opacity: 1; }
  to { translate: 0 0; rotate: -6deg; opacity: 1; }
}
@keyframes fn-peek { from { translate: 0 28px; } to { translate: 0 0; } }
/* The bubble only scales in: its text and fill stay fully opaque throughout. */
@keyframes fn-pop { from { scale: .6; } to { scale: 1; } }

/* Hand-drawn doodles: imperfect marker sketches made with an image model, used as
   masks so they take the palette's ink in light, dark and forced colors. Decorative only. */
:root { --fn-doodle: var(--sb-accent); --fn-hatch: color-mix(in srgb, var(--sb-text) 22%, transparent); }
.marketing .hero-actions, .marketing .beta-panel, .marketing .trust-lead h2, .marketing .pb-academy-copy, .marketing .connected .section-head > div { position: relative; }
.marketing .hero-actions::before, .marketing .beta-panel::before, .marketing .beta-intro::after, .marketing .trust-lead h2::after,
.marketing .pb-academy-copy::after, .marketing .connected .section-head > div::after, .fn-ba-head h2::after, .marketing .hero-visual::after {
  content: ""; position: absolute; background: var(--fn-doodle); pointer-events: none;
  mask: var(--fn-doodle-art) center / contain no-repeat; -webkit-mask: var(--fn-doodle-art) center / contain no-repeat;
}
/* A curved arrow drops onto "Request access". */
.marketing .hero-actions::before { --fn-doodle-art: url("assets/field-notes/doodles/arrow-curve.webp"); right: 150px; bottom: calc(100% + 2px); width: 120px; height: 85px; rotate: -4deg; }
/* A loopy arrow points from the beta pitch into the form. */
.marketing .beta-panel::before { --fn-doodle-art: url("assets/field-notes/doodles/arrow-loop.webp"); left: -112px; top: 92px; width: 108px; height: 70px; scale: -1 1; rotate: 8deg; }
.marketing .beta-intro { position: relative; }
.marketing .beta-intro::after { --fn-doodle-art: url("assets/field-notes/doodles/sparkle.webp"); right: 4%; top: 18px; width: 58px; height: 58px; }
.marketing .trust-lead h2::after { --fn-doodle-art: url("assets/field-notes/doodles/star.webp"); left: 7.1em; top: -.3em; width: .72em; height: .72em; rotate: 10deg; }
.fn-ba-head h2 { position: relative; }
.fn-ba-head h2::after { --fn-doodle-art: url("assets/field-notes/doodles/squiggle.webp"); left: 0; bottom: -18px; width: min(46%, 220px); height: 18px; }
.marketing .connected .section-head > div::after { --fn-doodle-art: url("assets/field-notes/doodles/cable.webp"); right: -12px; top: -54px; width: 104px; height: 80px; background: var(--sb-text); opacity: .75; rotate: -8deg; }
.marketing .pb-academy-copy::after { --fn-doodle-art: url("assets/field-notes/doodles/speaker.webp"); right: 6px; top: -6px; width: 58px; height: 74px; background: currentColor; opacity: .7; rotate: 6deg; }
/* Pencil hatching behind the hero photo instead of a flat drop shadow. */
.marketing .hero-visual::after { --fn-doodle-art: url("assets/field-notes/doodles/hatch.webp"); z-index: 0; left: -52px; bottom: -58px; width: 190px; height: 174px; background: var(--fn-hatch); rotate: -6deg; }
.marketing .hero-visual > .hero-image { position: relative; z-index: 1; }
@media (max-width: 1000px) { .marketing .hero-actions::before { display: none; } }
/* Product feature lists tick off with a hand-drawn check. */
.pb-features li::before { width: 1.25em; height: 1.25em; top: .1em; left: -.15em; mask-image: url("assets/field-notes/doodles/check.webp"); -webkit-mask-image: url("assets/field-notes/doodles/check.webp"); }

@media (max-width: 1100px) {
  .marketing .beta-panel::before { display: none; }
  .fn-mascot { left: -26px; }
  .fn-sticker { right: -22px; }
}
@media (max-width: 760px) {
  .marketing .connected .section-head > div::after, .marketing .pb-academy-copy::after, .marketing .hero-visual::after { display: none; }
  .marketing .hero::before { inset-block-end: 45%; }
  .fn-mascot { left: 4px; top: 22px; }
  .fn-mascot img { width: 132px; }
  .fn-bubble { max-width: 168px; margin-top: 0; padding: 9px 12px 10px; font-size: 15px; }
  .hero-visual > .fn-tape { width: 92px; height: 26px; }
  .fn-sticker { right: -8px; bottom: -78px; rotate: 8deg; filter: drop-shadow(3px 3px 0 var(--sb-text)); }
  .fn-sticker span { width: 92px; padding: 16px; font-size: 14px; }
  .fn-ba-head { display: block; margin-bottom: 28px; }
  .fn-ba-head > p { margin-top: 16px; }
  .fn-ba-stage { aspect-ratio: 4 / 3.4; }
  .fn-ba-tag { top: 10px; font-size: 14px; }
  .fn-ba-tag.before { left: 10px; }
  .fn-ba-tag.after { right: 10px; }
  .fn-ba-notes { flex-direction: column; gap: 4px; }
  .marketing .hero-image, .fn-ba-stage { rotate: 0deg; }
}

/* Increased contrast, forced colors: drop textures, tilts and decorative shadows. */
@media (prefers-contrast: more), (forced-colors: active) {
  .marketing :is(.hero-actions, .beta-panel)::before, .marketing :is(.beta-intro, .pb-academy-copy, .hero-visual, .connected .section-head > div)::after, .marketing .trust-lead h2::after, .fn-ba-head h2::after { display: none; }
  body.marketing { background-image: none; }
  .marketing .hero::before, .fn-tape, .marketing .sbjs-proof--screen::before { display: none; }
  .marketing .hero-image, .fn-ba-stage, .marketing .founder-link img,
  .marketing :is(.section-head, .trust-lead, .beta-intro, .fn-ba-head) .eyebrow, .marketing :is(.about-intro, .founder-story, .document) > .eyebrow, .marketing .sbjs-eyebrow,
  .marketing .hero .beta-label { rotate: 0deg; box-shadow: none; }
  .fn-mascot .fn-bubble { box-shadow: none; animation: none; }
  .fn-sticker { filter: none; }
}
@media (forced-colors: active) {
  .marketing :is(.section-head, .trust-lead, .beta-intro, .fn-ba-head) .eyebrow, .marketing :is(.about-intro, .founder-story, .document) > .eyebrow, .marketing .sbjs-eyebrow,
  .marketing .hero .beta-label, .fn-bubble, .fn-ba-tag { border: 1px solid CanvasText; }
  .fn-sticker span { clip-path: none; border: 2px solid CanvasText; border-radius: 50%; }
  .fn-ba-handle { background: Highlight; }
}
@media print {
  .marketing :is(.hero-actions, .beta-panel)::before, .marketing :is(.beta-intro, .pb-academy-copy, .hero-visual, .connected .section-head > div)::after, .marketing .trust-lead h2::after, .fn-ba-head h2::after { display: none; }
  body.marketing { background-image: none; }
  .fn-mascot, .fn-sticker, .fn-tape, .fn-ba-range, .fn-ba-handle { display: none; }
}

/* Marketing label readability and focus. */
.marketing { --fn-label-size: max(12px, .75rem); }
.marketing .eyebrow,
.marketing .hero-image-label,
.marketing .footer-bottom,
.marketing .appearance,
.marketing .pb-kicker,
.marketing .pb-platforms span,
.marketing .pb-workbench-foot > :is(p, span),
.marketing .connect-kicker,
.marketing .connect-hub > div,
.marketing .connect-number,
.marketing .connect-node small,
.marketing .connect-board-bottom,
.marketing .connect-results,
.marketing .connect-directory-group li > span,
.marketing .connect-native-grid article > span,
.marketing .sbjs-badge { font-size: var(--fn-label-size); }
.marketing .connect-hub > div { text-align: center; text-wrap: balance; }
/* Keep the SVG rack reference legible as the 760-unit plan scales down. */
.marketing .sbjs-draw .plan-id {
  font-size: var(--fn-label-size);
  font-size: clamp(var(--fn-label-size), calc(var(--fn-label-size) * (760px / 100cqi)), 2rem);
}
.marketing .sbjs-draw .sbjs-chip { font-size: clamp(var(--fn-label-size), 1.45cqi, .8125rem); }

/* Reserve the rotated image's bounds plus its 28px entrance travel in the footer gap. */
.fn-signoff { padding: 4px 2px 32px; margin-block: -4px -32px; }

@media (max-width: 760px) {
  .marketing .hero-image-label { flex-wrap: wrap; gap: 2px 12px; letter-spacing: .025em; }
  .marketing .hero-image-label span:last-child { margin-inline-start: auto; }
  .marketing .connect-hub { min-width: min(100%, 15rem); }
  .marketing .connect-board-bottom { letter-spacing: normal; text-wrap: balance; }
  .marketing .connect-scope, .marketing .pb-academy-preview > span { font-size: var(--fn-label-size); }
}

@container sbjs-draw (max-width: 480px) {
  /* Keep centered labels inside the drawing when a label is wider than its anchor's margin. */
  .sbjs-draw .sbjs-chip:not(.is-start, .is-end) {
    --chip-x: calc(var(--x) * 100cqi / 760);
    transform: translate(clamp(calc(0px - var(--chip-x)), -50%, calc(100cqi - var(--chip-x) - 100%)), -50%);
  }
  .sbjs-draw .sbjs-chip:not(.is-bare, .seat-number) {
    top: clamp(.85em, calc(var(--y) / 440 * 100%), calc(100% - .85em));
    padding: 2px 4px;
  }
  .sbjs-draw .rack-label {
    line-height: 1;
    letter-spacing: -.02em;
    margin-inline-start: -2px;
    padding-inline: 1px;
    border-radius: 2px;
    background: var(--c-stage-raised);
  }
  .sbjs-draw .rack-label:not(.rack-label + .rack-label) { margin-top: -3px; }
}
