/* Beverly Blogs: Apple Newsroom's layout in the site's dark palette. Black
   tiles on a near-black page, a sticky local nav that carries the one filled
   button, and posts that read in a 692 px column under a 980 px cover. */
:root {
  color-scheme: dark;
  --page: #161617;
  --tile: #000000;
  --text: #f5f5f7;
  --dim: #a1a1a6;
  --faint: #86868b;
  --rule: #424245;
  --accent: #2997ff;
  --button: #0071e3;
  --button-hover: #0077ed;
  --glow: rgba(41, 151, 255, 0.26);
  --sf: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  accent-color: var(--button);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 64px; -webkit-tap-highlight-color: rgba(41, 151, 255, 0.15); }
a, button { touch-action: manipulation; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/1.47 var(--sf);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--button); color: #fff; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 20;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* Index banner, like Newsroom's lit logo. */
.banner { padding: 56px 16px 52px; background: #000; text-align: center; }
.banner img { width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 19px; box-shadow: 0 0 64px var(--glow); }
.banner h1 { margin: 0; font-size: 56px; line-height: 1.07; font-weight: 600; letter-spacing: -0.005em; }
.banner p { max-width: 30em; margin: 10px auto 0; color: var(--dim); font-size: 21px; line-height: 1.38; letter-spacing: 0.011em; }

/* Tiles: a wide story with the picture beside the words, then a row of two. */
.tiles, .more { max-width: 980px; margin: 0 auto; padding: 40px 16px 0; }
.tiles { display: grid; gap: 24px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--tile);
  color: var(--text);
  text-decoration: none;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
a.tile:hover { transform: scale(1.012); }
.tile .media { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.tile .media img { width: 100%; height: 100%; object-fit: cover; }
.tile .text { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 22px 28px 26px; }
.eyebrow { margin: 0; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.tile h2, .tile h3 { margin: 0; font-size: 24px; line-height: 1.17; font-weight: 600; letter-spacing: 0.009em; }
.tile .date { margin: auto 0 0; padding-top: 14px; color: var(--faint); font-size: 14px; }

@media (min-width: 735px) {
  .tile.hero { flex-direction: row; min-height: 352px; }
  .tile.hero.flip { flex-direction: row-reverse; }
  .tile.hero .media { flex: 0 0 64%; aspect-ratio: auto; }
  .tile.hero .text { padding: 30px 32px; }
  .tile.hero h2 { font-size: 32px; line-height: 1.125; letter-spacing: 0.004em; }
}

/* The app tile: shaped like a story, carrying the filled button. */
.tile.app {
  gap: 10px;
  padding: 32px 28px;
  background: radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 60%), var(--tile);
}
.tile.app img { width: 64px; height: 64px; margin-bottom: 8px; border-radius: 14px; }
.tile.app p { margin: 0; color: var(--dim); }
.button, .contact {
  display: inline-block;
  align-self: flex-start;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font-size: 17px;
  text-decoration: none;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.button:hover, .contact:hover { background: var(--button-hover); transform: translateY(-1px); }
.tile.app .button { margin-top: 12px; }

/* Article: eyebrow, date, headline, the answer as the subhead, then a cover
   wider than the column. Body text runs the full column, like the tables. */
.post { padding: 56px 16px 0; }
.post-head, .post-body { max-width: 692px; margin: 0 auto; }
.dateline { margin: 6px 0 16px; color: var(--faint); font-size: 14px; font-weight: 600; letter-spacing: -0.016em; }
.post-head h1 { margin: 0 0 18px; font-size: 48px; line-height: 1.08; font-weight: 700; letter-spacing: -0.003em; }
.lede { margin: 0; font-size: 21px; line-height: 1.38; letter-spacing: 0.011em; }
.lede strong { font-weight: 600; }
.cta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 24px 0 0; color: var(--dim); }
.share { display: flex; align-items: center; gap: 22px; margin: 22px 0 0; }
.share a, .share button { display: inline-flex; padding: 0; border: 0; background: none; color: var(--dim); cursor: pointer; }
.share a:hover, .share button:hover, .share .copied { color: var(--text); }
.share svg { width: 20px; height: 20px; }
.post-hero { max-width: 980px; margin: 40px auto 8px; }
.post-hero img { width: 100%; border-radius: 18px; }
.post-body h2 { margin: 48px 0 12px; font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: 0.007em; }
.post-body ul, .post-body ol { padding-left: 1.25em; }
.post-body li { margin-bottom: 8px; }
.note, .sources { color: var(--dim); font-size: 15px; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { color: var(--dim); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.num { white-space: normal; }
td .tsp { display: block; color: var(--dim); font-size: 13px; }
figure.shot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin: 40px 0;
  padding: 28px;
  border-radius: 18px;
  background: var(--tile);
}
figure.shot img { width: 220px; max-width: 60%; border-radius: 26px; }
figure.shot figcaption { flex: 1 1 220px; color: var(--dim); }
figure.shot figcaption a { display: inline-block; margin-top: 10px; font-weight: 600; }
.post-body .card.cta {
  margin: 48px 0;
  padding: 28px;
  border-radius: 18px;
  background: radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 60%), var(--tile);
}
.post-body .card.cta h2 { margin: 0 0 8px; font-size: 24px; }
.post-body .card.cta .contact { margin-top: 8px; }
.more h2 { margin: 24px 0 20px; font-size: 32px; line-height: 1.125; font-weight: 600; }

@media (max-width: 734px) {
  .row-2 { grid-template-columns: 1fr; }
  .banner { padding: 40px 16px 36px; }
  .banner h1 { font-size: 40px; }
  .banner p { font-size: 19px; }
  .tile h2, .tile h3 { font-size: 21px; }
  .post { padding-top: 32px; }
  .post-head h1 { font-size: 32px; line-height: 1.125; }
  .lede { font-size: 19px; }
  .post-hero { margin-top: 28px; }
  .post-hero img { border-radius: 12px; }
  .post-body h2 { font-size: 24px; }
  figure.shot { padding: 20px; }
  table { font-size: 14px; }
  th, td { padding: 8px 6px; }
}

/* Tiles and buttons hold still for people who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  .tile, .button, .contact { transition: none; }
  a.tile:hover, .button:hover, .contact:hover { transform: none; }
}

/* Waitlist form: the address and the button side by side, stacked when
   narrow. .hp hides the field only bots fill in. */
.waitlist-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.waitlist-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 11px 18px;
  border: 1px solid #424245;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  font: inherit;
}
.waitlist-form input[type="email"]::placeholder { color: #86868b; }
.waitlist-form input[type="email"]:focus-visible { outline: 2px solid #2997ff; outline-offset: 2px; }
.waitlist-form button {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: #0071e3;
  color: #fff;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.waitlist-form button:hover { background: #0077ed; }
.form-fine { margin-top: 12px; color: #86868b; font-size: 14px; }
.form-error { color: #ff6961; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tile.app .waitlist-form, .card.cta .waitlist-form { margin-top: 12px; }

/* Calculators: a black card under the answer. Choices are pills, counts are
   steppers, and the result is one big number that updates as you go. The
   controls show from the first paint wherever scripts run (holding their
   space, so nothing jumps when the script starts); without scripting the
   card is just the answer. The caffeine list is drawn in the page with the
   script's two starting drinks for the same reason. */
.calc { margin: 32px 0 0; padding: 28px; border-radius: 18px; background: var(--tile); }
.calc fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.calc fieldset[hidden] { display: none; }
@media (scripting: none) { .calc [data-live] { display: none; } }
.calc legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; color: var(--dim); font-size: 14px; font-weight: 600; }
/* A floated legend sits inside its fieldset instead of across the divider. */
.calc legend + * { clear: both; }
.calc-choices label { display: inline-block; position: relative; margin: 0 4px 8px 0; }
.calc-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.calc-choices span {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
}
.calc-choices label:hover span { border-color: var(--dim); }
.calc-choices input:checked + span { border-color: var(--button); background: var(--button); color: #fff; }
.calc-choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.calc-result { margin: 16px 0 0; }
.calc-big { margin: 0; font-size: 64px; line-height: 1.05; font-weight: 700; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.calc-big .unit { color: var(--dim); font-size: 24px; font-weight: 600; letter-spacing: 0; }
.calc-sub { margin: 10px 0 0; color: var(--dim); }
.calc .calc-others { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.stepper label { flex: 1 1 auto; }
.stepper small { display: block; color: var(--faint); font-size: 14px; }
.step { display: flex; flex: none; align-items: center; gap: 2px; }
.step button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--text);
  font: 600 22px/1 var(--sf);
  cursor: pointer;
}
.step button:hover { border-color: var(--dim); }
.step input {
  width: 2.6em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 600 21px/1 var(--sf);
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.step input::-webkit-inner-spin-button, .step input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.step input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.calc-left { margin: 16px 0 0; padding: 14px 18px; border-radius: 12px; background: rgba(41, 151, 255, 0.12); }

@media (max-width: 734px) {
  .calc { padding: 20px; }
  .calc-big { font-size: 48px; }
  .calc-big .unit { font-size: 20px; }
}

/* The caffeine calculator's parts: a list of the day's drinks with their
   times, a row to add one, bedtime, and the curve under the big number. */
.calc select, .calc input[type="time"], .calc input[type="number"]:not(.step input) {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}
.calc select { width: 100%; }
.calc select:focus-visible, .calc input[type="time"]:focus-visible, .calc input[type="number"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calc-list { margin: 0 0 16px; padding: 0; list-style: none; }
.calc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.calc-list .name { flex: 1 1 auto; min-width: 0; }
.calc-list small { display: block; color: var(--faint); font-size: 14px; }
.calc-remove {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dim);
  font: 400 26px/1 var(--sf);
  cursor: pointer;
}
.calc-remove:hover { color: var(--text); }
.calc-add > label { display: block; margin: 0 0 8px; color: var(--dim); font-size: 14px; font-weight: 600; }
.calc-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.calc-add-row input[type="number"] { width: 6.5em; }
.calc-add-row input[hidden] { display: none; }
.calc-add-row button {
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.calc-add-row button:hover { background: var(--button-hover); }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0; padding-top: 20px; border-top: 1px solid var(--rule); }
.calc-row[hidden] { display: none; }
.calc-row label { color: var(--dim); font-size: 14px; font-weight: 600; }
.calc-chart-wrap { margin: 20px 0 0; }
.calc-chart-wrap[hidden] { display: none; }
.calc-chart { display: block; width: 100%; height: 200px; overflow: visible; }
.calc-chart .area { fill: rgba(41, 151, 255, 0.18); }
.calc-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.calc-chart .low { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; }
.calc-chart .bed { stroke: var(--dim); stroke-width: 1; }
.calc-chart text { fill: var(--faint); font: 600 12px var(--sf); letter-spacing: 0; }
.calc-hint { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.calc-hint:empty { display: none; }

/* Waitlist, its follow-up pages and the 404 page: one centred notice, the
   page's single job first. The waitlist page puts an app screen beside it. */
.notice { max-width: 980px; margin: 0 auto; padding: 64px 16px 0; }
.notice-copy { max-width: 600px; margin: 0 auto; text-align: center; }
.notice-icon { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 16px; box-shadow: 0 0 56px var(--glow); }
.notice h1 { margin: 0 0 14px; font-size: 48px; line-height: 1.08; font-weight: 700; letter-spacing: -0.003em; }
.notice .lede { color: var(--dim); }
.notice .card { margin: 32px 0 0; padding: 28px; border-radius: 18px; background: radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 60%), var(--tile); text-align: left; }
.notice .card h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.17; font-weight: 600; }
.notice .card p { margin: 0 0 10px; }
.notice .card p:last-child { margin-bottom: 0; }
.notice .card ul { margin: 0; padding-left: 1.25em; }
.notice .card li { margin-bottom: 6px; }
.notice .card .waitlist-form { margin-top: 4px; }
.notice .card .contact { border: 0; font: inherit; cursor: pointer; }
.notice-section { margin: 56px 0 0; }
.notice-section > h2 { margin: 0 0 20px; font-size: 28px; line-height: 1.14; font-weight: 600; text-align: center; }
.notice-more { margin: 28px 0 0; color: var(--dim); text-align: center; }

.notice.wl { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: 56px; max-width: 900px; }
.notice.wl .notice-copy { margin: 0; text-align: left; }
.notice.wl .notice-icon { margin-left: 0; }
.notice-shot { margin: 0; }
.notice-shot img { width: 100%; border-radius: 36px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 30px 80px rgba(0, 113, 227, 0.22); }

@media (max-width: 734px) {
  .notice { padding-top: 36px; }
  .notice h1 { font-size: 34px; line-height: 1.12; }
  .notice .card { padding: 22px 20px; }
  .notice.wl { grid-template-columns: 1fr; gap: 40px; }
  .notice-shot { width: min(240px, 66vw); margin: 0 auto; }
}
.notice .card + .card { background: var(--tile); }

/* Drinks hub: a card per drink with its common size's figures. The link is
   the lookup's question (the anchor text other pages use); it stretches over
   the whole card. */
.drink-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 8px; padding: 0 !important; list-style: none; }
.post-body .drink-grid li { margin: 0; }
.drink-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
  border-radius: 18px;
  background: var(--tile);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.drink-card:hover { transform: scale(1.015); }
.drink-card p { margin: 0; }
.drink-name { font-size: 19px; font-weight: 600; line-height: 1.21; }
.drink-size { color: var(--faint); font-size: 14px; }
.drink-figs { margin: 14px 0 12px !important; color: var(--dim); font-size: 14px; }
.drink-figs .fig { color: var(--text); font-size: 15px; }
.drink-figs b { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.drink-figs .caffeine b { color: var(--accent); }
.drink-card a { margin-top: auto; font-size: 15px; text-decoration: none; }
.drink-card a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.drink-card:hover a { text-decoration: underline; }
.drink-card a:focus-visible { outline: none; }
.drink-card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 519px) { .drink-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .drink-card { transition: none; } .drink-card:hover { transform: none; } }

/* A drink lookup's headline figure, in the post covers' style: the caffeine
   in the common size, and a bar per size shown against the FDA's 400 mg day.
   Drawn from the page's own numbers by scripts/make_drink_pages.py. */
.drink-hero {
  --bar: #ff9f0a;
  --tint: #ffc56b;
  --glow-a: rgba(255, 159, 10, 0.32);
  --glow-b: rgba(178, 80, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  max-width: 980px;
  margin: 40px auto 8px;
  padding: 40px 56px;
  border-radius: 18px;
  background:
    radial-gradient(42% 70% at 76% 60%, var(--glow-a), transparent 70%),
    radial-gradient(32% 60% at 14% 30%, var(--glow-b), transparent 72%),
    #000;
}
.drink-hero.soda { --bar: #ff375f; --tint: #ffb3c4; --glow-a: rgba(255, 55, 95, 0.3); --glow-b: rgba(137, 68, 171, 0.32); }
.drink-hero-datum { margin: 0; }
.drink-hero-datum .big {
  display: block;
  padding-bottom: 0.08em;
  background: linear-gradient(180deg, #fff 30%, var(--tint) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 128px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.drink-hero-datum .big small { margin-left: 0.12em; font-size: 0.42em; letter-spacing: -0.02em; }
.drink-hero-datum .what { display: block; margin-top: 10px; color: rgba(255, 255, 255, 0.72); font-size: 21px; font-weight: 500; }
.drink-hero-bars { flex: 0 1 auto; width: 380px; min-width: 0; max-width: 100%; height: auto; overflow: visible; }
.drink-hero-bars text { fill: rgba(255, 255, 255, 0.66); font: 500 14px var(--sf); letter-spacing: 0; }
.drink-hero-bars .value { fill: #fff; font-size: 18px; font-weight: 700; }
.drink-hero-bars .day { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.5; stroke-dasharray: 6 6; }
.drink-hero-bars .base { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.5; }

@media (max-width: 734px) {
  .drink-hero { flex-direction: column; align-items: flex-start; margin-top: 28px; padding: 28px 24px 24px; border-radius: 12px; }
  .drink-hero-datum .big { font-size: 88px; }
  .drink-hero-datum .what { font-size: 19px; }
  .drink-hero-bars { width: 100%; }
}
.dateline a { color: inherit; text-decoration-color: rgba(134, 134, 139, 0.5); }
.dateline a:hover { color: var(--text); }
