/* Caddy · caddydocs.com
   One stylesheet, no framework. Colours are the app's own (Sources/Support/Brand.swift
   and the marketing kit's brand.json); type is the system stack, so a Mac renders the
   same SF Pro the app uses and everything else falls to Helvetica Neue, which is what
   every Caddy ad has actually been rendered in. */

:root {
  --black:       #000000;
  --lift:        #060607;
  --cream:       #f2f5ef;
  --green:       #1c4429;
  --accent:      #ff7a52;   /* flag red on dark */

  --text:        rgba(242, 245, 239, 0.92);
  --text-soft:   rgba(242, 245, 239, 0.62);
  --text-faint:  rgba(242, 245, 239, 0.38);
  --rule:        rgba(242, 245, 239, 0.10);
  --rule-soft:   rgba(242, 245, 239, 0.055);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.4rem, 5vw, 5.5rem);
  --measure: 34rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.024em; line-height: 1.1; margin: 0; }
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: rgba(242, 245, 239, 0.3); text-underline-offset: 0.25em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }

.wrap { width: min(72rem, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -120%);
  background: var(--cream); color: #10130f; padding: 0.6rem 1rem; border-radius: 0 0 8px 8px;
  z-index: 90; font-size: 0.875rem; font-weight: 600; text-decoration: none;
}
.skip:focus { transform: translate(-50%, 0); }

/* ─────────────────────────────────────────────  nav  ── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem var(--gutter);
  font-size: 0.8125rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72), rgba(0,0,0,0));
}
.nav__home { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.nav__home svg { width: 15px; height: 18px; display: block; }
.nav__name { font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; font-size: 0.75rem; }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a { color: var(--text-soft); text-decoration: none; letter-spacing: 0.02em; }
.nav__links a:hover, .nav__links a[aria-current] { color: var(--text); }

/* ─────────────────────────────────────────────  hero  ── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 7rem var(--gutter) 5rem;
  overflow: hidden;
  isolation: isolate;
}

/* the barest suggestion of a room the objects are floating in */
.hero::before {
  content: ""; position: absolute; inset: -10%; z-index: -3; pointer-events: none;
  background:
    radial-gradient(58% 46% at 50% 42%, rgba(28, 68, 41, 0.16), transparent 68%),
    radial-gradient(80% 70% at 50% 50%, var(--lift), var(--black) 72%);
}

.field { position: absolute; inset: 0; pointer-events: none; }
.field--stage { z-index: 1; }
/* depth is z-index, so the generated tabs and confetti interleave correctly whatever
   order they were written in. Confetti follows the tabs in the markup, which is what
   lets a few near pieces pass in front of a near tab. */
.tab--b3, .chip--b3 { z-index: 1; }
.tab--b2, .chip--b2 { z-index: 2; }
.tab--b1, .chip--b1 { z-index: 3; }

/* one floating Caddy */
.tab {
  position: absolute;
  left: var(--x); top: var(--y);
  height: var(--h);
  width: auto;
  transform:
    translate(-50%, -50%)
    translate3d(var(--dx, 0px), var(--dy, 0px), 0)
    rotate(calc((var(--rot) + var(--dr, 0)) * 1deg));
  overflow: visible;
  will-change: transform;
}
.t-bio101    { aspect-ratio: 2.9677; }
.t-msj       { aspect-ratio: 4.0323; }
.t-research  { aspect-ratio: 3.2903; }
.t-contracts { aspect-ratio: 3.3871; }

/* the app's own floating shadow: black at 28 %, 12 pt blur, no offset */
.tab--b1 { --h: clamp(30px, 4.6vw, 58px); filter: drop-shadow(0 0 7px rgba(0,0,0,0.55)); }
.tab--b2 { --h: clamp(19px, 2.7vw, 34px); filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)); opacity: 0.9; }
.tab--b3 { --h: clamp(12px, 1.7vw, 21px); filter: drop-shadow(0 0 3px rgba(0,0,0,0.45)) blur(0.9px); opacity: 0.5; }

