/* ---------- Poster hero (new-landing-page experiment) ----------
   The homepage hero as an orange poster: white headline, an email box
   (corners matched to the logo tile)
   with an ink Subscribe button, and the paper-cutout portrait with seven
   icons floating out of its head. Loaded by index.html after theme-v2.css.
   Delete this file and the <section class="poster"> in index.html to go
   back to the desk hero.

   The poster fills the first screen exactly (screen height minus the nav),
   so the white archive starts as soon as you scroll. Text sizes follow the
   screen height as well as the width, and the artwork takes whatever room
   is left, always whole (head, hand and shoulders).

   The artwork is separate layers in logo files/hero-poster/ (see the
   README there): a cut-out portrait and seven icons, all on transparent
   backgrounds, so the orange behind them is just this page's colour. */

:root {
  --poster-orange: #fb4e00; /* the orange from the original mockup file */
  --poster-cream: #f6eee8;
  /* Rendered height of .nav (32px top padding, 36px logo, 12px bottom).
     Update this if the nav's padding or logo size changes. Phones set
     their own value (70px) further down. */
  --nav-h: 80px;
}

/* Homepage only (html.poster-page): the page canvas is orange, so the
   strip behind a phone's status bar and the overscroll above the header
   match the poster. The body keeps its white, so the archive and footer
   stay white. (The theme-color meta in index.html does the same for
   browsers that tint their bars from it.) */
html.poster-page { background-color: var(--poster-orange); }

/* The header and the poster are one orange sheet: same colour, same paper.
   .theme-v2 on the header rule so it outranks theme-v2.css's white
   ".theme-v2 .nav" background (which loads earlier). */
