/* Kevin Christopherson · Tiles (tiles3d.app)
   Two looks, each taken from its own iPhone app (Kev 11/16):
   - Tiles: black OLED board with a faint navy lift, dark cards with hairline edges, one cyan neon accent, mono eyebrows, quiet dots.
   - UWK: the shipping app's charcoal with the company red trim and SAP yellow on the main action. Scoped to .uwk. */
:root {
  --bg: #000;
  --card: #0A0F17;
  --card-hi: #0F1622;
  --edge: rgba(255, 255, 255, .07);
  --fill: rgba(255, 255, 255, .05);
  --fill-hi: rgba(255, 255, 255, .09);
  --ink: #E8EDF5;
  --ink2: #9AA3B2;
  --ink3: #5F6878;
  --accent: #19E6FF;
  --accent2: #34C3FF;
  --accent-soft: rgba(25, 230, 255, .12);
  --on-accent: #001418;
  --r: 22px;
  --gap: 14px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
.uwk {
  --bg: #1C1D1F; --card: #27292C; --card-hi: #323438; --edge: #45484D; --fill: #27292C; --fill-hi: #323438;
  --ink: #F1EFEA; --ink2: #CAC6BD; --ink3: #9A968E;
  --accent: #E0233F; --accent-soft: rgba(224, 35, 63, .16); --on-accent: #fff; --sap: #F7D24A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: #000; }
body { margin: 0; color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(1200px 600px at 70% -10%, #0B1A2B 0%, rgba(0, 0, 0, 0) 60%), #000; }
body.locked { overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  max-width: var(--max); margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(0, 0, 0, .72); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.mark { width: 26px; height: 26px; flex: none; border-radius: 7px; box-shadow: 0 0 0 1px rgba(25,230,255,.18), 0 0 14px rgba(25,230,255,.18); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink2); padding: 6px 11px; border-radius: 999px; }
.nav a:hover { background: var(--fill); color: var(--ink); }
.ver { font: 500 11px var(--mono); color: var(--ink3); letter-spacing: .04em; }

/* type */
.eyebrow { margin: 0 0 10px; font: 500 12px/1.2 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--ink2); display: flex; align-items: center; gap: 10px; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }
.sec .eyebrow { color: var(--accent); }
h1 { margin: 0; font-size: clamp(40px, 7.4vw, 80px); line-height: 1.0; letter-spacing: -.035em; font-weight: 700; }
.role { margin: 14px 0 0; font: 500 14px var(--mono); letter-spacing: .12em; color: var(--ink2); }
.lede { margin: 20px 0 0; font-size: clamp(17px, 2vw, 20px); line-height: 1.5; color: var(--ink2); max-width: 620px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
.sub { margin: 10px 0 0; font-size: 17px; color: var(--ink2); }

/* hero */
.hero { position: relative; max-width: var(--max); margin: 0 auto; padding: 80px 16px 64px; min-height: 440px; display: flex; align-items: flex-end; }
#dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { position: relative; max-width: 760px; }

/* sections */
.sec { max-width: var(--max); margin: 0 auto; padding: 52px 16px 16px; }
.sec-head { margin: 0 0 24px; max-width: 700px; }
.sec.band { max-width: none; padding: 0; margin-top: 20px; background: var(--bg); border-top: 3px solid var(--accent); }
.band-in { max-width: var(--max); margin: 0 auto; padding: 44px 16px 48px; }

/* the board */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  -webkit-tap-highlight-color: transparent; border-radius: var(--r); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s; }
.tile:active { transform: scale(.98); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.tile.wide { grid-column: span 2; }
.tile .art { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r); overflow: hidden; background: var(--card); width: 100%; display: block; }
.tile.wide .art { aspect-ratio: 2.06 / 1; }
.tile.pic .art img, .tile.card .art img { width: 100%; height: 100%; object-fit: cover; }
.cap { padding: 0 4px; display: flex; flex-direction: column; gap: 1px; }
.cap b { font-weight: 600; font-size: 15px; letter-spacing: -.005em; }
.cap span { font-size: 13.5px; color: var(--ink2); line-height: 1.35; }

/* Tiles cards: the app's showpiece cards, art on top and the title inside */
.tile.card { background: var(--card); border: 1px solid var(--edge); padding: 0 0 14px; gap: 12px; }
.tile.card .art { border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0; background: radial-gradient(80% 70% at 50% 45%, #0B1D2B 0%, #05080D 100%); }
.tile.card .cap { padding: 0 16px; }
.tile.card:hover { border-color: rgba(25, 230, 255, .35); box-shadow: 0 0 0 1px rgba(25, 230, 255, .12), 0 0 32px rgba(25, 230, 255, .10); transform: translateY(-2px); }
.tile.card .art.live { background: #000; }

/* UWK tiles: panels in the shipping app's charcoal, SAP corners */
.uwk .tile .art { border-radius: 8px; background: var(--card); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.uwk .tile:hover .art { background: var(--card-hi); }
.glyph { display: grid !important; place-items: center; }
.glyph svg { width: 40%; height: 40%; max-height: 120px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .glyph svg { transform: scale(1.06); }
.flow { display: flex !important; flex-direction: column; justify-content: center; padding: 6% 5%; gap: 18px; }
.flow-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 10px; border-radius: 6px; background: var(--bg); transition: background .4s, transform .4s; min-width: 0; }
.step b { font-size: 13px; font-weight: 600; }
.step small { font-size: 11px; color: var(--ink2); line-height: 1.25; }
.step.on { background: var(--accent); color: var(--on-accent); transform: translateY(-3px); }
.step.on small { color: rgba(255, 255, 255, .85); }
.step.sap.on { background: var(--sap); color: #1A1A1A; }
.step.sap.on small { color: rgba(0, 0, 0, .65); }
.ico { width: 18px; height: 18px; border-radius: 4px; background: currentColor; opacity: .25; margin-bottom: 6px; }
.step.on .ico { opacity: .9; }
.flow-bar { height: 4px; border-radius: 2px; background: var(--fill-hi); overflow: hidden; }
.flow-bar span { display: block; height: 100%; width: 20%; background: var(--accent); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* footer: the signature, then the tucked tally */
.foot { max-width: var(--max); margin: 56px auto 0; padding: 28px 16px calc(40px + env(safe-area-inset-bottom)); color: var(--ink3); font-size: 13px; border-top: 1px solid var(--edge); }
.sig { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.sig .mark { width: 28px; height: 28px; }
.sig b { display: block; color: var(--ink); font-size: 15px; }
.sig span { font: 500 12px var(--mono); letter-spacing: .06em; }
.sig a { text-decoration: none; color: var(--ink2); }
.tally > summary, .how > summary { cursor: pointer; list-style: none; color: var(--ink3); font-size: 13px; }
.tally > summary::-webkit-details-marker, .how > summary::-webkit-details-marker { display: none; }
.tally > summary::before, .how > summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .2s; }
.tally[open] > summary::before, .how[open] > summary::before { transform: rotate(90deg); }
.tally-in { margin-top: 18px; color: var(--ink2); }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: 16px; }
.nums div { background: var(--card); border: 1px solid var(--edge); border-radius: 18px; padding: 16px; }
.nums b { display: block; font-size: 26px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.nums small { font-size: 12.5px; }
.fine { font-size: 14px; line-height: 1.55; max-width: 760px; }
.how { margin-top: 12px; }
.how dl { margin: 12px 0 0; display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13.5px; max-width: 820px; }
.how dt { font-weight: 600; color: var(--ink2); }
.how dd { margin: 0; }
.credit { margin-top: 26px; }

/* the expanded tile */
.sheet { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column;
  clip-path: inset(var(--t, 0) var(--r2, 0) var(--b, 0) var(--l, 0) round var(--rad, 0px)); }
.sheet.anim { transition: clip-path .5s cubic-bezier(.2, .85, .2, 1); }
.sheet[hidden] { display: none; }
.sheet.uwk { background: #1C1D1F; }
.sheet-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.sheet.uwk .sheet-bar { background: rgba(28, 29, 31, .85); border-bottom: 2px solid var(--accent); }
.sheet.dark .sheet-bar { position: absolute; left: 0; right: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.sheet.dark .sheet-bar h2 { display: none; }
.sheet-bar h2 { font-size: 17px; letter-spacing: -.01em; margin: 0; opacity: 0; transition: opacity .3s .2s; }
.sheet.open .sheet-bar h2 { opacity: 1; }
.close { pointer-events: auto; margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.sheet-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; opacity: 0; transition: opacity .3s .15s; position: relative; }
.sheet.open .sheet-body { opacity: 1; }
.page { max-width: 820px; margin: 0 auto; padding: 18px 16px 80px; }
.page h3 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 44px); line-height: 1.06; letter-spacing: -.03em; }
.page p { font-size: 17.5px; line-height: 1.55; color: var(--ink2); margin: 0 0 16px; }
.page .kick { margin: 6px 0 8px; font: 500 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.page .hero-img { border-radius: var(--r); overflow: hidden; margin: 22px 0 26px; background: var(--card); border: 1px solid var(--edge); }
.page .hero-img img { width: 100%; }
.feat { list-style: none; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.feat li { background: var(--card); border: 1px solid var(--edge); border-radius: 18px; padding: 16px 16px 15px; }
.sheet.uwk .feat li { border-radius: 6px; border: 0; border-left: 3px solid var(--accent); }
.feat b { display: block; font-size: 15.5px; margin-bottom: 3px; color: var(--ink); }
.feat span { font-size: 14.5px; color: var(--ink2); line-height: 1.45; }
.note { font-size: 13.5px !important; color: var(--ink3) !important; }

/* full-page demos */
.demo-stage { position: absolute; inset: 0; }
.demo-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.demo-hud { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 20px calc(26px + env(safe-area-inset-bottom)); pointer-events: none; }
.ph { font: 600 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.big { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 6px; flex-wrap: wrap; }
.big b { font-size: clamp(40px, 8vw, 88px); font-weight: 700; letter-spacing: -.04em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.big small { font: 600 11px var(--mono); letter-spacing: .14em; color: var(--ink2); }
.line { max-width: 640px; font-size: 17px; line-height: 1.45; color: #C9D2DF; min-height: 3em; margin: 0; }
.demo-top { position: absolute; top: calc(64px + env(safe-area-inset-top)); left: 20px; right: 20px; pointer-events: none; }
.demo-top h3 { margin: 0; font-size: clamp(26px, 4.4vw, 40px); letter-spacing: -.03em; color: #fff; }
.demo-top p { margin: 6px 0 0; color: var(--ink2); font-size: 15px; max-width: 560px; }
.demo-tools { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; display: flex; gap: 8px; z-index: 4; }
.chip { border: 1px solid var(--edge); cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .08); color: #fff; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.feather-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* the Educational page: the app's Haptics Lab, on the web */
.edu { max-width: 900px; margin: 0 auto; padding: 8px 16px calc(40px + env(safe-area-inset-bottom)); }
.edu-head h3 { margin: 6px 0 4px; font-size: clamp(28px, 4.6vw, 40px); letter-spacing: -.03em; }
.edu-head p { margin: 0 0 18px; color: var(--ink2); font-size: 16px; }
.seg { display: flex; gap: 6px; padding: 6px; border-radius: 20px; background: #0A0F17; border: 1px solid var(--edge); margin-bottom: 14px; }
.seg button { flex: 1; border: 1px solid transparent; background: none; color: var(--ink2); padding: 10px 8px; border-radius: 15px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seg button svg { width: 26px; height: 26px; fill: currentColor; }
.seg button[aria-pressed="true"] { color: #fff; background: linear-gradient(180deg, #0F4F5A, #0B3740); border-color: rgba(25, 230, 255, .45); box-shadow: 0 0 18px rgba(25, 230, 255, .18); }
.scales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.scales[hidden] { display: none; }
.scale { text-align: left; border: 1px solid var(--edge); background: #0A0F17; color: var(--ink); border-radius: 18px; padding: 14px; cursor: pointer; }
.scale b { display: block; font-size: 18px; }
.scale span { display: block; color: var(--ink2); font-size: 14px; }
.scale em { display: block; margin-top: 6px; font: 600 12px var(--mono); font-style: normal; color: var(--ink3); letter-spacing: .04em; }
.scale[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(25, 230, 255, .2); }
.scale[aria-pressed="true"] em { color: var(--accent); }
.edu-stage { position: relative; height: min(56vh, 520px); min-height: 320px; border-radius: 22px; overflow: hidden; border: 1px solid var(--edge); background: #000; }
.edu-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.edu-stage .tag { position: absolute; top: 14px; left: 14px; padding: 8px 12px; border-radius: 12px; background: rgba(10, 15, 23, .85); font: 600 12px var(--mono); letter-spacing: .18em; color: var(--accent); }
.edu-stage .rd { position: absolute; top: 14px; right: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(10, 15, 23, .85); text-align: right; }
.edu-stage .rd b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.1; }
.edu-stage .rd small { font: 600 10.5px var(--mono); letter-spacing: .14em; color: var(--ink2); }
.edu-read { margin-top: 14px; }
.edu-read .line { color: var(--ink2); }
.edu-tools { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.play { flex: 1; min-width: 200px; border: 0; cursor: pointer; padding: 15px 18px; border-radius: 18px; background: #fff; color: #000; font-size: 17px; font-weight: 700; }
.feelbtn { border: 1px solid var(--edge); cursor: pointer; padding: 15px 18px; border-radius: 18px; background: #0A0F17; color: #fff; font-size: 15px; font-weight: 600; }
.feelbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.soon { margin-top: 14px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: #0A0F17; border: 1px solid var(--edge); }
.soon b { color: var(--ink); display: block; font-size: 15px; }
.soon span { color: var(--ink2); font-size: 14px; }
.soon i { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #F2B544; box-shadow: 0 0 10px #F2B544; }
.hsw { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }

/* gallery */
.gal { columns: 3 260px; column-gap: var(--gap); }
.gal figure { margin: 0 0 var(--gap); break-inside: avoid; }
.gal img { width: 100%; height: auto; border-radius: 14px; background: var(--card); cursor: zoom-in; }
.gal figcaption { font-size: 12.5px; color: var(--ink3); margin: 6px 2px 0; }
.zoom { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .94); display: grid; place-items: center; cursor: zoom-out; }
.zoom img { max-width: 100vw; max-height: 100vh; object-fit: contain; }

/* personal entry pages (tiles3d.app/hi/<name>): the board waits behind the intro */
html.entry body > *:not(#entry):not(script) { visibility: hidden; }
#entry { position: fixed; inset: 0; z-index: 100; background: #000; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-row { gap: 5px; }
  .step { padding: 9px 6px; }
  .step small { display: none; }
  .step b { font-size: 11.5px; }
  .ico { width: 14px; height: 14px; margin-bottom: 4px; }
  .ver { display: none; }
}
@media (max-width: 560px) {
  :root { --gap: 12px; --r: 20px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .hero { padding-top: 44px; min-height: 380px; }
  .tile.wide .art { aspect-ratio: 1.55 / 1; }
  .uwk .tile.wide:not(.uwk-hero) .art { aspect-ratio: 2.4 / 1; }
  .feat { grid-template-columns: 1fr; }
  .nums { grid-template-columns: 1fr; }
  .how dl { grid-template-columns: 1fr; gap: 2px; }
  .how dd { margin-bottom: 8px; }
  .scales { gap: 8px; }
  .scale { padding: 11px; }
  .scale b { font-size: 15px; }
  .scale span { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.edu { padding-top: calc(64px + env(safe-area-inset-top)) !important; }

/* Tiles icon pack (Kev 11/16): the iOS app's isometric cube icons on tiles, eyebrows and buttons.
   Files live in /img/tiles/<name>.webp; finer-cube versions drop in under the same names. */
.tile.card .art.icon { background: #05080D; }
.tile.card .art.icon img { object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.tile.card:hover .art.icon img, .tile.card:focus-visible .art.icon img { transform: scale(1.05); filter: brightness(1.15) drop-shadow(0 0 18px rgba(25,230,255,.25)); }
.eyebrow .ico { width: 24px; height: 24px; border-radius: 6px; background: #05080D; box-shadow: 0 0 0 1px var(--edge); }
.play, .feelbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.play::before, .feelbtn::before { content: ""; width: 26px; height: 26px; border-radius: 7px; flex: none; background: #05080D center / cover no-repeat; }
.play::before { background-image: url(/img/tiles/storm-sm.webp); }
.feelbtn::before { background-image: url(/img/tiles/haptics-sm.webp); }
.seg .ico { width: 28px; height: 28px; border-radius: 7px; display: block; margin: 0 auto 2px; }
.eyebrow .ico { width: 28px; height: 28px; }
