:root {
  --bg: #fafaf9;
  --text: #1e1e1e;
  --tertiary: #b3b3b3;
  --card: #f2f2f2;
  --brand: #2c2c2c;
  --on-brand: #f3f3f3;
  --stroke: #d4d4d8;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/normal "IBM Plex Mono", ui-monospace, monospace;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }

.intro {
  position: fixed; inset: 0; width: 100%; overflow: hidden;
  background: #0e0e0e;
  z-index: 10;
}
/* the big pixel mark scales with the window. Desktop (Figma 1512 x 982): 1400 wide at left 56, 200px below the bottom edge. Phones (390 x 844): turned a quarter turn, half off the left edge */
.intro-logo { position: absolute; left: 3.704vw; bottom: -13.245vw; width: 92.593vw; height: auto; opacity: .2; transform-origin: 50% 50%; transition: opacity .15s ease, transform .32s cubic-bezier(.3, 1.6, .5, 1); will-change: transform; }
.intro-logo:hover { opacity: 1; transform: scale(1.05); }
.intro-logo:active { transform: scale(1.02); transition-duration: .12s; }
.intro-logo { cursor: pointer; }
.intro-logo:focus-visible { opacity: 1; transform: scale(1.05); outline: none; }
/* phones: a fixed size (Figma 390 x 844: 560 long, turned, 80px off the left edge, 40px above the bottom), so it doesn't grow on wider phones */
@media (max-width: 599.98px) { .intro-logo { left: -206.55px; bottom: 166.55px; width: 560px; rotate: 90deg; } }
.intro-logo img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .intro-logo { transition: opacity .15s; } .intro-logo:hover { transform: none; } }
.intro.leaving { opacity: 0; transition: opacity .3s; }
body.splash { background: #0e0e0e; }

.page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.stack { width: 302px; display: flex; flex-direction: column; gap: 40px; align-self: center; }
.line { display: flex; align-items: center; gap: 8px; }
.intro-text em { font-style: italic; }
.dotted { text-decoration: underline dotted; text-decoration-thickness: 9%; text-underline-position: from-font; text-decoration-skip-ink: none; }

.tabs { display: flex; gap: 16px; }
.tabs button, .tabs a { color: var(--tertiary); text-decoration: none; transition: color .15s; }
.tabs button, .tabs a { position: relative; }
.tabs .active { color: var(--text); }
.tabs button::after, .tabs a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  border-bottom: 1px dotted #303030; opacity: 0; transition: opacity .15s ease;
}
.tabs button:hover::after, .tabs a:hover::after { opacity: 1; }
.panels { display: grid; margin-top: -40px; height: 0; transition: height .45s cubic-bezier(.2, .8, .2, 1); }
.panel {
  grid-area: 1 / 1; align-self: start; margin-top: 12px;
  opacity: 0; transform: translateY(6px); visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, transform .45s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
}
.panel.is-active { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: .08s, .08s, 0s; }
@media (prefers-reduced-motion: reduce) { .panels, .panel { transition: none; } }

.hover-bubble { position: relative; display: inline-flex; align-items: center; height: 18px; }
.akat { width: 34px; }
.akat > img { position: absolute; }
.akat-shadow { left: 1.75px; top: 1.2px; width: 32.2px; height: 16.7px; }
.akat-front { left: .14px; top: .14px; width: 32px; height: 16.5px; }
/* each bubble's tail is centred on its hover target (--tail = how far across the bubble the tail sits) */
.bubble { --tail: 50%; position: absolute; left: 50%; bottom: 100%; margin-bottom: 2px; opacity: 0; transform: translate(calc(-1 * var(--tail)), 4px) scale(.96); transform-origin: var(--tail) 100%; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 5; }
.bubble img { display: block; }
.bubble-cn { --tail: 50%; }
.bubble-cn img { width: 164px; }
.bubble-akat { margin-bottom: 6.9px; }
.bubble-akat img { width: 164.3px; height: auto; }
.hover-bubble:hover .bubble { opacity: 1; transform: translate(calc(-1 * var(--tail)), 0); }

