/* Toonhook: whiteboard and 3D animated video ads.
   Whiteboard and marker: a warm board, black marker type, one blue marker. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("fonts/kalam-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("fonts/kalam-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --board: #F5F4F0;      /* the whiteboard */
  --ink: #1C1D20;        /* black marker */
  --graphite: #585A60;   /* secondary text */
  --ghost: #E2E0D8;      /* erased-marker ghosting: rules, empty screens */
  --marker: #2446C6;     /* the one blue marker */
  --marker-deep: #1A3496;

  --gutter: clamp(16px, 5vw, 48px);
  --max: 1200px;
  --col-gap: 40px;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Kalam", "Bradley Hand", "Comic Sans MS", cursive;
}

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

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

body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3, p, ol, ul { margin: 0; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--board);
  text-decoration: none;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 244, 240, 0.94);
  border-bottom: 1px solid var(--ghost);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .top {
    background: rgba(245, 244, 240, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

/* The wordmark: outlined Archivo with the eyes in its first "oo" (brand/wordmark.svg). */
.sig {
  display: block;
  padding: 8px 0;
  line-height: 0;
}
.sig img { height: 26px; width: auto; }

.top-mail {
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--marker);
  padding: 10px 0;
}
.top-mail:hover { color: var(--marker); }

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(32px, 8vw, 104px);
  padding-bottom: clamp(8px, 2vw, 16px);
}

.hero h1 {
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(2.5rem, 10.4vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  max-width: 11.5em;
  text-wrap: balance;
}

.lede {
  margin-top: clamp(20px, 3vw, 32px);
  max-width: 34ch;
  font-size: clamp(1.125rem, 2.2vw, 1.4375rem);
  line-height: 1.45;
  color: var(--ink);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 24px;
  background: var(--marker);
  color: #fff;
  font-weight: 650;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--marker-deep); }

