:root { --c1: #a98ad3; --c2: #4e3480; --s: 1; }
* { box-sizing: border-box; margin: 0; }
/* no grey tap box on phones (read as a border around the glowing icons) */
* { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: 'Noto Sans', system-ui, sans-serif; font-weight: 300; color: #fff;
  background: var(--c2); touch-action: none; user-select: none;
}
/* touch-action on an ancestor caps every descendant, so the glance page can only scroll
   on phones if body lets go while it's open */
body.reading { touch-action: pan-y; }

#bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 78% 0%, rgb(255 255 255 / .1), transparent 70%),
    linear-gradient(165deg, var(--c1), var(--c2));
  transition: background .6s;
}
#wave { position: absolute; inset: 0; width: 100%; height: 100%; }

.cat, .item {
  position: absolute; left: 0; top: 0; cursor: pointer;
  margin: calc(var(--i) / -2) 0 0 calc(var(--i) / -2);
  transform-origin: calc(var(--i) / 2) 50%;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), opacity .28s;
}
.cat { --i: calc(115px * var(--s)); }
.item { --i: calc(100px * var(--s)); display: flex; align-items: center; gap: calc(50px * var(--s)); }
/* like the console, only the selected item shows its label */
.item > div { opacity: 0; transition: opacity .28s; }
.item.on > div { opacity: 1; }
.cat svg, .item svg {
  display: block; flex: none; width: var(--i); height: var(--i); fill: rgb(255 255 255 / .92); overflow: visible;
  filter: drop-shadow(0 0 calc(5px * var(--s)) rgb(255 255 255 / .45)) drop-shadow(0 1px 2px rgb(0 0 0 / .25));
}
.cat span {
  position: absolute; top: 108%; left: 50%; transform: translateX(-50%);
  font-size: max(12px, calc(22px * var(--s))); white-space: nowrap; opacity: 0; transition: opacity .28s;
  text-shadow: 0 0 6px rgb(255 255 255 / .5);
}
.cat.on span { opacity: 1; }
.item b {
  display: block; font-weight: 400; font-size: calc(34px * var(--s)); white-space: nowrap;
  text-shadow: 0 0 8px rgb(255 255 255 / .35), 0 1px 2px rgb(0 0 0 / .3);
}
.item small { display: block; font-size: max(12px, calc(19px * var(--s))); opacity: 0; transition: opacity .28s; white-space: nowrap; }
.item.on small { opacity: .85; }
.item.on b { text-shadow: 0 0 10px rgb(255 255 255 / .8), 0 1px 2px rgb(0 0 0 / .3); }

#clock {
  /* flush with the right edge, like the PS3 status bar */
  position: fixed; top: 7vh; right: 0; width: 31vw; padding-right: max(6.5vw, env(safe-area-inset-right));
  font-size: max(13px, calc(30px * var(--s))); line-height: max(26px, calc(56px * var(--s))); text-align: right; letter-spacing: .03em;
  border: 1px solid rgb(255 255 255 / .55); border-right: 0; border-radius: 3px 0 0 3px;
  background: linear-gradient(rgb(255 255 255 / .18), rgb(255 255 255 / .04));
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---- boot ---- */
#black { position: fixed; inset: 0; background: #000; transition: opacity .7s ease; pointer-events: none; }
#black.gone { opacity: 0; }
#xmb, #clock { transition: opacity 1.2s ease; }
.booting #xmb, .booting #clock, .booting #hint, .booting #pick { opacity: 0; pointer-events: none; }
#logo, #notice { position: fixed; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
#logo.show, #notice.show { opacity: 1; }
/* name sits on the wave in the right third, like the PS3 logo */
#logo { right: 6vw; top: 50%; transform: translateY(-50%); text-align: center; }
#logo b {
  display: block; font-weight: 300; font-size: clamp(26px, 3.4vw, 72px); letter-spacing: .06em;
  text-shadow: 0 0 18px rgb(255 255 255 / .35);
}
#logo small { display: block; font-size: clamp(12px, 1.1vw, 22px); opacity: .85; margin-top: .3em; }
#notice {
  left: 16%; right: 16%; top: 47%; text-transform: uppercase; font-weight: 400;
  font-size: clamp(13px, 1.45vw, 26px); line-height: 1.5; text-shadow: 0 1px 3px rgb(0 0 0 / .5);
}
#notice b { font-weight: 400; display: block; }

/* ---- upright phones: one clean column, all items labeled, glow marks the selection ---- */
.tall .item > div { width: calc(67vw - 100px * var(--s) - 16px); }
.tall .item > div { opacity: .85; }
.tall .item.up > div { opacity: 0; }
.tall .item.on > div { opacity: 1; }
.tall .item b { font-size: 5.4vw; white-space: normal; }
.tall .item small { display: none; font-size: 3.4vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tall .item.on small { display: block; }
.tall .cat span { font-size: 3.6vw; }
.tall .item.on svg, .tall .cat.on svg {
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 12px rgb(170 200 255 / .9)) drop-shadow(0 2px 3px rgb(0 0 0 / .4));
}
.tall #logo, .tall #notice { top: 42%; }
.tall #logo { left: 0; right: 0; }
.tall #logo b { font-size: 8vw; }
.tall #notice { left: 8%; right: 8%; }

