/* The gallery page: tokens, header, controls, sections, footer. Light first; html.dark flips the page. */
:root{--bg:#FFFFFF;--panel:#F6F6F6;--line:#E2E2E2;--ink:#000000;--mut:#6B6B6B;--chip:#EEEEEE;--on:#000000;--on-ink:#FFFFFF;--focus:#276EF1;
  --sans:system-ui,-apple-system,BlinkMacSystemFont,'SF Pro Text','Helvetica Neue',sans-serif;
  --gut:clamp(16px,4vw,48px);--r:16px;color-scheme:light}
html.dark{--bg:#000000;--panel:#141414;--line:#333333;--ink:#FFFFFF;--mut:#AFAFAF;--chip:#1F1F1F;--on:#FFFFFF;--on-ink:#000000;--focus:#5B91F5;color-scheme:dark}
@media (max-width:420px){:root{--gut:13px}}   /* 390 - 2 x 13 = 364: a medium widget fits at 1:1 */
*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none !important}
html{background:var(--bg);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;text-size-adjust:100%;scroll-padding-top:64px}
@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
body{min-height:100vh}
a{color:inherit}
h1,h2,h3{text-wrap:balance}
p{text-wrap:pretty}
:focus-visible{outline:2px solid var(--focus);outline-offset:3px;border-radius:6px}
.wrap{max-width:1320px;margin:0 auto;padding:0 var(--gut)}
.skip{position:absolute;left:-9999px;padding:8px 12px;border-radius:8px;background:var(--panel);z-index:20}
.skip:focus{left:var(--gut);top:8px}

/* Header: brand, nav, page appearance, name. On phones the nav scrolls sideways and the last item is cut mid-word. */
.site-h{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);border-bottom:1px solid var(--line)}
.site-h .wrap{display:flex;align-items:center;gap:16px;height:64px}
.brand{display:inline-flex;align-items:baseline;gap:6px;flex:none;height:44px;line-height:44px;padding:0 8px;margin-left:-8px;border-radius:10px;font:700 20px/44px var(--sans);letter-spacing:-.02em;text-decoration:none;white-space:nowrap}
.brand span{font-weight:500;color:var(--mut)}
.site-h nav{flex:1;min-width:0}
.site-h ul{display:flex;gap:2px;list-style:none;white-space:nowrap}
.site-h nav a,.by-link,.theme{display:inline-flex;align-items:center;height:44px;padding:0 10px;border-radius:10px;font:500 15px/1 var(--sans);text-decoration:none;color:var(--mut)}
.site-h nav a:hover,.by-link:hover,.theme:hover{color:var(--ink);background:var(--panel)}
.site-h nav a:focus-visible,.by-link:focus-visible,.theme:focus-visible{outline-offset:-2px}
.by-link{flex:none;color:var(--ink);font-weight:700}
.theme{flex:none;gap:8px;border:0;background:none;cursor:pointer;color:var(--ink)}
.theme svg{display:block;flex:none}
.by-link{margin-right:-10px}   /* label, not padding, on the content edge */
@media (max-width:1099px){.by-link{display:none}.theme{margin-right:-10px}}
@media (max-width:899px){.site-h{position:static}.site-h .wrap{flex-wrap:wrap;height:auto;gap:0;padding-top:6px;padding-bottom:4px;justify-content:space-between}
  .site-h nav{order:3;flex-basis:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:none;margin:0 calc(-1 * var(--gut));padding:0 var(--gut)}.site-h nav::-webkit-scrollbar{display:none}
  .site-h ul{margin-left:-10px}}

/* Controls: chips are rectangles, radius 10; the chosen one is black (white in dark). */
.btn,.seg button{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 16px;border-radius:10px;font:700 15px/1 var(--sans);text-decoration:none;white-space:nowrap;cursor:pointer;
  color:var(--ink);background:var(--chip);border:0;transition:background-color .15s,color .15s}