/* the page never scrolls; Work and Playground scroll sideways on their own, from the text column to the viewport edge */
html, body { overflow: hidden; }
:root { --col: calc(50vw - 151px); }
.panel-work, .panel-playground {
  position: relative; display: flex; gap: 8px;
  width: 100vw; margin-left: calc(-1 * var(--col));
  padding-left: var(--col); padding-right: var(--col); scroll-padding-left: var(--col); scroll-padding-right: var(--col);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.panel-work::-webkit-scrollbar, .panel-playground::-webkit-scrollbar { display: none; }
.panel-work { padding-bottom: 56px; margin-bottom: -56px; }
.cell, .card { text-decoration: none; color: inherit; }
.cell { position: relative; width: 135px; height: 100px; flex: none; display: grid; place-items: center; background: var(--card); border-radius: 4px; overflow: hidden; }
.cell::after, .card::after {
  content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none; z-index: 1;
  border: 1px dotted #303030; opacity: 0; transition: opacity .15s ease;
}
.cell:hover::after, .card:hover::after { opacity: 1; }
.cell.dark { background: var(--text); }
.cell img { display: block; width: 135px; height: 100px; }
.cell.dark img { width: 80px; height: auto; }
.tip { position: absolute; top: calc(100% - 48px); left: 0; transform: translate(-50%, 4px); display: flex; flex-direction: column; align-items: center; pointer-events: none; opacity: 0; transition: opacity .18s ease, transform .25s cubic-bezier(.2, .8, .2, 1), left .25s cubic-bezier(.2, .8, .2, 1); z-index: 2; }
.tip.show { opacity: 1; transform: translate(-50%, 0); }
.tip-arrow { position: relative; display: block; width: 16px; height: 16px; margin-bottom: -7px; }
.tip-arrow img { position: absolute; display: block; }
.tip-stroke { z-index: 0; left: 9%; right: 9%; top: 5%; width: 13.12px; height: 12px; }
.tip-fill { z-index: 2; left: 14%; top: 10%; width: 11.52px; height: 10.4px; }
.tip-body { position: relative; z-index: 1; display: block; background: #fff; border: 1px solid var(--stroke); border-radius: 4px; padding: 6px 8px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

.card { position: relative; flex: none; width: 233px; background: var(--card); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.card h3 { font: inherit; line-height: 18px; }
.card p { color: var(--tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; line-height: 18px; }
.tags { display: flex; gap: 4px; margin-top: 12px; }
.tags span { background: var(--text); color: #e3e3e3; border-radius: 2px; padding: 6px; font: 500 10px/7px "IBM Plex Mono", monospace; text-transform: uppercase; }

.panel-connect { display: flex; }
.email { height: 42px; padding: 12px; background: var(--card); border: 1px dotted #767676; border-right: 0; border-radius: 2px 0 0 2px; display: flex; align-items: center; }
.copy { height: 42px; padding: 12px; background: var(--text); color: var(--on-brand); border-radius: 0 2px 2px 0; text-transform: uppercase; }

/* overflowing rows scroll sideways on narrow screens */
.stack { overflow: visible; }
@media (max-width: 400px) {
  .stack { width: 100%; }
  :root { --col: 16px; }
}

/* footer ticker (Figma 1512 wide, 48 tall): at the top of the splash, at the bottom of the home page */
.site-footer { position: fixed; left: 0; right: 0; bottom: 16px; z-index: 11; height: 48px; overflow: hidden; opacity: .2; color: #fff; pointer-events: none; user-select: none; view-transition-name: site-footer; }
.splash .site-footer { top: 24px; bottom: auto; }
@media (max-width: 599.98px) { .splash .site-footer { top: 16px; } }
.site-footer.on-light { filter: invert(1); }
.f-track { display: flex; width: max-content; height: 100%; animation: f-tick var(--tick, 30s) linear infinite; will-change: transform; }
.f-set { display: flex; align-items: center; gap: 24px; padding-right: 24px; flex: none; }
@keyframes f-tick { to { transform: translateX(calc(-1 * var(--set, 50%))); } }
@media (prefers-reduced-motion: reduce) { .f-track { animation: none; } }
.site-footer img { display: block; flex: none; }
.f-group { display: flex; align-items: center; flex: none; }
.f-akat { gap: 8px; }
.f-akat-mark { position: relative; width: 75.51px; height: 40px; flex: none; }
.f-akat-mark img { position: absolute; max-width: none; }
.f-shadow { left: 3.88px; top: 2.66px; width: 71.63px; height: 37.14px; }
.f-front { left: -0.2px; top: -0.2px; width: 72.2px; height: 37.69px; }
.f-kit { gap: 8px; }
.f-handle { display: flex; flex-direction: column; align-items: flex-start; font: 500 18px/1.3 "Geist Mono", ui-monospace, monospace; color: inherit; text-transform: uppercase; white-space: nowrap; }
.f-handle p { margin: 0; }
.f-braille { margin-top: 4px; align-self: flex-start; }
.f-wip { font: 500 16px/normal "IBM Plex Mono", ui-monospace, monospace; color: inherit; text-transform: uppercase; white-space: nowrap; flex: none; }
.f-wip-row { display: flex; gap: 0 8px; margin: 0; }
.f-wip-row + .f-wip-row { gap: 0; }

/* splash -> home: the background stays and fades to the home colour, the pixel logo drops away, the text scrolls in from above and the footer slides from the top to the bottom (the reverse on the way back) */
@view-transition { navigation: auto; }
.intro-logo { view-transition-name: splash-logo; }
@keyframes vt-logo-down { to { transform: translateY(100%); } }
@keyframes vt-logo-up { from { transform: translateY(100%); } }
::view-transition-group(root), ::view-transition-group(site-footer), ::view-transition-group(splash-logo) { animation-duration: .8s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
/* the intro text and tabs scroll in from above as the logo drops away (and back out upwards on the way back) */
.stack { view-transition-name: home-content; }
@keyframes vt-content-in { from { transform: translateY(-100vh); } }
@keyframes vt-content-out { to { transform: translateY(-100vh); } }
::view-transition-group(home-content) { animation-duration: .8s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
::view-transition-new(home-content) { animation: vt-content-in .8s cubic-bezier(.65, 0, .35, 1) both; }
::view-transition-old(home-content) { animation: vt-content-out .8s cubic-bezier(.65, 0, .35, 1) both; }
::view-transition-old(splash-logo) { animation: vt-logo-down .8s cubic-bezier(.65, 0, .35, 1) both; }
::view-transition-new(splash-logo) { animation: vt-logo-up .8s cubic-bezier(.65, 0, .35, 1) both; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .01s !important; } }

/* the logos are buttons, not pictures to drag out of the page */
.intro, .intro-logo, .intro-logo img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }

/* no blue flash when tapping links and buttons on phones */
html, a, button, img { -webkit-tap-highlight-color: transparent; }

/* project pages switched off in the editor: tiles and cards look the same but show a no-entry cursor */
.cell.locked, .card.locked { cursor: not-allowed; }

/* 404 page: the splash logo, not clickable, with a short message and a way home along the top */
.lost .intro-logo { cursor: default; }
.lost .intro-logo:hover { opacity: .2; transform: none; }
.lost-bar { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.lost-bar p { margin: 0; color: #f5f5f5; font: 400 14px/18px "IBM Plex Mono", ui-monospace, monospace; }
.lost-btn { padding: 12px; background: #fff; color: #303030; border-radius: 2px; font: 500 14px/18px "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; text-decoration: none; transition: background .15s ease; }
.lost-btn:hover, .lost-btn:focus-visible { background: #e6e6e6; outline: none; }
