/* The hup page's own sheet (hup.css is shared with the compare, privacy and support pages;
   this one loads after it on /hup/ and overrides it). The whole film fits on the first screen,
   the features are tabs on one stage in the app's own colors (its navy ground and its mint
   accent, Themes.swift's Expanse), and there are no white tiles.

   Alignment: the bar at the top, the hero, the stage and the foot share one grid's two edges
   (they are all .wrap--wide). What is centered is centered on the page's middle: the icon, the
   line, the tabs, the marks. On the stage every tab has the same two columns: its words hang
   from the top on the left, and its picture sits in one frame on the right that keeps its
   place and its size from tab to tab. */

:root {
  --navy: #0b1625;
  --navy-in: #08111e;
  --navy-up: #14243a;
  --navy-rim: #2b3d57;
  --navy-line: rgba(150, 163, 179, 0.2);
  --navy-ink: #e6ecf3;
  --navy-text: #a3afbe;
  --navy-dim: #7f8c9d;
}

/* Hero: one centered column, as the page has always had it (the icon, the line, what hup is,
   the two downloads, the film), drawn closer together, and with the film small enough that
   all of it is on the first screen: its width gives way to a short window. */

.hero { padding: 18px 0 0; text-align: center; }
.hero__icon { width: 64px; height: 64px; margin: 0 auto 10px; }
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.035em; }
.lede { max-width: 760px; margin: 12px auto 0; font-size: clamp(1.1rem, 1.6vw, 1.2rem); line-height: 1.45; }
.hero .get { margin-top: 24px; }
.hero__film {
  width: min(100%, 680px, max(440px, (100vh - 472px) * 16 / 9));
  width: min(100%, 680px, max(440px, (100svh - 472px) * 16 / 9));
  margin: 22px auto 0;
}
.hero .stage { margin: 0; border-radius: 18px; }

/* The two downloads. The App Store's sits in a thin mint box with a small name set into its
   top edge; the Mac's is let down by the box's edge and padding, so the two buttons and the
   lines under them stay level. The badge keeps Apple's clear space inside the box. */