/* confetti, in the same weightless room */
.chip {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  background: var(--c);
  border-radius: 1px;
  opacity: var(--o);
  transform:
    translate(-50%, -50%)
    translate3d(var(--dx, 0px), var(--dy, 0px), 0)
    rotate(calc((var(--rot) + var(--dr, 0)) * 1deg))
    scaleX(var(--sx));
}
.chip--b1 { filter: drop-shadow(0 0 2px rgba(0,0,0,0.6)); }
.chip--b2 { filter: blur(0.4px); }
.chip--b3 { filter: blur(1.6px); }

/* the lockup and the line */
.hero__type { position: relative; z-index: 4; text-align: center; max-width: 46rem; }

.lockup { display: inline-flex; align-items: center; gap: 0.62rem; margin-bottom: clamp(1.1rem, 2.4vw, 1.9rem); }
.lockup svg { width: clamp(17px, 1.9vw, 22px); height: auto; display: block; }
.lockup span {
  font-size: clamp(0.9rem, 1.4vw, 1.15rem);
  font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase;
  padding-left: 0.34em; color: var(--cream);
}

.tagline {
  font-size: clamp(2.15rem, 6.1vw, 5.1rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.015;
  color: var(--cream);
  text-wrap: balance;
  text-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 0, 0, 0.8);
}

.hero__sub {
  margin: clamp(1.3rem, 2.6vw, 2rem) auto 0;
  max-width: 33rem;
  color: var(--text-soft);
  font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
  line-height: 1.5;
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.95);
}
/* Four lines, each its own claim, each quieter than the one above it. */
.hero__sub span { display: block; }
.sub__lead { color: var(--text); }
.sub__line { font-size: 0.9em; color: var(--text-faint); }
.sub__lead + .sub__line { margin-top: 0.7em; }

/* The last claim is the one Blake is a little embarrassed about, so it is set almost
   at the ground: a few steps above black, the way the M is. Rest on the line and it
   comes up. */
.sub__whisper {
  font-size: 0.9em;
  color: rgba(242, 245, 239, 0.11);
  text-shadow: none;
  transition: color 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.hero__sub:hover .sub__whisper,
.hero__sub:focus-within .sub__whisper,
.sub__whisper:hover { color: rgba(242, 245, 239, 0.44); }
@media (prefers-contrast: more) { .sub__whisper { color: rgba(242, 245, 239, 0.5); } }
@media (prefers-reduced-motion: reduce) { .sub__whisper { transition: none; } }

/* App Store slot. Plain text until there is a real store URL to put behind a badge. */
.store {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding: 0.6rem 1.1rem 0.62rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.8125rem; letter-spacing: 0.02em;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}
.store::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.85; flex: none;
}
.store small { display: block; color: var(--text-faint); font-size: inherit; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.9rem; transform: translateX(-50%);
  z-index: 4; color: var(--text-faint); font-size: 0.6875rem;
  letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none;
}
.scroll-cue:hover { color: var(--text-soft); }

/* ─────────────────────────────────────────  sections  ── */

.section { padding: clamp(5rem, 11vh, 8.5rem) 0; position: relative; }
.section + .section { border-top: 1px solid var(--rule-soft); }

.eyebrow {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 1.5rem;
}

.lede { font-size: clamp(1.55rem, 3.2vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; color: var(--cream); text-wrap: balance; max-width: 17em; }
.centred { max-width: 44rem; margin-inline: auto; text-align: center; text-wrap: pretty; }
.centred .body { margin-inline: auto; }
.centred .lede { margin-inline: auto; }
.body { max-width: var(--measure); color: var(--text-soft); margin-top: 1.6rem; }
.body strong { color: var(--text); font-weight: 500; }

.split { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); }
  .split--flip > :first-child { order: 2; }
}