.theme-v2 .nav--poster,
.poster {
  background-color: var(--poster-orange);
  /* Paper texture, drawn by the browser instead of downloaded (about 1.5KB).
     Layer 1 is a 256px tile of fine fibres (light and dark curly strands
     plus a speckle of grain); layer 2 is a 720px tile of faint blotches.
     Both tiles are seamless. Swap for a real texture image later by
     replacing this background-image. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='l' x='0' y='0'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.12' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeGaussianBlur stdDeviation='0.35'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.82 0 0 0 0 0.62 -4 0 0 0 0.5'/%3E%3C/filter%3E%3Cfilter id='d' x='0' y='0'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.12' numOctaves='2' seed='17' stitchTiles='stitch'/%3E%3CfeGaussianBlur stdDeviation='0.35'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.12 0 0 0 0 0 -4 0 0 0 0.5'/%3E%3C/filter%3E%3Cfilter id='g' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.08 0 0 0 0 0 1.2 0 0 0 -0.35'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23l)' opacity='0.18'/%3E%3Crect width='256' height='256' filter='url(%23d)' opacity='0.14'/%3E%3Crect width='256' height='256' filter='url(%23g)' opacity='0.14'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720'%3E%3Cfilter id='b' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.1 0 0 0 0 0 1.6 0 0 0 -0.7'/%3E%3C/filter%3E%3Crect width='720' height='720' filter='url(%23b)' opacity='0.2'/%3E%3C/svg%3E");
}
/* The poster starts a header's height down the page, so its texture tiles
   are shifted up by that much to carry on from the header's without a seam. */
.poster { background-position: 0 calc(-1 * var(--nav-h)); }

/* ---------- Header on the poster ----------
   On wide screens the logo and links spread further out than the rest of
   the site's 1120px column, out towards the edges of the poster. */
.nav--poster .nav__inner { max-width: 1600px; }

/* White text on the orange, the white S tile as the logo. Desktop only for
   the links: on phones they live in the slide-down menu, a white panel. */
.nav--poster .brand-name { color: #ffffff; }
.nav--poster .brand-by { color: rgba(255, 255, 255, 0.8); }
.nav--poster .nav__brand a:focus-visible { outline-color: #ffffff; }
.nav--poster .nav__menu-toggle span { background: #ffffff; }
@media (min-width: 681px) {
  .nav--poster .nav__links { color: #ffffff; font-weight: 500; }
  .nav--poster .nav__links a:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; }
}
/* With the phone menu open its white panel sits behind the brand, so the
   name goes back to ink until it closes. */
body.is-menu-open .nav--poster .brand-name { color: var(--ink); }
body.is-menu-open .nav--poster .brand-by { color: var(--color-muted); }

/* One unit, --f (the headline size), sets the whole desktop poster, so the
   figure stays in proportion to the text the way it is in the mockup (the
   figure about 10 headline-heights wide). --f is as big as the screen's
   height allows with everything on one screen: under the nav the poster
   stacks up to about 13.54 x --f (top space, two headline lines at
   1.4 --f each, the gaps
   from the mockup, the pill, the artwork) plus ~58px of fixed parts (the
   subtext lines and a small gap). Capped by width on narrow windows and at
   100px on big screens. Phones set their own sizes further down. */
.poster {
  --f: clamp(36px, min(9.6vw, (100vh - var(--nav-h) - 58px) / 13.54), 100px);
  --f: clamp(36px, min(9.6vw, (100svh - var(--nav-h) - 58px) / 13.54), 100px);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  min-height: 560px;
  color: #ffffff;
  overflow: hidden;
}

.poster__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-width: 1145px;
  margin: 0 auto;
  padding: calc(0.6 * var(--f)) var(--gutter) 0;
  text-align: center;
}

/* Headline, subtext and form. A wrapper so phones can centre the group in
   the space above the artwork; the form and its status line must stay
   siblings (script.js finds the status through the form's parent). */
.poster__copy {
  flex: none;
  /* The headline sizes itself from this column's real width (cqw), so a
     desktop scrollbar can never push "Get startup ideas" onto two lines. */
  container-type: inline-size;
}

.poster__headline {
  font-family: 'Inter Variable', var(--font-sans);
  font-weight: 700;
  font-variation-settings: 'opsz' 32;
  /* The headline is what people should read first, so it runs a size up
     from the rest of the poster: 1.4 --f, but never so wide that "Get
     startup ideas" (about 7.7em) can't hold one line, so it stays on two
     lines on narrow windows. */
  font-size: min(1.4 * var(--f), 100cqw / 7.6, 130px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #ffffff;
  margin: 0 auto calc(0.45 * var(--f));
}

.poster__subtext {
  font-family: 'Inter Variable', var(--font-sans);
  font-variation-settings: 'opsz' 14;
  font-size: clamp(15px, 0.19 * var(--f), 19px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 32em;
  margin: 0 auto calc(0.6 * var(--f));
  color: #ffffff;
}

/* The pill. The form is the cream capsule; the input and button sit inside. */
.poster .subscribe-form {
  position: relative;
  flex: none;
  width: 100%;
  /* Slightly narrower than the headline, as in the mockup, but never so
     narrow the address gets cramped. */
  max-width: clamp(420px, 7 * var(--f), 640px);
  margin: 0 auto;
  /* Rim and button height as variables so the corners can be worked out
     from them (phones change both further down). */
  --pill-pad: clamp(5px, 0.1 * var(--f), 8px);
  --pill-btn-h: clamp(40px, 0.7 * var(--f), 48px);
  padding: var(--pill-pad);
  gap: 8px;
  align-items: center;
  background: var(--poster-cream);
  /* Same corner as the Startup Ideas tile in the nav: its radius is about
     17% of its height (measured off startup-ideas-tile-160.png, ~27px on
     160px), so the box gets 17% of its own height. */
  border-radius: calc(0.17 * (var(--pill-btn-h) + 2 * var(--pill-pad)));
}
.poster .subscribe-form:focus-within {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

.poster__mail {
  flex-shrink: 0;
  margin-left: 16px;
  color: var(--grey-600);
  pointer-events: none;
}

.poster .subscribe-form input[type="email"] {
  height: var(--pill-btn-h);
  padding: 0 8px;
  font-size: clamp(15px, 0.29 * var(--f), 17px);
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.poster .subscribe-form input[type="email"]::placeholder { color: var(--grey-600); }
.poster .subscribe-form input[type="email"]:focus { box-shadow: none; }

.poster .subscribe-form .btn {
  width: auto;
  height: var(--pill-btn-h);
  padding: 0 clamp(20px, 0.5 * var(--f), 32px);
  font-family: 'Inter Variable', var(--font-sans);
  font-size: clamp(14px, 0.27 * var(--f), 16px);
  font-weight: 500;
  color: #ffffff;
  background: var(--text);
  border: 0;
  /* Concentric with the box: its corner less the rim, so the gap between
     button and box edge stays even all the way round. */
  border-radius: calc(0.17 * (var(--pill-btn-h) + 2 * var(--pill-pad)) - var(--pill-pad));
  transition: background-color 180ms ease;
}
.poster .subscribe-form .btn:hover { background: var(--grey-800); }
.poster .subscribe-form .btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Takes no room until it has something to say (an error, or "You're in"),
   so the artwork isn't pushed down by an empty line. */
.poster .subscribe-status {
  flex: none;
  margin: 8px auto 0;
  color: #ffffff;
  text-align: center;
}
.poster .subscribe-status:empty { margin: 0; }
.poster .subscribe-status.is-success,
.poster .subscribe-status.is-error { color: #ffffff; font-weight: 600; }
.poster .turnstile-slot.is-visible { flex: none; margin: 8px auto 0; }

/* ---------- Portrait and floating icons ----------
   The stage is whatever height is left under the form. The art box holds
   the portrait (along its bottom edge) and the icons above it, at
   1027 x 749. That's the original artwork's 1027 x 814 with 8% trimmed
   off the top: the icons were dropped by the same amount so they overlap
   the top of the head slightly, and the empty strip above them went, so
   the figure gets that height instead. margin-top:auto sits it on the
   bottom edge of the poster. */
.poster__stage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 calc(-1 * var(--gutter));
  container-type: size;
  pointer-events: none;
  user-select: none;
  /* How much of the artwork (from the top) must stay on screen. Below 1
     lets the figure grow bigger than the space under the text, with the
     lower torso running off the bottom edge. 0.9 keeps the head, icons
     and the whole hand, trimming only the bottom of the torso. Raise it to
     show more body, lower it for a bigger figure (0.82 was tried and cut
     too much). */
  --show: 0.9;
  /* The artwork's width: as wide as the stage allows, or as big as the
     stage height allows with (1 - --show) cropped off the bottom. Used by
     the children (cq units resolve against this stage). */
  --art-w: min(100cqw, 100cqh * 1027 / 749 / var(--show));
}

.poster__art {
  position: relative;
  flex: none;
  margin-top: auto;
  width: var(--art-w);
  aspect-ratio: 1027 / 749;
}

.poster__portrait {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: auto;
}

/* All seven icons in one layer the size of the art box, so phones can
   move them together. */
.poster__icons { position: absolute; inset: 0; }

/* Each icon's position and size come from --x, --y (left and top, as a
   share of the art box) and --w (width, as a percentage) set inline. */
.poster__icon {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--w) * 1%);
  display: block;
  height: auto;
  /* Our own shadow (the icon files are cut flat): a soft, dark-orange
     shadow down and to the right, so the paper icons lift off the page. */
  filter: drop-shadow(1px 3px 3px rgba(110, 30, 0, 0.45));
  will-change: transform;
  animation: poster-float-up var(--period) ease-in-out var(--delay) infinite;
  /* Pushed away from the mouse by script.js (--push-x/--push-y). A
     separate property from the float's transform, so the two add up. */
  translate: var(--push-x, 0px) var(--push-y, 0px);
  transition: translate 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.poster__icon:nth-of-type(even) { animation-name: poster-float-down; }

/* --motion scales every icon's travel and tilt: 1 on desktop, more on
   phones (set in the phones block). */
@keyframes poster-float-up {
  0%, 100% { transform: translate3d(0, calc(-1 * var(--amp) * var(--motion, 1)), 0) rotate(calc(-1 * var(--rot) * var(--motion, 1))); }
  50%      { transform: translate3d(0, calc(var(--amp) * var(--motion, 1)), 0) rotate(calc(var(--rot) * var(--motion, 1))); }
}
@keyframes poster-float-down {
  0%, 100% { transform: translate3d(0, calc(var(--amp) * var(--motion, 1)), 0) rotate(calc(var(--rot) * var(--motion, 1))); }
  50%      { transform: translate3d(0, calc(-1 * var(--amp) * var(--motion, 1)), 0) rotate(calc(-1 * var(--rot) * var(--motion, 1))); }
}

@media (prefers-reduced-motion: reduce) {
  .poster__icon { animation: none; }
}

/* The old hero padded its own bottom; the poster ends flush on the
   portrait, so the archive brings its own space. */
.poster + .archive { padding-top: clamp(32px, 4vw, 48px); }

/* ---------- Phones ----------
   Poster layout: text pinned under the header, artwork on the bottom edge,
   one gap between. Sizes follow the screen's height as well as its width,
   so a tall phone gets a bigger headline and figure and an SE-size phone
   still fits everything on one screen. */
@media (max-width: 680px) {
  :root { --nav-h: 70px; }
  /* Full screen height, locked. script.js measures the screen once on
     load (the largest viewport, toolbars tucked away) into --poster-vh
     and only re-measures when the width changes. So the poster fills the
     screen, running behind Safari's floating address bar, but never
     grows or shrinks as a browser's bars collapse on scroll (Instagram's
     in-app browser resizes the page as you scroll). --pvh is 1% of that
     locked height; every height-based size on phones uses it. */
  .poster {
    --pvh: calc(var(--poster-vh, 100vh) / 100);
    height: calc(100 * var(--pvh) - var(--nav-h));
    min-height: 520px;
  }
  .poster__inner { padding-top: clamp(24px, 5 * var(--pvh), 56px); }
  .poster__copy { margin: 0; }

  /* Two lines, as big as the column allows: "Get startup ideas" measures
     7.39em (checked in the browser), so the column width / 7.6 fills the
     space between the logo's left edge and the menu's right edge with a
     little in hand. 6.2% of the screen height caps it on short screens. About 46px on an
     iPhone 16, 51px on a 430 x 932, 41px on an SE. */
  .poster__headline {
    font-size: max(30px, min(100cqw / 7.6, 6.2 * var(--pvh)));
    margin-bottom: clamp(14px, 2.4 * var(--pvh), 24px);
  }
  .poster__subtext {
    /* Same line break as desktop ("...demo'd and delivered / to your
       inbox every Friday."), so the words never rewrap when the window
       crosses into phone width. The first line measures 26.5em, so the
       column width / 27 fits it: about 13px on an iPhone 16, 12px on
       the smallest phones, never above 14px. */
    font-size: max(12px, min(14px, 100cqw / 27));
    margin-bottom: clamp(20px, 3.8 * var(--pvh), 36px);
  }

  /* Phones keep a fixed pill rather than one scaled to the headline. */
  .poster__mail { display: none; }
  /* 46px tall in all: a 40px button in a 3px rim, and a bit narrower than
     the column. The input stays at 16px so iOS doesn't zoom on focus. */
  .poster .subscribe-form { --pill-pad: 3px; --pill-btn-h: 40px; max-width: 310px; }
  .poster .subscribe-form input[type="email"] { padding-left: 12px; font-size: 16px; }
  .poster .subscribe-form .btn { padding: 0 18px; font-size: 14px; }

  /* The artwork grows into whatever height is left: up to 136% of the
     screen width on tall phones (cropping the shoulder tips, about 13% of
     the figure a side; head and hand stay whole) and smaller than the
     screen on short ones. */
  /* The stage only asks for the artwork's natural height (136% of the
     screen width, x 749/1027) and shrinks below that on short phones,
     where the figure then scales to fit. Tall phones' spare height goes
     to two spacers instead: two shares above the headline, one between
     the pill and the icons, so the icons always sit just above the head
     and the gap under the pill stays small. */
  .poster__inner::before,
  .poster__inner::after { content: ""; }
  .poster__inner::before { order: 0; flex: 2 1 0; }
  .poster__copy { order: 1; }
  .poster__inner::after { order: 2; flex: 1 1 0; }
  .poster__stage {
    order: 3;
    flex: 0 1 calc(136vw * 749 / 1027);
    /* 14vw extra on top: room for the icons' wider spread (below). */
    margin: calc(8px + 14vw) calc(-1 * var(--gutter)) 0;
    --art-w: min(136cqw, 100cqh * 1027 / 749 / var(--show));
  }
  .poster__art { width: var(--art-w); }
  /* The icon row is laid out against the screen, not the figure: the
     layer spans the text column (logo's left edge to menu's right edge),
     the rocket starts at its left edge and the dollar ends near its right,
     with the others spaced proportionally between. Icons keep the size
     they have on the figure (--w of the artwork's width). */
  .poster__icons {
    left: calc(50% - 50cqw + var(--gutter));
    right: calc(50% - 50cqw + var(--gutter));
  }
  /* The icons also spread further above the head (2.2x their height above
     it, which starts 19.76% down the art box), filling the space between
     the head and the pill. */
  /* Across, the seven icons take evenly spaced slots (--i, 0 to 6, set
     inline): the rocket starts at the logo's left edge, the dollar ends at
     the menu's right edge and the bulb sits in the middle. --s scales
     them against their size on the figure (1 = same size; above 1 they
     grow upwards, the negative top margin being roughly the extra height,
     so their bottoms stay put above the head). */
  .poster__icon {
    --s: 1;
    --icon-w: calc(var(--w) * var(--art-w) / 100 * var(--s));
    left: calc(var(--i) * (100% - var(--icon-w)) / 6);
    top: calc(19.76% - (19.76% - var(--y)) * 2.2 + var(--drop, 0%));
    width: var(--icon-w);
    margin-top: calc(var(--w) * var(--art-w) / 100 * (1 - var(--s)) * 0.9);
  }
  /* The bottom row (unicorn, bulb, laptop: the 2nd, 4th and 6th icons)
     sits a little lower, closer to the head. */
  .poster__icon:nth-of-type(even) { --drop: 4%; }
  /* Phones float the icons further and tilt them more than desktop. */
  .poster__icons { --motion: 1.8; }

}
@media (max-width: 360px) {
  .poster .subscribe-form .btn { padding: 0 16px; }
  .poster .subscribe-form input[type="email"] { padding-left: 8px; }
}