.get { gap: 20px; }
.store { padding-top: 15px; }
.store--mobile {
  position: relative;
  padding: 14px 14px 11px;
  border: 1px solid rgba(var(--mint-rgb), 0.85);
  border-radius: 20px;
  box-shadow: 0 0 18px rgba(var(--mint-rgb), 0.16);
}
.store__tag {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 8px;
  background: var(--bg);
  color: var(--accent);
  font: 600 11.5px/1 var(--sans);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Works with */

.works { margin-top: 44px; }
.marks { margin-top: 14px; gap: 12px 28px; }
.marks li { font-size: 15px; }
.marks svg { width: 24px; height: 24px; }
.marks + .marks { margin-top: 12px; }

/* The features: one stage, a row of tabs, one panel at a time */

.section { padding: 52px 0 0; }
.deck {
  padding: 22px 34px 34px;
  border-radius: var(--r);
  background: var(--navy) radial-gradient(110% 80% at 50% -30%, rgba(var(--mint-rgb), 0.13), transparent 62%);
  color: var(--navy-text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 30px 70px -40px rgba(11, 22, 37, 0.7);
  scroll-margin-top: 68px;
}

.deck__tabs { display: none; flex-wrap: wrap; justify-content: center; gap: 6px; padding-bottom: 22px; border-bottom: 1px solid var(--navy-line); }
.js .deck__tabs { display: flex; }
.deck__tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--navy-text);
  font: 600 14.5px/1 var(--sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.deck__tabs svg { flex: none; width: 17px; height: 17px; }
.deck__tabs button:hover { color: var(--navy-ink); background: rgba(255, 255, 255, 0.05); }
/* the open tab, as the app lights its mic key: the accent as a tint, an edge and a soft glow */
.deck__tabs button[aria-selected="true"] {
  color: var(--mint);
  background: rgba(var(--mint-rgb), 0.13);
  border-color: rgba(var(--mint-rgb), 0.42);
  box-shadow: 0 0 14px rgba(var(--mint-rgb), 0.2);
}
.deck__tabs button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* Without scripts the panels are a list. With them, they share one place, so the stage, the
   words' top line and the frame keep one size and one place whichever is open. */
.deck__panels { display: grid; gap: 44px; }
.js .deck__panels { margin-top: 30px; gap: 0; }
.panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: stretch; min-width: 0; }
.js .panel { grid-area: 1 / 1; }
.js .panel:not(.is-on) { visibility: hidden; }
.js .panel.is-on { animation: panel-in 0.26s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .js .panel.is-on { animation: none; } }

/* the words: from the frame's top line down */
.say { display: grid; gap: 24px; align-content: start; min-width: 0; padding-top: 4px; }
.pt { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; }
.pt > * { grid-column: 2; }
.pt > .glyph { grid-column: 1; grid-row: 1; align-self: start; width: 28px; height: 28px; margin: 0; color: var(--mint); }
.pt h3 { font-size: 23px; line-height: 1.18; letter-spacing: -0.022em; font-weight: 700; color: #fff; }
.pt p { margin-top: 7px; font-size: 16px; line-height: 1.5; color: var(--navy-text); }
.pt + .pt { padding-top: 24px; border-top: 1px solid var(--navy-line); }
.pt .survive, .pt .clips { margin-top: 16px; }
.pt p.fine { margin-top: 12px; font-size: 13px; color: var(--navy-dim); }

/* the frame: one place for every tab's picture, which sits in its middle and fills its width */
.show {
  container-type: inline-size;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 24px;
  border-radius: 18px;
  background: var(--navy-in);
  box-shadow: inset 0 0 0 1px var(--navy-line);
}
.show > * { min-width: 0; }

/* What the frame holds, in the stage's colors */

.deck .screen { background: var(--navy); border-color: var(--navy-line); }
.deck .screen--ipad, .deck .screen--iphone { border-color: #24344b; }
.deck .duo__label { line-height: 17px; color: var(--navy-dim); }
.deck .tabpill { border-color: var(--navy-rim); background: var(--navy-up); }

/* Anywhere: three screens of one height on one line, their names on one line under them */
@media (min-width: 681px) {
  .deck .duo { grid-template-columns: minmax(0, 1.1fr) 22px minmax(0, 1.3fr) minmax(0, 0.65fr); align-items: stretch; gap: 10px; }
  .deck .duo__dev { gap: 9px; }
  .deck .duo .screen { flex: 1; min-height: 158px; padding: 11px 11px 12px; font-size: clamp(9.5px, 2.2cqi, 12.5px); }
  .deck .duo .screen--iphone { padding: 11px 8px 12px; font-size: clamp(8.5px, 1.95cqi, 11px); }
  .deck .duo .tabpill { font-size: 1em; padding: 1px 9px; }
  /* level with the screens' middle, not the names' */
  .deck .duo__arrow { width: 22px; height: 22px; margin-bottom: 26px; }
}

/* Talk: an iPad with what was said in the draft, the mic lit, and Return beside it */
.talk { display: flex; flex-direction: column; gap: 9px; }
.talk .duo__label { text-align: center; }
.talk .screen { min-height: 0; padding: 14px 14px 12px; font-size: 13px; }
.talk .ask { margin-top: 10px; }
.caret { display: inline-block; width: 8px; height: 15px; border-radius: 1px; background: var(--mint); vertical-align: -2px; }
.draft { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px; border-radius: 12px; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-rim); font: 500 13.5px/1.3 var(--sans); }
.draft__mic {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  border-radius: 8px;
  background: rgba(var(--mint-rgb), 0.16);
  color: var(--mint);
  box-shadow: 0 0 0 1px rgba(var(--mint-rgb), 0.45), 0 0 12px rgba(var(--mint-rgb), 0.32);
  animation: lit 1.9s ease-in-out infinite;
}
@keyframes lit { 50% { box-shadow: 0 0 0 1px rgba(var(--mint-rgb), 0.62), 0 0 22px rgba(var(--mint-rgb), 0.55); } }
@media (prefers-reduced-motion: reduce) { .draft__mic { animation: none; } }
.draft__mic svg { width: 16px; height: 16px; }
.draft__words { flex: 1; min-width: 0; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft__key { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #1c2f48; color: var(--navy-ink); font: 600 14px/1 var(--sans); }
.draft__key--x { color: var(--navy-text); font-size: 12px; }

/* Two pictures side by side: one width, one height, each with its name under it */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pair__col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pair__col > :first-child { flex: 1; }

/* Alerts: the tabs across the frame, and under them the Mac's notification and the phone's */
.notes { display: grid; gap: 14px; }
.deck .tabs { margin: 0; background: var(--navy); box-shadow: inset 0 0 0 1px var(--navy-line); }
.deck .tabs .tabpill { border-color: transparent; background: transparent; color: var(--navy-dim); }
.deck .tabs .tabpill.is-on { border-color: var(--navy-rim); background: var(--navy-up); color: var(--navy-ink); }
.deck .banner { border: 0; box-shadow: none; }

/* Machines: two lists of three rows, row beside row */
.deck .places { align-content: start; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--navy-line); }
.deck .places li { min-height: 48px; color: var(--navy-ink); }
.deck .places li:first-child { background: rgba(var(--mint-rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.26); }
.deck .places svg { color: var(--navy-text); }
.deck .places svg.c-fly { color: #a583f5; }
.deck .places span { color: var(--navy-dim); }
/* what a sandbox says to a change outside its folder, in the third row's place */
.deck .places .refuse { display: block; margin: 0; padding: 7px 11px 0; border-radius: 11px; background: #050b14; box-shadow: inset 0 0 0 1px var(--navy-line); font: 11.5px/1.45 var(--mono); color: var(--navy-ink); white-space: nowrap; overflow: hidden; }
.deck .places .refuse span { display: block; margin: 0; font-size: inherit; color: #ff7b72; overflow: hidden; text-overflow: ellipsis; }

/* Projects: the tab, and the keys under it on its two panes' lines */
.stack { display: grid; gap: 16px; }
.deck .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 6px; }
.deck .keys li { gap: 10px; font-size: 14px; color: var(--navy-ink); white-space: nowrap; }
.deck .keys li > span { width: 80px; }
.deck kbd { border-color: var(--navy-rim); background: var(--navy-up); color: var(--navy-ink); }

/* The words' own lists */
.deck .survive li { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); color: var(--navy-ink); }
.deck .survive li::before {
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.4 8.3l2.3 2.3 4.9-5' fill='none' stroke='%230b1625' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.deck .clips li { background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
.deck .clips svg { color: var(--mint); }
.deck .clips code { color: var(--navy-ink); }
.deck .clips span { color: var(--navy-dim); }

/* Notepad's film, and the themes */
.deck .stage--tile { border-radius: 12px; box-shadow: 0 0 0 1px var(--navy-line); }
.deck .swatches li { color: var(--navy-text); }

/* Private: the two ends, and nothing between them but ssh */
.direct { display: grid; grid-template-columns: minmax(0, 1fr) minmax(76px, 0.6fr) minmax(0, 1fr); align-items: center; }
.direct__end { display: grid; justify-items: center; gap: 12px; padding: 26px 14px; border-radius: 16px; background: var(--navy); box-shadow: inset 0 0 0 1px var(--navy-line); text-align: center; }
.direct__end span { display: inline-flex; gap: 8px; color: var(--mint); }
.direct__end svg { width: 32px; height: 32px; }
.direct__end b { font-size: 14.5px; font-weight: 600; color: var(--navy-ink); }
.direct__wire { position: relative; height: 2px; background: linear-gradient(90deg, rgba(var(--mint-rgb), 0.25), var(--mint), rgba(var(--mint-rgb), 0.25)); }
.direct__wire span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 999px; background: var(--navy-in); box-shadow: 0 0 0 1px rgba(var(--mint-rgb), 0.45); color: var(--mint); font: 600 12.5px/1 var(--mono); }
.direct__wire svg { width: 13px; height: 13px; }

/* Get it: on the page's own ground, with no tile */

.getit { padding: 60px 0 64px; }
.getit__panel { padding: 0; background: none; }
.getit__icon { width: 72px; height: 72px; margin-bottom: 14px; }
.getit h2 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); }
.getit__panel > p { margin-top: 10px; font-size: 17px; }
.getit .get { margin-top: 24px; }
.specs { margin-top: 32px; padding-top: 24px; }

/* Narrower screens: the hero in one centered column with the film last, and each panel in one
   column, its frame under its words and as tall as its picture needs */

@media (max-width: 999px) {
  .hero h1 { font-size: clamp(2.1rem, 7vw, 3.2rem); }
  .lede { max-width: 620px; }
  .hero__film { width: min(100%, 680px, max(300px, (100vh - 520px) * 16 / 9)); width: min(100%, 680px, max(300px, (100svh - 520px) * 16 / 9)); }
  .deck { padding: 18px 24px 24px; }
  .js .deck__panels { margin-top: 26px; }
  .panel { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .js .panel:not(.is-on) { display: none; }
  .say { padding-top: 0; }
}

@media (max-width: 680px) {
  .lede { font-size: 16px; }
  .get { gap: 8px; }
  .store { padding-top: 13px; }
  .store--mobile { padding: 12px 12px 10px; border-radius: 16px; }
  .hero .stage { border-radius: 14px; }
  .works { margin-top: 30px; }
  .section { padding-top: 40px; }
  .deck { padding: 14px 14px 14px; border-radius: 22px; }
  .deck__tabs { gap: 4px; padding-bottom: 14px; }
  .deck__tabs button { height: 32px; padding: 0 11px; font-size: 13.5px; }
  .deck__tabs svg { display: none; }
  .js .deck__panels { margin-top: 20px; }
  .panel { gap: 20px; }
  .pt { grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; }
  .pt > .glyph { width: 24px; height: 24px; }
  .pt h3 { font-size: 20px; }
  .pt p { font-size: 15.5px; }
  .show { padding: 14px; border-radius: 14px; }
  .talk .screen p, .draft__words { white-space: normal; overflow: visible; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .deck .keys { grid-template-columns: minmax(0, 1fr); }
  .direct { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .direct__end { width: 100%; padding: 20px 14px; }
  .direct__wire { width: 2px; height: 46px; background: linear-gradient(180deg, rgba(var(--mint-rgb), 0.25), var(--mint), rgba(var(--mint-rgb), 0.25)); }
  .deck .swatches { gap: 12px 8px; }
  .deck .sw { padding: 9px 8px; }
  .getit { padding: 48px 0 52px; }
}

/* The narrowest phones: the two downloads still side by side */
@media (max-width: 380px) {
  .store p { gap: 5px; font-size: 12px; }
  .store p svg { width: 15px; height: 15px; }
}