.hero-tel {
  font-size: 1rem;
  color: var(--graphite);
  text-decoration: none;
  padding: 8px 0;
}
.hero-tel:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* The one drawn moment: a marker note and an arrow that draws itself on load. */
.note {
  margin-top: clamp(22px, 5vw, 44px);
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--marker);
  font-family: var(--hand);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.2;
}
.note span { padding-top: 2px; transform: rotate(-1.5deg); transform-origin: left center; }
.note-arrow {
  width: clamp(50px, 12vw, 66px);
  height: clamp(40px, 9.4vw, 52px);
  flex: none;
  margin-top: 6px;
  overflow: visible;
}
.note-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .note span { animation: ink-in 0.5s ease-out 0.15s both; }
  .note-arrow .stroke { animation: draw 0.7s cubic-bezier(.45,.05,.35,1) 0.55s both; }
  .note-arrow .head { animation: draw 0.25s ease-out 1.25s both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ink-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

/* ---------- Work sections ---------- */

.work { padding-top: clamp(36px, 7vw, 88px); }
#work, #contact { scroll-margin-top: 56px; }
.work + .work { padding-top: clamp(64px, 9vw, 120px); }

.work-intro h2,
.steps h2,
.contact h2 {
  font-weight: 800;
  font-stretch: 104%;
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.work-intro p {
  margin-top: 10px;
  max-width: 36ch;
  color: var(--graphite);
}

/* Phone-shaped cards drawn like the phones in the whiteboard ads:
   a black marker outline with a sliver of board inside. */
.screen {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 28px;
  padding: 6px;
  background: var(--board);
}
.screen video {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 19px;
  background: var(--ghost);
  object-fit: cover;
}

.play {
  position: absolute;
  inset: 6px;
  display: block;
  overflow: hidden;
  border-radius: 19px;
  background: var(--ghost);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-mark {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px 0 11px;
  background: var(--board);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1;
  color: var(--ink);
  transition: transform 0.15s ease;
}
.play-mark svg { width: 17px; height: 17px; }
.play-mark path { fill: var(--marker); stroke: var(--marker); stroke-width: 1.5; stroke-linejoin: round; }
.play:hover .play-mark { transform: translateY(-2px); }
.play:focus-visible { outline-offset: -6px; border-radius: 19px; }

.screen.is-playing .play { visibility: hidden; }

.screen--wide { border-radius: 20px; padding: 6px; }
.screen--wide video { aspect-ratio: 16 / 9; border-radius: 11px; }
.screen--wide .play,
.screen--wide .play:focus-visible { border-radius: 11px; }

.ad h3 {
  margin-top: 16px;
  font-weight: 700;
  font-stretch: 104%;
  font-size: 1.1875rem;
  line-height: 1.2;
}
.ad-desc {
  margin-top: 6px;
  font-size: 0.96875rem;
  line-height: 1.5;
  max-width: 34ch;
}
.ad-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--graphite);
}
.dur { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* Phone: each set of ads is a swipeable row with the next card peeking in. */
.rail {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 18px;
  margin-top: 24px;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  padding-bottom: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail > .ad {
  flex: 0 0 min(72vw, 300px);
  scroll-snap-align: start;
}

.ad--wide { margin-top: 24px; }
.rail--4 { margin-top: 36px; }

/* ---------- How it works ---------- */

.steps { padding-top: clamp(88px, 11vw, 152px); }

.step-list {
  list-style: none;
  padding: 0;
  margin-top: 28px;
  display: grid;
  gap: 24px;
}
.step-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  gap: 8px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.step-num {
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.875rem;
  line-height: 1;
  color: var(--marker);
}
.step-list p {
  max-width: 30ch;
  font-size: 1.125rem;
  line-height: 1.45;
  padding-top: 4px;
}

/* ---------- Contact ---------- */

.contact {
  padding-top: clamp(88px, 11vw, 152px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.contact > p {
  margin-top: 10px;
  color: var(--graphite);
  max-width: 40ch;
}
.contact > .hello {
  margin-top: 14px;
  color: var(--marker);
  font-family: var(--hand);
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.2;
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.contact > .hello + p { margin-top: 6px; }
.mail-big {
  display: inline-block;
  margin-top: 28px;
  font-weight: 750;
  font-stretch: 100%;
  font-size: clamp(1.5rem, 6.6vw, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}
.mail-big:hover { color: var(--marker); }
.tel-big {
  display: block;
  width: fit-content;
  margin-top: 14px;
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  padding: 4px 0;
}
.tel-big:hover { color: var(--marker); }

/* ---------- Footer ---------- */

.foot {
  padding-top: 24px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ghost);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.875rem;
  color: var(--graphite);
}
.foot a { color: var(--ink); text-underline-offset: 3px; }
.foot-brand { display: flex; align-items: center; gap: 8px; }

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  .rail > .ad { flex-basis: 280px; }
  .step-list { grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
  .step-list li { grid-template-columns: 1fr; gap: 10px; }
}

@media (min-width: 1000px) {
  /* Four even columns. The section intro takes the first one. */
  .work-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: 56px;
    align-items: start;
  }
  .work-intro { grid-column: 1; padding-top: 4px; }
  .rail {
    display: grid;
    margin: 0;
    padding: 0;
    overflow: visible;
    gap: var(--col-gap);
  }
  .rail--3 { grid-column: 2 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail--4 { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ad--wide { grid-column: 2 / -1; margin-top: 0; }
  .ad--wide .ad-desc { max-width: 52ch; }
  .work-intro h2 { font-size: 1.75rem; font-stretch: 96%; }

  /* Hero: the note sits beside the call to action and points down at the work. */
  .hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--col-gap);
    padding-top: 84px;
  }
  .hero h1 { grid-column: 1 / -1; }
  .lede, .hero-actions { grid-column: 1 / 3; }
  .note {
    grid-column: 3 / -1;
    grid-row: 3;
    align-self: end;
    justify-self: start;
    margin: 0 0 -28px;
  }
  #work { padding-top: 64px; }
}

/* ---------- Private sample pages (/s/<slug>/) ---------- */

.sample {
  display: grid;
  gap: 24px;
  padding-top: clamp(28px, 6vw, 72px);
  padding-bottom: clamp(48px, 8vw, 96px);
}
.sample-tag {
  font-family: var(--hand);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.2;
  color: var(--marker);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.sample h1 {
  margin-top: 10px;
  font-weight: 800;
  font-stretch: 104%;
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 19ch;
  text-wrap: balance;
}
.sample-player { width: min(100%, 340px); }
/* The samples carry a SAMPLE watermark bottom left, so the play pill sits bottom right. */
.sample-player .play-mark { left: auto; right: 12px; }
.sample-reply { font-size: 1.125rem; line-height: 1.45; }
.sample-reply a {
  font-weight: 650;
  white-space: nowrap;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.sample-reply a:hover { color: var(--marker); }
.sample-more { margin-top: 10px; }
.sample-more a { color: var(--graphite); text-underline-offset: 3px; }
.sample-more a:hover { color: var(--ink); }

/* Clean downloads under a submission (Fabulous). */
.sample-files { margin-bottom: 28px; max-width: 440px; }
.files-head { font-weight: 700; font-size: 1.0625rem; }
.files-list { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 10px; }
.files-list a {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--board);
  text-decoration: none;
}
.files-list a:hover { border-color: var(--marker); }
.files-ratio { font-weight: 800; font-stretch: 104%; font-size: 1.1875rem; font-variant-numeric: tabular-nums; }
.files-meta { color: var(--graphite); font-size: 0.9375rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.files-get { color: var(--marker); font-weight: 700; font-size: 0.9375rem; }
.files-list a:hover .files-get { color: var(--marker-deep); text-decoration: underline; text-underline-offset: 3px; }
.files-alt { margin-top: 12px; color: var(--graphite); font-size: 0.9375rem; }
.files-alt a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.files-alt a:hover { color: var(--marker); }

@media (min-width: 900px) {
  /* Copy and reply sit beside the player, centered on it. */
  .sample {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: ". player" "copy player" "next player" ". player";
    column-gap: 96px;
    row-gap: 0;
  }
  .sample-copy { grid-area: copy; }
  .sample-next { grid-area: next; padding-top: 28px; }
  .sample-player { grid-area: player; width: 100%; }
}
