/* The homepage's iPhone OS status bar and terminal type, for the Play pages.
   index.html still carries its own copy; keep the two in step. */
:root {
  color-scheme: dark;
  --bar: clamp(34px, 1.8vw + 26px, 52px);   /* status bar height */
  --top: calc(var(--bar) + env(safe-area-inset-top, 0px));
  --bar-grey: #dfe6e9;                       /* status bar grey */
  --bar-top: #f8fafd;                        /* the bar's top edge; everything drawn above it matches */
  --ink: #000;
  --carrier: #525252;
  --emboss: rgba(255, 255, 255, .75);
  --screen: #000;
  --phosphor: #5ec640;                       /* terminal green */
  --phosphor-faint: rgba(94, 198, 64, .4);
  --phosphor-mid: rgba(94, 198, 64, .7);
  --cursor: #2355a6;
  --select-top: #3d8cf2;                     /* iPhone OS list selection */
  --select-bottom: #1360e0;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --deva: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Mangal", sans-serif;
  --term-size: clamp(18px, 3.1vw + 6px, 46px);   /* the homepage terminal's type size */
  --gutter: max(16px, 3vw);
}
*, *::before, *::after { box-sizing: border-box; }
@media (hover: none) { :root { --bar-top: var(--bar-grey); } }   /* phones start the bar in its grey */
html { background: var(--bar-top); }   /* shows above the bar when the page is pulled down */
body { margin: 0; background: var(--screen); color: var(--phosphor); }
body::before {   /* black behind the page's bottom half: a pull past the end uncovers this, not the grey */
  content: ""; position: fixed; z-index: -1; inset: 50% 0 0;
  background: var(--screen);
}
[hidden] { display: none !important; }

/* ───────────── Status bar ───────────── */
.statusbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--top);
  padding: env(safe-area-inset-top, 0px) max(16px, 1.2vw) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font: 700 calc(var(--bar) * .5)/1 var(--sans);
  color: var(--ink);
  text-shadow: 0 1px 0 var(--emboss);
  background: linear-gradient(to bottom,
    var(--bar-top) 0%, #eef3f5 30%, var(--bar-grey) 62%, #c8cfd2 calc(100% - 4px),
    #9aa1a5 calc(100% - 4px), #76787e calc(100% - 3px),
    #4a4a4f calc(100% - 2px), #1c1c1e 100%);
  background-color: var(--bar-top);   /* Safari 26 tints the strip behind the clock from this */
  user-select: none; -webkit-user-select: none;
}
@media (hover: none) {   /* phones draw a solid strip above the bar, so the bar starts in its grey */
  .statusbar {
    background-image: linear-gradient(to bottom,
      var(--bar-grey) 62%, #c8cfd2 calc(100% - 4px),
      #9aa1a5 calc(100% - 4px), #76787e calc(100% - 3px),
      #4a4a4f calc(100% - 2px), #1c1c1e 100%);
  }
}
.sb-left, .sb-right { display: flex; align-items: center; gap: .45em; }
.sb-right { justify-content: flex-end; position: relative; gap: .375em; }

.carrier {
  all: unset; cursor: pointer; border-radius: .2em;
  position: relative; top: .04em;
  font-family: var(--deva); font-weight: 600; font-size: .98em;
  color: var(--carrier); line-height: 1; white-space: nowrap;
}
.carrier:focus-visible { outline: 2px solid var(--select-bottom); outline-offset: 2px; }
.carrier:lang(en) {   /* the spelled-out sound, in the carrier-name Helvetica */
  top: 0; font-family: var(--sans); font-weight: 700; font-size: .9em; letter-spacing: -.01em;
}
.logo-btn {
  all: unset; cursor: pointer; display: grid; place-items: center; flex: none;
  border-radius: .2em; perspective: 4em;
}
.logo-btn:focus-visible { outline: 2px solid var(--select-bottom); outline-offset: 2px; }
.logo { width: 1.3em; height: 1.3em; display: block; filter: drop-shadow(0 1px 0 var(--emboss)); }
.swap-in { animation: swap-in .32s ease-out; }
@keyframes swap-in { from { transform: rotateY(90deg); opacity: .3; } to { transform: none; opacity: 1; } }
.clock-btn {
  all: unset; cursor: pointer; display: grid; place-items: center;
  width: 1.1em; height: 1.1em; border-radius: 50%;
}
.clock-btn svg { width: .95em; height: .95em; display: block; filter: drop-shadow(0 1px 0 var(--emboss)); }
.clock-btn:hover svg { filter: drop-shadow(0 1px 0 var(--emboss)) brightness(.88); }
.clock-btn:focus-visible { outline: 2px solid var(--select-bottom); outline-offset: 2px; }
.clock-btn[aria-expanded="true"] svg { filter: drop-shadow(0 0 3px rgba(61, 140, 242, .9)); }

/* Clock dropdown */
.menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 20;
  width: min(290px, calc(100vw - 32px));
  padding: 6px; border-radius: 12px;
  font: 700 15px/1.25 var(--sans); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .6);
  background: linear-gradient(rgba(70, 77, 86, .97), rgba(24, 27, 32, .97) 44px);
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  user-select: text; -webkit-user-select: text;
}
.menu::before {
  content: ""; position: absolute; top: -7px;
  right: calc(var(--bar) * .275 - 6px);   /* centred under the clock (half its 1.1em width) */
  width: 12px; height: 12px; transform: rotate(45deg);
  background: rgb(70, 77, 86);
  border-top: 1px solid rgba(255, 255, 255, .3); border-left: 1px solid rgba(255, 255, 255, .3);
}
.zones { display: grid; gap: 2px; padding: 6px 8px 10px; }
.zone { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; }
.zone-name { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .62); letter-spacing: .04em; text-transform: uppercase; }
.zone-time { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.zone-note { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .7); margin-top: -2px; }
.zone + .zone { padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 6px; }
.menu-items { list-style: none; margin: 0; padding: 4px 0 0; border-top: 1px solid rgba(255, 255, 255, .16); display: grid; gap: 1px; }
.menu-items a {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 10px; border-radius: 7px;
}
.menu-items a:hover, .menu-items a:focus-visible { background: linear-gradient(var(--select-top), var(--select-bottom)); }