/* ---- options list (PS3 Theme Settings style) ---- */
.deep .item > div, .deep .cat span { opacity: 0 !important; }
#arrow, .row { position: absolute; left: 0; top: 0; transition: transform .28s cubic-bezier(.2, .7, .3, 1), opacity .28s; }
#arrow { --a: calc(26px * var(--s)); width: var(--a); height: var(--a); margin: calc(var(--a) / -2) 0 0 calc(var(--a) / -2); cursor: pointer; }
#arrow svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 0 4px rgb(255 255 255 / .6)); }
#sub { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; }
.deep #sub { opacity: 1; pointer-events: auto; }
.row { --d: calc(24px * var(--s)); display: flex; align-items: flex-start; cursor: pointer; margin-top: calc(var(--d) / -2); }
.row > i {
  flex: none; width: var(--d); height: var(--d); border-radius: 50%; margin-top: calc(6px * var(--s));
  background: radial-gradient(circle, transparent 0 28%, rgb(255 255 255 / .9) 30%);
  filter: drop-shadow(0 0 3px rgb(255 255 255 / .5));
}
.row > div { margin-left: calc(var(--lx) - var(--d)); transition: opacity .25s; }
.row b {
  display: block; font-weight: 300; font-size: calc(32px * var(--s)); white-space: nowrap; opacity: .78;
  text-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: opacity .2s;
}
.row.on b { font-weight: 400; font-size: calc(36px * var(--s)); opacity: 1; text-shadow: 0 0 10px rgb(255 255 255 / .8), 0 1px 2px rgb(0 0 0 / .3); }
.row small { display: none; max-width: var(--dw); font-size: max(12px, calc(19px * var(--s))); line-height: 1.35; opacity: .9; }
.row.on small { display: block; }
.row .val {
  position: absolute; left: var(--vx); top: calc(10px * var(--s)); font-style: normal; white-space: nowrap;
  font-size: calc(22px * var(--s)); opacity: .55;
}
.row.on .val { opacity: 1; font-weight: 400; }
/* picker open: only the active row keeps its label */
.picking .row:not(.on) > div, .picking .row .val { opacity: 0; }

/* ---- picker strip on the right ---- */
#pick {
  position: fixed; top: 0; bottom: 0; left: 69vw; right: 0; overflow: hidden;
  background: linear-gradient(90deg, rgb(255 255 255 / .2), rgb(255 255 255 / .08));
  border-left: 1px solid rgb(255 255 255 / .4);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}
#pick.open { transform: none; }
.opt {
  position: absolute; left: 2.2vw; top: 0; display: flex; align-items: center; gap: 1vw; cursor: pointer;
  height: calc(30px * var(--s)); margin-top: calc(-15px * var(--s)); font-size: calc(24px * var(--s)); white-space: nowrap;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1);
}
.opt i { flex: none; width: calc(24px * var(--s)); height: calc(24px * var(--s)); border: 2px solid rgb(255 255 255 / .85); border-radius: 2px; filter: brightness(1.6) saturate(1.2); }
.opt span { opacity: .7; }
.opt.sw span { opacity: 0; }
.opt.on span { opacity: 1; font-weight: 400; text-shadow: 0 0 8px rgb(255 255 255 / .8); }
.opt.on i { box-shadow: 0 0 0 2px #fff, 0 0 12px #fff; }

/* upright phones: values sit under the label, fonts track the width */
.tall .row b { font-size: 5vw; }
.tall .row.on b { font-size: 5.4vw; }
.tall .row small { font-size: 3.4vw; }
.tall .row .val { position: static; display: block; font-size: 3.8vw; margin-top: 2px; }
.tall #pick { left: 58vw; }
.tall .opt { font-size: 4.4vw; height: 7vw; margin-top: -3.5vw; left: 4vw; gap: 3vw; }
.tall .opt i { width: 5.5vw; height: 5.5vw; }
/* inside a list the rows above would run under the clock box */
.deep #clock { opacity: 0; }
.tall.picking .row small { opacity: 0; }

#skip {
  position: fixed; left: 0; right: 0; bottom: 6vh; text-align: center; pointer-events: none;
  font-size: max(12px, calc(18px * var(--s))); letter-spacing: .04em; opacity: 0; transition: opacity 1s;
}
.intro #skip { opacity: .5; } /* only while the reveal is playing */

/* ---- At a Glance: the whole site as one readable page ---- */
#plain.glance {
  position: fixed; inset: 0; z-index: 10; isolation: isolate; width: auto; height: auto; clip-path: none; overflow-y: auto; outline: none;
  padding: max(56px, 8vh) max(20px, 9vw) 72px; line-height: 1.55;
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
/* the blur lives on its own fixed layer: Safari (iPhone) draws nothing inside an element
   that both scrolls and has a backdrop-filter, so the scrolling page itself stays plain */