.shot { position: relative; }
.shot img { display: block; width: 100%; height: auto; }
.shot--drawer img {
  max-width: 340px; margin-inline: auto;
  filter: drop-shadow(0 26px 60px rgba(0, 0, 0, 0.9));
}
.shot--wide img { filter: drop-shadow(0 18px 44px rgba(0, 0, 0, 0.85)); }
.caption { margin-top: 1.4rem; color: var(--text-faint); font-size: 0.8125rem; line-height: 1.6; }

/* two Caddies open at once, the way they actually sit on a desk */
.stack { position: relative; display: flex; align-items: flex-start; justify-content: center; }
.stack img { display: block; height: auto; }
.stack img.stack__front {
  position: relative; z-index: 2;
  width: min(58%, 320px); margin-top: 9%;
  filter: drop-shadow(0 30px 70px rgba(0, 0, 0, 0.95));
}
.stack img.stack__back {
  position: relative; z-index: 1;
  width: min(50%, 276px); margin-left: -7%;
  opacity: 0.66;
  filter: drop-shadow(0 24px 56px rgba(0, 0, 0, 0.9)) brightness(0.86) saturate(0.85);
}

/* the four names, in their real tints, as a quiet strip */
.strip { display: flex; flex-wrap: wrap; gap: clamp(0.9rem, 2.4vw, 2.2rem); align-items: center; margin-top: 2.6rem; }
.strip svg { height: 26px; width: auto; filter: drop-shadow(0 0 6px rgba(0,0,0,0.6)); overflow: visible; }
.strip .t-bio101 { aspect-ratio: 2.9677; } .strip .t-msj { aspect-ratio: 4.0323; }
.strip .t-research { aspect-ratio: 3.2903; } .strip .t-contracts { aspect-ratio: 3.3871; }