/* ───────────── Terminal type ───────────── */
/* The homepage's Trinitron look: phosphor glow, colour fringe, and the aperture grille multiplied
   into the lettering only, so photos beside it stay clean. */
.crt {
  position: relative;
  text-shadow:
    0 0 .07em color-mix(in srgb, currentColor 70%, transparent),
    0 0 .45em color-mix(in srgb, currentColor 40%, transparent),
    -.035em 0 rgba(255, 40, 90, .45), .035em 0 rgba(40, 150, 255, .45);
  text-shadow:   /* the same, with the fringe as faint as the text it's on, where supported */
    0 0 .07em color-mix(in srgb, currentColor 70%, transparent),
    0 0 .45em color-mix(in srgb, currentColor 40%, transparent),
    -.035em 0 rgb(from currentColor 255 40 90 / calc(alpha * .45)),
    .035em 0 rgb(from currentColor 40 150 255 / calc(alpha * .45));
}
.crt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: multiply;
  background: repeating-linear-gradient(to right, #ffb4b4 0 1px, #b4ffb4 1px 2px, #b4b4ff 2px 3px) fixed;
}
.cursor {
  display: inline-block; width: .27em; height: 1.04em;
  vertical-align: -.2em; background: var(--cursor);
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

/* "Play: Modeling", where the homepage has "Work: Play" */
.crumb {
  margin: 0; padding: calc(var(--top) + .55em) var(--gutter) 0;
  font: 400 var(--term-size)/1.18 var(--mono);
}
.crumb a { color: var(--phosphor-faint); text-decoration: none; transition: color .15s ease; }
.crumb a:hover { color: var(--phosphor-mid); }
.term-btn { all: unset; cursor: pointer; color: var(--phosphor-faint); transition: color .15s ease; }
.term-btn:hover { color: var(--phosphor); }
.crumb a:focus-visible, .term-btn:focus-visible { outline: 2px solid var(--cursor); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .cursor, .logo { animation: none !important; }
}