#plain.glance::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: rgb(8 4 16 / .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#glance-close {
  /* quiet way into the XMB, where a close button would be */
  display: none; position: fixed; top: 16px; right: 16px; z-index: 2; cursor: pointer;
  padding: 6px 14px; border-radius: 16px; font: inherit; font-size: 14px; letter-spacing: .03em; color: #fff;
  border: 1px solid rgb(255 255 255 / .3); background: rgb(20 10 30 / .6); opacity: .8; transition: opacity .2s, background .2s;
}
#glance-close:hover { opacity: 1; background: rgb(255 255 255 / .12); }
.glance #glance-close { display: block; }

/* PS3-style button hints, bottom right */
#hint {
  position: fixed; right: max(4vw, env(safe-area-inset-right)); bottom: max(5vh, env(safe-area-inset-bottom)); pointer-events: none;
  padding: .35em .9em; font-size: max(12px, calc(19px * var(--s))); white-space: nowrap; transition: opacity .6s;
  border: 1px solid rgb(255 255 255 / .35); border-radius: 3px; background: rgb(0 0 0 / .18);
}
#hint b { font-weight: 400; margin-left: 1.1em; margin-right: .4em; padding: 0 .4em; border-radius: 3px; background: rgb(255 255 255 / .16); }
#hint b:first-child { margin-left: 0; }
.picking #hint { opacity: 0; } /* the picker strip covers that corner */


/* auto-preview under the selected item: overview + pinned facts, fades in once you settle */
.item > div { position: relative; }
.pvbox {
  position: absolute; top: 100%; left: 0; margin-top: calc(10px * var(--s)); width: min(44vw, calc(760px * var(--s)));
  white-space: normal; pointer-events: none; opacity: 0; transition: opacity .2s;
}
.item.on .pvbox { opacity: 1; transition: opacity .3s .15s; }
.pvbox .pv {
  font-size: max(12px, calc(19px * var(--s))); line-height: 1.4; opacity: .88;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pvbox .facts { margin-top: calc(6px * var(--s)); font-size: max(12px, calc(18px * var(--s))); font-weight: 400; }
/* upright phones: room for the facts line only */
.tall .pvbox { width: calc(67vw - 100px * var(--s) - 16px); margin-top: 4px; }
.tall .pvbox .pv { display: none; }
.tall .pvbox .facts { font-size: 3.4vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
/* portrait: the bottom is the column's, so the hint sits top-left (the clock has top-right) */
.tall #hint { right: auto; bottom: auto; left: 16px; top: 7vh; } /* level with the clock */
/* inside a list the clock is hidden, so the hint takes its corner instead of covering values */
.deep #hint { bottom: auto; top: 7vh; }


/* ---- At a Glance: resume format ---- */
#plain.glance > * { max-width: 760px; margin-left: auto; margin-right: auto; }
#plain.glance { padding-top: max(36px, 5vh); }
#plain h1 { font-weight: 300; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: .02em; text-shadow: 0 0 14px rgb(255 255 255 / .3); }
#plain .tag { font-size: 16px; margin-top: 4px; opacity: .92; }
#plain .links { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 15px; }
#plain .links a { text-decoration: underline; text-decoration-color: rgb(255 255 255 / .4); text-underline-offset: 3px; }
#plain .sub { font-size: 14px; opacity: .72; font-style: italic; }
/* the 5 summary lines: labels down the left edge, one or two lines each */
#plain .hl { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 14px; margin: 18px 0 0; padding: 12px 16px; font-size: 15px;
  border-left: 2px solid rgb(255 255 255 / .7); background: linear-gradient(90deg, rgb(255 255 255 / .09), transparent); }
#plain .hl dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; padding-top: 3px; }
#plain .hl dd { margin: 0; line-height: 1.45; }
#plain h2 {
  margin: 30px 0 4px; padding-bottom: 4px; border-bottom: 1px solid rgb(255 255 255 / .55);
  font-weight: 600; font-size: 14px; letter-spacing: .16em; text-transform: uppercase;
}
#plain article { margin-top: 14px; }
#plain .head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
#plain h3 { font-weight: 600; font-size: 16px; }
#plain .when { flex: none; font-size: 14px; opacity: .8; }
#plain .jump { flex: none; font-size: 13px; opacity: .7; text-decoration: none; }
#plain .jump:hover { opacity: 1; text-decoration: underline; }
#plain ul { list-style: disc; padding-left: 1.2em; margin-top: 4px; }
#plain li { margin-top: 3px; font-size: 14.5px; line-height: 1.45; }
#plain li b { font-weight: 600; }
#plain .skills { list-style: none; padding: 0; }
#plain .stack { margin-top: 4px; font-size: 13.5px; opacity: .8; }
#plain a { color: #fff; }
@media (max-width: 640px) {
  #plain.glance { padding: 60px 18px 48px; }
  #plain .hl { grid-template-columns: 1fr; gap: 0; }
  #plain .hl dd { margin-bottom: 8px; }
  #plain .head { flex-wrap: wrap; gap: 0 10px; }
}