.btn:hover,.seg button:hover:not([aria-pressed=true]):not([disabled]){box-shadow:inset 0 0 0 1.5px var(--mut)}   /* a ring you can see, not a 1.1:1 fill */
.btn.text{height:44px;padding:0;background:none;font-weight:500;text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}
.btn.text:hover{box-shadow:none;text-decoration-thickness:2px}
.btn.text:focus-visible{outline-offset:4px}   /* no padding: the ring needs its own room */
.btn.primary,.seg button[aria-pressed=true]{background:var(--on);color:var(--on-ink)}
.btn:focus-visible,.seg button:focus-visible{outline-offset:2px}
.seg{display:flex;flex-wrap:wrap;gap:8px}
.seg button{font-weight:500;font-size:15px;padding:0 14px;border-radius:10px}
.seg button[aria-pressed=true]{font-weight:700}
.seg button[disabled]{opacity:.4;cursor:default}
.lab{display:block;font:500 15px/20px var(--sans);color:var(--mut);margin-bottom:8px}
.note{color:var(--mut);font-size:15px;line-height:1.5;text-wrap:balance}
.tcard p{text-wrap:balance}   /* pretty left one- and two-word last lines here */
.ctl{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-content:start}
.clock{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}   /* the Day row scrolls; it never widens its column */
.clock .seg button{min-width:56px;padding:0 10px}
.time{display:flex;align-items:center;gap:16px}
.time output{flex:none;width:76px;font:700 15px/20px var(--sans);font-variant-numeric:tabular-nums}
.time input{flex:1;min-width:0;height:44px;accent-color:var(--on);cursor:pointer}

/* Section titles: sentence case, no eyebrows in caps. */
.sec{border-top:1px solid var(--line);padding:round(clamp(48px,7vw,96px),4px) 0}   /* on the 4 px grid at every width */
.h2{font:700 clamp(28px,3.4vw,40px)/1.1 var(--sans);letter-spacing:-.02em}
.sub{margin-top:12px;color:var(--mut);font-size:17px;line-height:1.5;max-width:60ch;text-wrap:balance}   /* short subtitles: no one- or two-word last line */
.head{margin-bottom:32px}

/* Hero */
.hero{display:grid;grid-template-columns:minmax(0,1fr) min(620px,calc(100% - 520px));   /* the text keeps 440 px or more; the widget column never depends on its caption */
  gap:clamp(32px,5vw,80px);align-items:center;padding-top:round(clamp(32px,6vw,88px),4px);padding-bottom:round(clamp(48px,7vw,96px),4px)}
.kick{font:500 15px/20px var(--sans);color:var(--mut)}
h1{font:700 clamp(40px,5.2vw,68px)/1 var(--sans);letter-spacing:-.03em;margin-top:16px;max-width:13ch}
.lede{margin-top:24px;color:var(--mut);font-size:19px;line-height:1.5;max-width:44ch}
.hero-w{display:grid;gap:12px;justify-items:start;min-width:0}
.stage-p{justify-self:stretch;min-width:0}   /* the column, not the widget, sets the scale */
.stage{--z:1;max-width:100%;width:calc(var(--w) * var(--z));height:calc(var(--h) * var(--z))}
.stage>div{width:var(--w);height:var(--h);transform:scale(var(--z));transform-origin:0 0}
.hero-cap{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.live{min-height:1.5em}
@media (max-width:1239px){.hero{grid-template-columns:minmax(0,1fr)}}   /* 1240: 1144 content = 520 text + 620 widget column; below it the widget would drop to 1.1x */
/* One column, 728 to 1239: the widget (1.7x) sits centred on a panel that spans the column, like the board. Narrower, the widget
   itself spans the column. Either way it ends on both content edges. */
@media (min-width:728px) and (max-width:1239px){.hero-w{justify-items:stretch}.stage-p{display:grid;justify-items:center;padding:40px 0;border-radius:24px;background:var(--panel)}}
@media (max-width:389px){.stage{--z:.8}}   /* before the script sizes it: never wider than a 320 screen */

/* What Uber ships today */
.today{display:grid;grid-template-columns:1fr;gap:24px}
@media (min-width:600px){.today{grid-template-columns:1fr 1fr}.tcard.new{grid-column:1/-1}}   /* two shipped widgets side by side, the concept card under both */
@media (min-width:1000px){.today{grid-template-columns:repeat(3,1fr)}.tcard.new{grid-column:auto}}
.tcard{display:grid;align-content:start;gap:8px;padding:24px;border-radius:var(--r);background:var(--panel);font-size:17px;line-height:1.5}
.tcard h3{font:700 20px/1.2 var(--sans)}
.tcard .when{color:var(--mut);font-size:15px;line-height:20px;margin-bottom:8px}
.tcard .src{margin-top:4px;font-size:15px;color:var(--mut)}.tcard .src a{display:inline-block;padding:3px 0;text-underline-offset:3px;text-decoration-thickness:1px}
.tcard ul{list-style:none;display:grid;gap:6px}.tcard li{padding-left:16px;position:relative;text-wrap:balance}
.tcard li::before{content:'';position:absolute;left:0;top:.7em;width:6px;height:6px;margin-top:-3px;border-radius:50%;background:var(--ink)}
.tcard.new{background:var(--on);color:var(--on-ink)}.tcard.new .when{color:color-mix(in srgb,var(--on-ink) 66%,transparent)}.tcard.new li::before{background:var(--on-ink)}

/* Flow strip: three frames, the route motif between them (dot, line, square); stacked below 640 */
.flow{display:flex;flex-wrap:wrap;align-items:flex-start;gap:24px}   /* narrow: two frames to a row (gallery script sizes them) */
.flow.wide{flex-wrap:nowrap;gap:0}
.flow figure{display:grid;gap:12px;align-content:start;flex:none;width:calc(170px * var(--cs,1))}
.flow.wide .fl-x{margin-left:48px}   /* the lapsed quote is always the fourth frame, same size and caption; wide, a gap, not a link, sets it apart */
.flow figcaption{font:700 15px/20px var(--sans);text-wrap:balance}
.fl-link{display:none}
.flow.wide .fl-link{display:flex;align-items:center;flex:1;min-width:96px;height:8px;margin-top:calc(85px * var(--cs,1) - 4px);padding:0 12px}
.fl-link i{flex:none;width:8px;height:8px;border-radius:50%;background:var(--ink)}.fl-link i:last-child{border-radius:1px}
.fl-link b{flex:1;height:2px;margin:0 4px;border-radius:1px;background:var(--ink)}
.ios{margin-top:24px;max-width:72ch;font-size:13px;line-height:1.5}

/* Catalog: the widget picker, the board, then state, appearance and the clock under it */
.cat{display:grid;gap:24px}
.tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;scroll-snap-type:x proximity;scrollbar-width:none;
  margin:-4px calc(-1 * var(--gut));padding:4px var(--gut);scroll-padding:0 var(--gut)}   /* 4 px inside the scroller for the focus ring (2 offset + 2 wide) */
