/* mttt.eu — paper, ink and one orange. Thick rules, rounded slabs, very little text.
   Layout: sticky nav bar; home = bento grid of slabs + work list; games = black stage with ticket cards. */
:root {
  --paper: #f2f1ed;
  --slab: #f8f7f4;
  --ink: #141312;
  --ink-2: #5c5955;
  --orange: #e2591f;
  --orange-2: #c84a14;
  --night: #0b0b0b;
  --rule: 3px;
  --radius: 22px;
  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --f-body: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.night { background: var(--night); color: var(--paper); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:focus-visible { outline: var(--rule) solid var(--orange); outline-offset: 3px; }
.mono { font-family: var(--f-mono); font-size: 13px; letter-spacing: .02em; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding-block: 16px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  background: var(--paper);
  border-bottom: var(--rule) solid var(--ink);
}
.night .nav { background: var(--night); border-bottom-color: #2a2826; }
.logo { white-space: nowrap; font-family: var(--f-display); font-size: 30px; font-weight: 640; letter-spacing: -.03em; text-decoration: none; line-height: 1; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.logo i { font-style: normal; color: var(--orange); }
.tabs { display: flex; gap: 4px; margin-left: auto; padding: 4px; border: var(--rule) solid currentColor; border-radius: 22px; transform: translateZ(0); }
/* plain links: the current page sits on a solid fill; no moving parts, nothing layered under the text.
   Fixed heights with exact radii: Safari can leave square ghosts behind 999px radii */
.tabs a, .tabs span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 16px; text-decoration: none;
  font-family: var(--f-mono); font-size: 13px; font-weight: 500; letter-spacing: .04em; -webkit-tap-highlight-color: transparent;
}
.tabs a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); text-decoration: none; }
.night .tabs a[aria-current="page"] { background: var(--orange); color: var(--night); }
.tabs span { opacity: .35; cursor: default; }
.logo { -webkit-tap-highlight-color: transparent; }

.wrap { max-width: 1240px; margin: 0 auto; padding-block: 28px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* slabs */
.slab { position: relative; background: var(--slab); border: var(--rule) solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.slab.orange { background: var(--orange); }
.slab.black { background: var(--ink); color: var(--paper); }
.hatch { background-image: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 13px); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 84px; gap: 14px; }
.b-hero { grid-column: span 8; grid-row: span 3; display: flex; flex-direction: column; justify-content: space-between; padding: 30px 34px; }
/* hero: the snake canvas fills the slab, the label sits above it */
.b-hero .snake { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.b-hero { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.b-hero .mono { position: relative; z-index: 1; align-self: flex-start; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.b-field { grid-column: span 4; grid-row: span 3; background: var(--ink); cursor: crosshair; }
.b-field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* dice: an orange slab with a hatched sky; the die is six bordered faces in CSS 3D */
.b-dice { grid-column: span 3; grid-row: span 5; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 18px; padding: 22px; font: inherit; color: inherit; cursor: pointer; }
.b-dice .hatch { position: absolute; inset: 0 0 auto; height: 30%; border-bottom: var(--rule) solid var(--ink); }
.b-dice .badge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--orange); font-family: var(--f-mono); font-size: 18px; position: relative; }
.die-stage { --d: 92px; position: relative; width: var(--d); height: var(--d); margin: auto 0 14px; perspective: 700px; }
.die-hop { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%; }
.die { position: absolute; inset: 0; transform-style: preserve-3d; }
.die .f { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15%; background: radial-gradient(120% 120% at 30% 25%, #fffdf8, #efe9dd); border: var(--rule) solid var(--ink); border-radius: 22%; }
/* light falls on each face by its angle (--shade is set from script as the die turns) */
.die .f::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; background: var(--ink); opacity: var(--shade, 0); pointer-events: none; }
/* drilled pips: dark at the rim, a soft glint inside */
.die .f i { width: 66%; aspect-ratio: 1; border-radius: 50%; place-self: center; background: radial-gradient(circle at 38% 34%, #4a4643 0 18%, var(--ink) 52%); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .7); }
.die .f1 i { width: 80%; background: radial-gradient(circle at 38% 34%, #ff8a52 0 18%, var(--orange) 60%); box-shadow: inset 0 2px 4px rgba(80, 20, 0, .55), 0 0 0 3px var(--ink); }
.die .core { position: absolute; inset: 6%; background: #e4ddcf; }
.die .cx { transform: rotateY(90deg); }
.die .cy { transform: rotateX(90deg); }
.die .f1 { transform: translateZ(calc(var(--d) / 2)); }
.die .f6 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.die .f3 { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); }
.die .f4 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.die .f2 { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); }
.die .f5 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.die-shadow { position: absolute; left: 4%; right: 4%; bottom: -24px; height: 20px; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 19, 18, .55), rgba(20, 19, 18, 0)); }
.b-slider { grid-column: span 5; grid-row: span 5; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 26px 26px; }
.b-slider .top { display: flex; align-items: center; justify-content: space-between; }
.b-slider .top button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; transition: background .2s, color .2s; }
.b-slider .top button:hover { background: var(--ink); color: var(--paper); }
.b-slider h2 { margin: 0 0 10px; font-weight: 600; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.03em; }
.b-slider p { margin: 0; color: var(--ink-2); max-width: 34ch; }
.b-dots { grid-column: span 4; grid-row: span 3; display: grid; grid-template-columns: repeat(10, 1fr); align-content: center; gap: 0; padding: 18px; cursor: crosshair; }
.b-dots i { display: block; aspect-ratio: 1; margin: 22%; border-radius: 50%; background: var(--ink); }
.b-ticket { grid-column: span 4; grid-row: span 2; display: grid; place-items: center; padding: 10px 18px; background: var(--ink); perspective: 700px; }
.b-ticket img { position: absolute; inset: 14px 22px; width: calc(100% - 44px); height: calc(100% - 28px); object-fit: contain; display: block; will-change: transform; }
/* world clock: rolling digits beside a world map with live day and night */
.b-clock { grid-column: span 5; grid-row: span 4; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 26px; background: var(--ink); color: var(--paper); }
.clk-top, .clk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clk-ap { display: inline-block; padding: 4px 12px; border-radius: 12px; background: var(--orange); color: var(--ink); font-family: var(--f-mono); font-weight: 600; font-size: 14px; letter-spacing: .06em; }
.clk-time { display: flex; align-items: flex-end; gap: 10px; font-family: var(--f-body); font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clk-hm { font-size: clamp(64px, 7.4vw, 112px); line-height: 1; }
.clk-hm .dg:nth-child(2)::after { content: ":"; display: inline-block; width: .32em; text-align: center; color: var(--orange); }
.clk-s { font-size: clamp(26px, 2.6vw, 38px); line-height: 1; padding-bottom: .55em; color: color-mix(in srgb, var(--paper) 55%, transparent); }
.dg { display: inline-flex; height: 1em; overflow: hidden; vertical-align: bottom; }
.dg .col { display: flex; flex-direction: column; width: .62em; will-change: transform; }
.dg .col i { font-style: normal; height: 1em; line-height: 1em; text-align: center; }
.clk-track { flex: 1; max-width: 46%; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--paper) 18%, transparent); overflow: hidden; }
.clk-track i { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; }
.b-map { grid-column: span 7; grid-row: span 4; position: relative; background: var(--slab); cursor: crosshair; padding: 0; }
.b-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.b-map .sphere { fill: color-mix(in srgb, var(--paper) 60%, #dfe4ea); stroke: var(--ink); stroke-width: 2.5; }
.b-map .grat { fill: none; stroke: rgba(20,19,18,.1); stroke-width: 1; }
.b-map .land { fill: var(--ink); opacity: 0; }
.b-map.ready .land { opacity: 1; }
.b-map .night { fill: rgba(20,19,18,.32); pointer-events: none; }
.b-map .sun { fill: #ffc63d; stroke: var(--ink); stroke-width: 2.5; }
.b-map .pin-dot { fill: var(--orange); stroke: var(--ink); stroke-width: 3; }
.b-map .pin-ring { fill: none; stroke: var(--orange); stroke-width: 3; opacity: 0; }
.b-map .hover-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 2; pointer-events: none; }
.wmap-tip { position: absolute; z-index: 2; transform: translate(14px, -130%); padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--paper); white-space: nowrap; pointer-events: none; font-size: 12px; }
.wmap-tip b { font-weight: 600; }
.wmap-card { position: absolute; left: 14px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 12px; border-radius: 16px; border: var(--rule) solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); max-width: calc(100% - 28px); pointer-events: none; }
.wmap-card .mono { font-size: 11px; color: var(--ink-2); }
.wc-time { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.wc-time b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.wc-time small { font-size: 16px; color: var(--ink-2); }
.wc-time em { margin-left: 6px; font-style: normal; font-family: var(--f-mono); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--orange); }
.b-ticker { grid-column: span 12; grid-row: span 1; display: flex; align-items: center; }
.b-ticker .track { display: flex; gap: 40px; white-space: nowrap; font-family: var(--f-display); font-size: 34px; font-weight: 500; font-style: italic; padding-left: 40px; }
.b-ticker .track b { color: var(--orange); font-style: normal; }

/* photo widget: one random album photo filling its slab, swapped as the page scrolls */
.b-photo { grid-column: span 5; grid-row: span 5; display: block; position: relative; overflow: hidden; background-color: var(--ink); }
.b-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-photo .next { position: absolute; inset: 0; overflow: hidden; will-change: transform; }
.b-photo .next img { will-change: transform; backface-visibility: hidden; }
.b-photo .shade { position: absolute; inset: 0; background: #000; opacity: 0; will-change: opacity; pointer-events: none; }



.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; color: var(--ink-2); }
.night .foot { color: #8a8682; }

/* projects: app tiles, icon first */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.proj { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 20px 26px; border: var(--rule) solid var(--ink); border-radius: var(--radius); background: var(--slab); text-decoration: none; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s, box-shadow .15s; perspective: 700px; }
.proj:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--orange); }
.proj:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.proj-icon { display: block; width: 168px; aspect-ratio: 1; border-radius: 24%; overflow: hidden; box-shadow: 0 22px 40px -18px rgba(20,60,140,.55), 0 0 0 1px rgba(20,19,18,.06); transform-style: preserve-3d; will-change: transform; }
.proj-icon img { width: 100%; height: 100%; display: block; }
/* a channel avatar is round, with a warm sunset shadow */
.proj-icon-round { border-radius: 50%; box-shadow: 0 22px 40px -18px rgba(190,80,20,.6), 0 0 0 1px rgba(20,19,18,.06); }
.proj-icon-round img { object-fit: cover; }
.proj-name { font-family: var(--f-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.proj-meta { color: var(--ink-2); }

/* games */
.games-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 18px 0 40px; }
.games-head h1 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(72px, 13vw, 170px); line-height: .85; letter-spacing: -.045em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.games-head h1 i { font-style: normal; color: var(--orange); }
.tickets { display: flex; gap: 34px; flex-wrap: wrap; justify-content: center; perspective: 1200px; }
.ticket {
  --bg: var(--orange); --fg: var(--ink); --hole: var(--night);
  position: relative; width: 300px; max-width: 100%; padding: 16px 16px 18px; border-radius: 26px; background: var(--bg); color: var(--fg);
  text-decoration: none; display: flex; flex-direction: column; transform-style: preserve-3d; will-change: transform;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.ticket.paper { --bg: #e9e8e4; }
.ticket.soon { cursor: default; }
.t-art { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; background: radial-gradient(120% 90% at 40% 20%, #2c2120, #120d0c 70%); overflow: hidden; display: grid; place-items: center; }
.t-holes::before, .t-holes::after { content: ""; position: absolute; z-index: 3; width: 42px; height: 42px; border-radius: 50%; }
.t-holes::before { right: 26px; top: 40px; background: #ededea; }
.t-holes::after { left: 50%; bottom: -21px; translate: -50% 0; background: #ededea; }
.ticket.paper .t-holes::before, .ticket.paper .t-holes::after { background: var(--orange); }
.prism { width: 100%; height: 100%; overflow: visible; }
.prism line, .prism path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.prism .tri { stroke: url(#pg); stroke-width: 7; filter: url(#pglow); }
.prism .inner { stroke: url(#pg); stroke-width: 2.5; opacity: .75; }
.prism .beam { stroke: #fff; stroke-width: 5; filter: url(#pglow); }
.prism .ray-in { stroke: rgba(255,255,255,.55); stroke-width: 3; }
.prism .rays line { stroke-width: 6; filter: url(#pglow); }
.t-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; width: 70%; }
.t-board span { aspect-ratio: 1; border-radius: 9px; background: var(--tbg); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -6px 10px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.t-board span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.7) 46%, transparent 60%); background-size: 260% 100%; animation: sheen 3.2s var(--d, 0s) ease-in-out infinite; opacity: var(--sh, 0); }
@keyframes sheen { 0% { background-position: 100% 0; } 62%, 100% { background-position: 0% 0; } }
.t-date { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-family: var(--f-body); font-size: 30px; font-weight: 400; letter-spacing: -.02em; }
.t-date i { flex: 1; height: 2px; background: currentColor; }
.t-year { align-self: flex-end; font-family: var(--f-mono); font-size: 10px; margin-top: -4px; }
.t-title { margin: 2px 0 10px; font-family: var(--f-display); font-weight: 600; font-size: 64px; line-height: .95; letter-spacing: -.035em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.t-perf { height: 0; border-top: 5px dotted currentColor; margin: 0 -4px 12px; }
.t-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-family: var(--f-body); font-weight: 500; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; }
.t-cta::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.t-meta { flex-basis: 100%; padding-left: 22px; font-family: var(--f-mono); font-size: 10px; opacity: .8; text-transform: none; letter-spacing: 0; }
.barcode { width: 92px; height: 34px; background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 3px, currentColor 3px 4px, transparent 4px 7px, currentColor 7px 10px, transparent 10px 11px); }
.t-q { font-family: var(--f-display); font-size: 120px; font-weight: 600; color: #3a302d; }

@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 72px; }
  .b-hero { grid-column: span 6; }
  .b-field { grid-column: span 3; grid-row: span 3; }
  .b-dots { grid-column: span 3; grid-row: span 3; }
  .b-dice { grid-column: span 2; }
  .b-slider, .b-photo { grid-column: span 4; }
  .b-ticket { grid-column: span 6; }
  .b-clock { grid-column: span 6; grid-row: span 3; }
  .b-map { grid-column: span 6; grid-row: span 5; }
  .b-ticker { grid-column: span 6; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 64px; gap: 10px; }
  .b-hero { grid-column: span 2; grid-row: span 3; padding: 22px; }
  .b-field { grid-column: span 2; grid-row: span 3; }
  /* phones: no dice */
  .b-dice { display: none; }
  .b-slider, .b-photo { grid-column: span 2; grid-row: span 5; }
  .b-ticket { grid-column: span 2; grid-row: span 2; }
  .b-clock { grid-column: span 2; grid-row: span 3; padding: 18px; }
  .b-map { grid-column: span 2; grid-row: span 4; }
  .wmap-card { left: 8px; bottom: 8px; padding: 8px 12px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
  .wc-time b { font-size: 24px; }
  .wc-time small { font-size: 12px; }
  .wmap-card .mono { font-size: 10px; }
  .b-ticker { grid-column: span 2; }
  /* phones: no dot field */
  .b-dots { display: none; }
  .b-clock, .b-map { order: -5; }
  .b-hero { order: -3; }
  .b-field { order: -2; }
  /* phones: logo on its own row, the tabs below it share the full width */
  .nav { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
  .logo { font-size: 26px; }
  .tabs { order: 2; width: 100%; margin-left: 0; }
  .tabs a, .tabs span { flex: 1; justify-content: center; height: 34px; padding: 0 4px; border-radius: 17px; font-size: 13px; }
  .tabs { border-radius: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* page loader: covers the page until fonts and images are ready; the WebGL cube replaces the fallback squares */
.loader { display: none; position: fixed; inset: 0; z-index: 200; background: var(--paper); place-items: center; }
.night .loader { background: var(--night); }
html.is-loading .loader, .loader.out { display: grid; }
html.is-loading, html.is-loading body { overflow: hidden; }
.loader-stage { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.loader canvas { display: block; pointer-events: none; }
/* the loader's logo flies into the header; the real one stays hidden until it lands */
.loader-logo { font-family: var(--f-display); font-size: 64px; font-weight: 640; letter-spacing: -.03em; line-height: 1; font-variation-settings: 'SOFT' 100, 'WONK' 1; color: var(--ink); white-space: nowrap; transform-origin: 0 0; will-change: transform; }
.loader-logo i { font-style: normal; color: var(--orange); }
html.logo-pending .nav .logo { visibility: hidden; }
.loader.gl { pointer-events: none; }
.loader-fallback { display: flex; gap: 10px; }
.loader.gl .loader-fallback { display: none; }
.loader-fallback i { width: 18px; height: 18px; background: var(--ink); animation: lf 1s ease-in-out infinite; }
.night .loader-fallback i { background: var(--paper); }
.loader-fallback i:nth-child(2) { background: var(--orange); animation-delay: .15s; }
.loader-fallback i:nth-child(3) { animation-delay: .3s; }
@keyframes lf { 50% { transform: translateY(-10px) rotate(45deg); } }

/* images never show half-decoded: they stay transparent over a shimmering placeholder until ready */
img.wait { opacity: 0; }
img.is-ready { opacity: 1; transition: opacity .45s ease; }
.shimmer, .cellp, .ph, .b-photo { background-image: linear-gradient(100deg, rgba(128,128,128,.10) 30%, rgba(128,128,128,.24) 50%, rgba(128,128,128,.10) 70%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