/* a contained No Gravity field: the same tabs, the same drift, inside a frame */
.zerog {
  position: relative;
  margin: clamp(3rem, 7vw, 5rem) 0 2.2rem;
  aspect-ratio: 5 / 2;
  border: 1px solid var(--rule-soft);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(64% 78% at 50% 46%, rgba(28, 68, 41, 0.2), transparent 70%),
    linear-gradient(160deg, #08080a, #000 62%);
}
.zerog .tab--b1 { --h: clamp(20px, 3vw, 38px); }
.zerog .tab--b2 { --h: clamp(14px, 2.1vw, 26px); }
.zerog .tab--b3 { --h: clamp(10px, 1.5vw, 18px); }
@media (max-width: 40rem) { .zerog { aspect-ratio: 4 / 3; } }

/* ───────────────────────────────────────────  letter  ── */

.letter { position: relative; overflow: hidden; padding-block: clamp(7rem, 15vh, 13rem); }

/* Blake's mark on the things he makes. A few tonal steps off the ground, cropped hard,
   and never explained. */
.letter__m {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -48%);
  font-family: var(--sans);
  font-size: min(46rem, 66vw);
  font-weight: 700;
  line-height: 0.7;
  color: #0a0a0b;
  letter-spacing: -0.06em;
  user-select: none;
  z-index: 0;
}
@media (prefers-contrast: more) { .letter__m { color: #15151a; } }

.letter__body { position: relative; z-index: 1; max-width: 38rem; }
.letter__body p { font-size: clamp(1.0625rem, 1.25vw, 1.1875rem); line-height: 1.72; color: var(--text); }
.letter__body p + p { margin-top: 1.35em; }
.letter__open { font-size: clamp(1.35rem, 2.4vw, 1.75rem) !important; font-weight: 600; letter-spacing: -0.025em; color: var(--cream) !important; line-height: 1.3 !important; }
.sign { margin-top: 2.6rem; font-size: 1.0625rem; line-height: 1.75; color: var(--text); }
.sign b { display: block; font-weight: 600; color: var(--cream); }
.sign b:last-child { color: var(--text-soft); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.75rem; margin-top: 0.35rem; }

/* ────────────────────────────────────────────  close  ── */

.close { text-align: center; padding-block: clamp(5rem, 11vh, 9rem); }
.close .tagline { font-size: clamp(1.6rem, 3.6vw, 2.75rem); }

/* ───────────────────────────────────────────  footer  ── */

.foot {
  border-top: 1px solid var(--rule-soft);
  padding: 3rem 0 3.5rem;
  color: var(--text-faint);
  font-size: 0.8125rem;
}
.foot__row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; }
.foot a { color: var(--text-soft); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.foot__legal { margin-top: 1.6rem; line-height: 1.7; max-width: 42rem; }

/* ─────────────────────────────────────────  document  ── */

.doc { padding: 8.5rem 0 2rem; }
.doc__head { border-bottom: 1px solid var(--rule); padding-bottom: 2.4rem; margin-bottom: 3rem; max-width: 40rem; }
.doc h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); color: var(--cream); }
.doc__meta { margin-top: 1rem; color: var(--text-faint); font-size: 0.8125rem; }
.doc__body { max-width: 40rem; }
.doc__body h2 {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin: 3.2rem 0 1rem;
}
.doc__body h2:first-child { margin-top: 0; }
.doc__body h3 { font-size: 1.0625rem; color: var(--cream); margin: 2.2rem 0 0.6rem; letter-spacing: -0.015em; }
.doc__body p, .doc__body li { color: var(--text-soft); }
.doc__body ul { padding-left: 1.15rem; margin: 0 0 1.15em; }
.doc__body li { margin-bottom: 0.5em; }
.doc__body li::marker { color: var(--text-faint); }
.doc__body strong { color: var(--text); font-weight: 500; }
.doc__lede { font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); color: var(--text) !important; }
kbd {
  font-family: var(--sans); font-size: 0.9em; padding: 0.1em 0.42em;
  border: 1px solid var(--rule); border-radius: 5px; background: rgba(242,245,239,0.05);
  color: var(--text); white-space: nowrap;
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.875em;
  color: var(--text); background: rgba(242,245,239,0.05); padding: 0.1em 0.36em;
  border-radius: 5px; word-break: break-word;
}
.doc__body a { color: var(--text); }
.contact {
  margin: 2rem 0 0; padding: 1.6rem 1.7rem; border: 1px solid var(--rule); border-radius: 14px;
  background: linear-gradient(rgba(28, 68, 41, 0.16), rgba(28, 68, 41, 0.05));
}
.contact a { color: var(--cream); font-weight: 500; font-size: 1.0625rem; }

/* ────────────────────────────────────────────  motion  ── */

.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  /* the composition was authored in this frozen state; it is the default, not a fallback */
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tab, .chip { transition: none !important; animation: none !important; }
}

/* ───────────────────────────────────────  responsive  ── */

@media (max-width: 74rem) {
  .tab[data-drop="lg"] { display: none; }
}
@media (max-width: 56rem) {
  .tab[data-drop="md"] { display: none; }
  .chip--b3 { opacity: calc(var(--o) * 0.6) !important; }
  .stack { max-width: 27rem; margin-inline: auto; }
  .split--flip > :first-child { order: 0; }
}
@media (max-width: 40rem) {
  .tab[data-drop="sm"] { display: none; }
  .chip[data-b="3"] { display: none; }
  /* the five survivors take up phone positions, clear of the type block */
  .hero .tab { left: var(--sx, var(--x)); top: var(--sy, var(--y)); }
  /* one drawer reads at this width; two would be two thumbnails */
  .stack { max-width: 100%; }
  .stack img.stack__back { display: none; }
  .stack img.stack__front { width: 82%; margin-top: 0; }
  .centred .body { text-align: left; }
  .tab--b1 { --h: 30px; } .tab--b2 { --h: 21px; } .tab--b3 { --h: 15px; }
  .nav__name { display: none; }
  .scroll-cue { display: none; }
  .foot__row { flex-direction: column; }
}