.tabs::-webkit-scrollbar{display:none}.tabs button{flex:none;scroll-snap-align:start}
.cat-ctl{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;min-width:0}
.cat-ctl>*,.cat-ctl .clock>*{min-width:0}   /* the Day row scrolls instead of widening the column */
.cat-ctl .clock{display:contents}
@media (min-width:1100px){.cat-ctl{grid-template-columns:auto auto minmax(240px,1fr);column-gap:40px;align-items:start}.cat-ctl>:first-child{grid-column:1/-1}
  .cat-ctl .clock .tabs{margin:-4px;padding:4px}}   /* the Day row fits beside Appearance: no bleed into the next column */
.board{border-radius:24px;background:var(--panel);padding:clamp(16px,3vw,40px);container-type:inline-size;transition:background-color .2s}
/* Tinted and clear need a photo behind the glass; the Home Screen dims it, and so does the board, so white captions read. */
.board.glass{background:linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)),#1D4048 url(/shared/wall/web/rambutan.jpg) center/cover}
.board.glass .wgc-it p,.board.glass .wgc-it p span,.board.glass .lockbox p,.board.glass .lockbox p span{color:#fff}
/* One axis on the board: widget rows and the Lock Screen row both centre. */
.wgc-row{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start;justify-content:center}
.wgc-sm{display:contents}
@container (min-width:752px){
  .wgc-row{display:grid;grid-template-columns:repeat(2,364px);gap:24px clamp(24px,100cqw - 728px,48px);justify-content:center}
  .wgc-sm{display:grid;gap:24px;align-content:start}
  .wgc-row>:nth-last-child(2):nth-child(odd):not(:first-child){grid-column:1/-1;justify-self:center}   /* the last widget (the lock row is always last) */
  .wgc-row>.lockrow{grid-column:1/-1;margin-top:0;justify-content:flex-start}}   /* left edge = the first widget column */
@container (min-width:1140px){
  .wgc-row[data-cols="3"]{grid-template-columns:repeat(3,364px);justify-content:space-between;column-gap:0}
  .wgc-row[data-cols="3"]>:nth-last-child(2):nth-child(odd){grid-column:auto;justify-self:auto}   /* same specificity as the 2-column rule above, later: wins */
  .wgc-row[data-cols="3"]>:nth-child(3){grid-row:span 2}   /* extra large spans both rows; the Lock Screen row fills under S, M and L */
  .wgc-row[data-cols="3"]>.lockrow{grid-column:1/3}}
.wgc-it{display:grid;gap:12px}.wgc-it p{font:700 15px/20px var(--sans)}.wgc-it p span{font-weight:500;color:var(--mut);margin-left:8px}
.sc{width:calc(var(--w) * var(--cs,1));height:calc(var(--h) * var(--cs,1))}.sc>div{width:var(--w);transform:scale(var(--cs,1));transform-origin:0 0}
.lockrow{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start;justify-content:center;flex-basis:100%;margin-top:8px;padding-top:24px;border-top:1px solid var(--line)}
.board.glass .lockrow{border-top-color:rgba(255,255,255,.25)}
.lockbox{display:grid;gap:12px;align-content:start}
/* No photo under the accessories: the wallpaper's green at the Lock Screen's 42% dim, so type never lands on a seed. */
.lockbox .pad{display:flex;align-items:center;justify-content:center;min-width:120px;height:108px;padding:16px;border-radius:20px;background:#26332F}
.lockbox .pad.sb{display:block;width:108px;min-width:0;padding:0;overflow:hidden;border-radius:18px;background:#000}
.lockbox p{font:700 15px/20px var(--sans)}.lockbox p span{font-weight:500;color:var(--mut);margin-left:8px}
.data{max-width:72ch}

/* Phone: one dark panel, so one section breaks the white. Heading, then the phone, then its controls on narrow screens. */
.dk{--bg:#000000;--panel:#141414;--line:#333333;--ink:#FFFFFF;--mut:#AFAFAF;--chip:#1F1F1F;--on:#FFFFFF;--on-ink:#000000;--focus:#5B91F5;color:var(--ink);color-scheme:dark}
html.dark .dk{--bg:#141414;--panel:#1F1F1F;--chip:#2A2A2A}
.ph-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr;grid-template-areas:"head phone" "ctl phone";gap:32px 48px;align-items:start;
  padding:clamp(16px,4vw,48px);border-radius:24px;background:var(--bg)}
.ph-head{grid-area:head;margin:0}.ph-ctl{grid-area:ctl;align-self:end}.ph-col{grid-area:phone}
.ph-ctl .live:empty{position:absolute}   /* an empty live region stays in the tree but takes no row or gap */
@media (max-width:420px){.ph{--wz:.52}}   /* before the script sizes it: no sideways scroll at 320 */
.ph{width:calc(490px * var(--wz,.76));height:calc(1000px * var(--wz,.76))}
.ph>div{width:490px;height:1000px;transform:scale(var(--wz,.76));transform-origin:0 0}
.ph.land{width:calc(1000px * var(--wz,.76));height:calc(490px * var(--wz,.76))}.ph.land>div{width:1000px;height:490px}
@media (max-width:860px){.ph-panel{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "phone" "ctl"}.ph-col{justify-self:center}}

/* Films and stills */
.grid{display:grid;grid-template-columns:1fr;gap:24px}
@media (min-width:768px){.grid{grid-template-columns:1fr 1fr}#stillgrid>:first-child{grid-column:1/-1}}   /* nine stills: one wide, then four rows of two */
@media (min-width:1100px){#stillgrid{grid-template-columns:repeat(3,1fr)}#stillgrid>:first-child{grid-column:auto}}
.media{border-radius:var(--r);overflow:hidden;background:var(--panel)}
.media video,.media img,.media .ph0{display:block;width:100%;aspect-ratio:16/9;height:auto;background:var(--panel)}
.media.sq video{aspect-ratio:1;width:min(100%,720px);margin:0 auto}   /* the square X film, centred on its panel */
.media .ph0{display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;color:var(--mut);font:500 15px/20px var(--sans);border-bottom:1px solid var(--line)}
.media figcaption{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 20px;font:700 15px/20px var(--sans)}
.media figcaption .nm{min-width:0;font-weight:700;color:var(--ink);text-wrap:balance}
.media figcaption span{font-weight:500;color:var(--mut)}.media figcaption>span:last-child,.media figcaption a{flex:none;white-space:nowrap}
.media figcaption a{display:inline-block;padding:2px 0;color:var(--mut);font-weight:500;text-underline-offset:3px}   /* 24 px tap target */

/* Footer */
.site-f{border-top:1px solid var(--line);color:var(--mut);font-size:15px;line-height:1.6}
.site-f .wrap{display:grid;gap:12px;padding-top:40px;padding-bottom:64px}
.site-f p{max-width:72ch}
.site-f .by{font-size:17px;color:var(--ink)}
.site-f a{color:var(--ink);text-underline-offset:2px;text-decoration-thickness:1px}
.site-f a:hover{text-decoration-thickness:2px}
.site-f ul{list-style:none;display:grid;gap:0}
.site-f li a{display:inline-block;padding:3px 0}   /* 24 px tap targets */
