/* Shared drafting base for versions E–H: tobia.work type and colors, the dot and line grid,
   header, mobile menu, theme toggle, cursor, sheets and buttons. Each version adds its own layout below. */
@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin-800-normal.woff2) format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url(fonts/poppins-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url(fonts/poppins-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --paper: #ffffff;
  --ink: #141619;
  --muted: #5d636b;
  --draw-strong: #5d636b;            /* 3D drawing: dark gray lines (device, sheet outlines) */
  --draw-soft: #b8bec6;              /* 3D drawing: light gray lines (parts that are not the accent) */
  --blue: #1a56db;
  --green: #1e9e6a;
  --green-line: rgb(30 158 106 / .38);
  --green-soft: rgb(30 158 106 / .1);
  --surface: #ffffff;
  --card: #f3f4f3;
  --card-hover: #e9eeeb;
  --header-bg: rgb(255 255 255 / .86);
  --on-ink: #ffffff;                 /* text on dark buttons */
  --fx: 26 86 219;                   /* blue for the halo, ripple and cursor, as r g b */
  --face-accent: #dfe8fb;            /* 3D drawing: accent face fill */
  --grid-dot: rgb(30 158 106 / .2);
  --grid-line: rgb(30 158 106 / .06);
  --head: 'Manrope', system-ui, sans-serif;
  --body: 'Poppins', system-ui, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
  --header-h: calc(5vw + 40px);

  /* Type scale: four sizes only, matched to tobia.work.
     Display and Title scale with the window exactly like Squarespace does. */
  --fs-display: clamp(48px, calc(42.18px + 1.782vw), 68px);  /* Manrope 700: hero only */
  --fs-title: clamp(22px, calc(21.24px + 0.356vw), 26.4px);  /* Manrope 800 section titles, 700 skill groups, 500 card titles */
  --fs-body: 16px;                                           /* Poppins 400 / 500 */
  --fs-small: 13px;                                          /* Poppins 400 / 500 */
  --track-head: -0.02em;
}
/* Dark theme. Every text/background pair passes WCAG AA (checked: body text ≥ 13:1,
   muted ≥ 6.5:1, blue ≥ 5.7:1, buttons ≥ 6.9:1). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e1217;
  --surface: #151a21;
  --ink: #e9edf2;
  --muted: #a0a9b6;
  --draw-strong: #a0a9b6;
  --draw-soft: #4f5967;
  --blue: #6b9bff;
  --green: #3cc48c;
  --green-line: rgb(60 196 140 / .32);
  --green-soft: rgb(60 196 140 / .1);
  --card: #1d242d;
  --card-hover: #252e39;
  --grid-dot: rgb(60 196 140 / .22);
  --grid-line: rgb(60 196 140 / .07);
  --header-bg: rgb(14 18 23 / .86);
  --on-ink: #0e1217;
  --fx: 107 155 255;
  --face-accent: #1f2c4a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; transition: background-color .3s, color .3s; color: var(--ink); font: 400 var(--fs-body)/1.5 var(--body);
  background:
    radial-gradient(circle, var(--grid-dot) 1px, transparent 1.5px) 0 0 / 24px 24px,
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px) 0 0 / 120px 120px,
    var(--paper);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--ink); color: var(--on-ink); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header, like the live site */
.top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: clamp(14px, 2.4vw, 32px); min-height: var(--header-h);
  /* Matches the live tobia.work header: 2.5vw top and bottom, 6vw sides, a 40px row (the 1px line comes off the bottom). */
  padding: 2.5vw 6vw calc(2.5vw - 1px); grid-template-rows: 40px;
  background: var(--header-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--green-soft); }
/* Logo: the same size as on tobia.work's header: 16px plus 0.6% of the window width, up to 24.64px from 1440px wide. */
.mark { justify-self: start; text-decoration: none; font: 500 min(calc(1rem + 0.6vw), 24.64px)/1.2 var(--head); letter-spacing: var(--track-head); }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 32px); font-size: var(--fs-body); }
.top nav a { text-decoration: none; white-space: nowrap; }
.top nav i { display: none; }
.menu-btn, .menu-scrim { display: none; }

/* Links that stay in the text flow: a blue line draws in from the left on hover
   and leaves to the right. Header, See the work, Spotify, reel, footer links. */
.top nav a, .text-link, .title-block dd a { text-decoration: none; padding-bottom: 2px;
  background: linear-gradient(var(--blue), var(--blue)) no-repeat right bottom / 0% 1.5px;
  transition: background-size .35s cubic-bezier(.2,.7,.2,1); }
.top nav a:hover, .text-link:hover, .title-block dd a:hover,
.top nav a:focus-visible, .text-link:focus-visible, .title-block dd a:focus-visible { background-position: left bottom; background-size: 100% 1.5px; }
@media (prefers-reduced-motion: reduce) { .top nav a, .text-link, .title-block dd a { transition: none; } }

.pill { display: inline-block; padding: 12px 22px; border-radius: 10px; background: var(--ink); color: var(--on-ink); text-decoration: none; font-weight: 500; }
.pill:hover { background: var(--blue); color: var(--on-ink); }
.text-link { font-weight: 500; color: var(--ink); }
/* Sheets: framed drawing sheets with thick blue corners */
.sheet { scroll-margin-top: calc(var(--header-h) + 20px); margin: 0 var(--pad) clamp(40px, 6vw, 80px); padding: clamp(28px, 4vw, 56px); background: var(--surface); border: 1px solid var(--green-line); position: relative; }
.sheet::before, .sheet::after { content: ''; position: absolute; width: 16px; height: 16px; border: 3px solid var(--blue); }
.sheet::before { left: -9px; top: -9px; border-right: 0; border-bottom: 0; }
.sheet::after { right: -9px; bottom: -9px; border-left: 0; border-top: 0; }
.sheet-head { max-width: 44rem; margin-bottom: 36px; }
.sheet-head h2 { margin: 0 0 8px; font: 800 var(--fs-title)/1.2 var(--head); letter-spacing: 0; text-transform: uppercase; color: var(--blue); }
.sheet-head p { margin: 0; color: var(--muted); }
/* Bullet lists: round dots that echo the dot grid in the background */
.dots { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.dots li { position: relative; padding-left: 18px; }
.dots li::before { content: ''; position: absolute; left: 2px; top: calc(.75em - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
/* Real images fill their frame; on hover they ease in slightly, the same on every card */
/* Project covers: the page shows the light or dark version to match the theme */
:root[data-theme="dark"] .th-light, :root:not([data-theme="dark"]) .th-dark { display: none; }
/* Images fill their frame and ease in slightly on hover */
.media { position: relative; overflow: hidden; background: var(--card); transition: background .3s; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
a:hover .media img, a:focus-visible .media img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .media img { transition: none; } a:hover .media img { transform: none; } }
.ext { width: 14px; height: 14px; flex: none; }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--green-line); border-radius: 999px; font-size: var(--fs-small); line-height: 1.6; color: var(--muted); white-space: nowrap; }
.tag.is-blue { color: var(--blue); border-color: currentColor; }
/* Back to top: appears once the hero is out of view */
.to-top { position: fixed; right: var(--pad); bottom: 20px; z-index: 30; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: var(--ink); color: var(--on-ink); cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .25s, background .2s; }
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { background: var(--blue); }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Pointer halo: the same grid, drawn in blue, revealed around the pointer.
   It sits behind the content, so it only shows where the background is visible. */
.grid-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgb(var(--fx) / .9) 1.2px, transparent 1.7px) 0 var(--gy, 0px) / 24px 24px,
    linear-gradient(to right, rgb(var(--fx) / .28) 1px, transparent 1px) 0 var(--gy, 0px) / 120px 120px,
    linear-gradient(to bottom, rgb(var(--fx) / .28) 1px, transparent 1px) 0 var(--gy, 0px) / 120px 120px; }
.grid-halo { opacity: 0; transition: opacity .35s;
  -webkit-mask-image: radial-gradient(circle 190px at var(--mx, -500px) var(--my, -500px), #000 0%, rgb(0 0 0 / .45) 45%, transparent 100%);
          mask-image: radial-gradient(circle 190px at var(--mx, -500px) var(--my, -500px), #000 0%, rgb(0 0 0 / .45) 45%, transparent 100%); }
.grid-halo.is-on { opacity: 1; }
@media (hover: none) { .grid-halo { display: none; } }

/* Custom cursor (mouse only). Regular: a tinted circle with a blue dot at the click point.
   On previews that open another page: a white circle with a blue arrow and a soft shadow. */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; }
.cursor-dot { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%;
  background: rgb(var(--fx) / .1); color: var(--blue); opacity: 0; transform: scale(.6);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s, background .2s, box-shadow .2s; }
.cursor-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--blue); transition: opacity .15s, background .2s; }
.cursor-dot svg { width: 22px; height: 22px; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .25s; }
.cursor.is-visible .cursor-dot { opacity: 1; transform: scale(1); }
.cursor.is-visible.is-link .cursor-dot { transform: scale(1.15); background: rgb(var(--fx) / .16); }
.cursor.is-visible.is-down .cursor-dot { transform: scale(.85); }
.cursor.is-visible.is-dark .cursor-dot { background: color-mix(in srgb, var(--on-ink) 24%, transparent); }
.cursor.is-dark .cursor-dot::after { background: var(--on-ink); }
.cursor-label { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 700 var(--fs-body)/1 var(--head); letter-spacing: .04em; text-transform: uppercase; color: #1a56db; opacity: 0; transition: opacity .15s; }
/* Over a preview: the circle stretches into a white pill, centered on the pointer: label, then arrow */
.cursor-dot { transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s, background .2s, box-shadow .2s, width .3s cubic-bezier(.2,.8,.2,1), height .3s cubic-bezier(.2,.8,.2,1), left .3s cubic-bezier(.2,.8,.2,1), top .3s cubic-bezier(.2,.8,.2,1), border-radius .3s; }
.cursor.is-ext .cursor-dot { left: calc(var(--pill-w, 170px) / -2); top: -26px; width: var(--pill-w, 170px); height: 52px; border-radius: 26px; place-items: center end; padding-right: 16px;
  background: #fff; box-shadow: 0 8px 24px -8px rgb(0 0 0 / .32), 0 1px 3px rgb(0 0 0 / .12); }
.cursor.is-ext .cursor-dot::after { opacity: 0; }
.cursor.is-ext .cursor-dot svg { opacity: 1; transform: scale(1); color: #1a56db; }
.cursor.is-ext .cursor-label { opacity: 1; transition-delay: .08s; }
@media (prefers-reduced-motion: reduce) { .cursor-dot, .cursor-dot svg { transition: opacity .15s, background .15s; } }

/* Theme toggle: an outlined track with a datum point that slides between sun and moon */
.theme-toggle { position: relative; width: 58px; height: 28px; padding: 0; border: 1px solid var(--ink); border-radius: 14px; color: var(--ink); cursor: pointer; flex: none;
  background: var(--surface); }
.theme-toggle .ico { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -7px; opacity: .55; }
.theme-toggle .sun { left: 7px; } .theme-toggle .moon { right: 7px; }
.theme-toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); transition: transform .35s cubic-bezier(.3,.7,.2,1); display: grid; place-items: center; }
.theme-toggle .knob::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(30px); }
@media (prefers-reduced-motion: reduce) { .theme-toggle .knob { transition: none; } }

/* Small screens: logo left, theme toggle centered, menu button right.
   The nav becomes a drawing sheet that unrolls from the header: the sheet draws
   down, its blue corners snap on, then each row's leader line draws in. */
@media (max-width: 767px) {
  /* Matches the live tobia.work mobile header: 6vw padding, 37px row, 16px logo. */
  .top { grid-template-columns: 1fr auto 1fr; padding: 6vw 6vw calc(6vw - 1px); grid-template-rows: 37px; min-height: 0;
    padding: round(6vw, 1px) round(6vw, 1px) calc(round(6vw, 1px) - 1px); } /* whole pixels, so the thin icon lines stay crisp */
  :root { --header-h: calc(12vw + 37px); }
  .mark { font-size: 16px; line-height: 1.2; }
  .top .theme-toggle { grid-column: 2; }
  /* Two thin lines like the live site's icon. Open: they cross into an X and the blue dot appears in the middle. */
  .menu-btn { grid-column: 3; justify-self: end; display: block; position: relative; width: 47px; height: 37px;
    padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .menu-btn .bar { position: absolute; left: 6px; width: 35px; height: 0; border-top: 1px solid currentColor; /* a border snaps to whole screen pixels */
    transition: transform .4s cubic-bezier(.3,.7,.2,1), opacity .25s; }
  .menu-btn .bar:nth-child(1) { top: 12px; } .menu-btn .bar:nth-child(3) { top: 23px; }
  .menu-btn .bar:nth-child(2) { left: 20.5px; top: 15px; width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--blue); z-index: 1;
    box-shadow: 0 0 0 2px var(--header-bg); opacity: 0; transform: scale(0); }
  .menu-open .menu-btn .bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg) scaleX(.8); }
  .menu-open .menu-btn .bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg) scaleX(.8); }
  .menu-open .menu-btn .bar:nth-child(2) { opacity: 1; transform: none; transition: transform .35s .15s cubic-bezier(.3,1.6,.5,1), opacity .2s .15s; }

  .top nav.menu { position: absolute; top: calc(100% + 14px); left: var(--pad); right: var(--pad); display: grid; gap: 0; padding: 8px 22px 22px;
    background: var(--surface); border: 1px solid var(--green-line);
    visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path .28s cubic-bezier(.4,0,.6,1), visibility 0s .28s; }
  /* Thick blue corners, like the sheets below. Outside the clip, so they sit in their own layer. */
  .menu::before, .menu::after { content: ''; position: absolute; width: 16px; height: 16px; border: 3px solid var(--blue); opacity: 0; transition: opacity .15s, transform .15s; }
  .menu::before { left: -9px; top: -9px; border-right: 0; border-bottom: 0; transform: translate(6px, 6px); }
  .menu::after { right: -9px; bottom: -9px; border-left: 0; border-top: 0; transform: translate(-6px, -6px); }
  .top nav.menu a { display: grid; grid-template-columns: 7px 28px auto; align-items: center; column-gap: 10px; padding: 16px 0; background: none;
    border-bottom: 1px solid var(--green-line); font: 700 var(--fs-title)/1.2 var(--head); letter-spacing: var(--track-head); text-transform: uppercase; color: var(--ink);
    opacity: 0; transform: translateY(-8px); transition: opacity .15s, transform .15s, color .2s; }
  .top nav.menu a::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
  .top nav.menu i { display: block; height: 1px; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .15s; }
  .top nav.menu a:hover, .top nav.menu a:focus-visible { color: var(--blue); background: none; }
  .top nav.menu a.menu-connect { grid-template-columns: 1fr; justify-items: center; margin-top: 22px; padding: 14px 22px; border: 0; border-radius: 10px;
    background: var(--ink); color: var(--on-ink); font: 500 var(--fs-body)/1.5 var(--body); letter-spacing: 0; text-transform: none; }
  .top nav.menu a.menu-connect::before, .top nav.menu a.menu-connect i { display: none; }
  .top nav.menu a.menu-connect:hover { background: var(--blue); color: var(--on-ink); }

  .menu-open .top nav.menu { visibility: visible; clip-path: inset(-12px -12px -12px -12px); transition: clip-path .5s cubic-bezier(.2,.8,.2,1); }
  .menu-open .menu::before, .menu-open .menu::after { opacity: 1; transform: none; transition: opacity .2s .38s, transform .35s .38s cubic-bezier(.3,1.6,.5,1); }
  .menu-open .top nav.menu a { opacity: 1; transform: none; transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.2,1), color .2s; }
  .menu-open .top nav.menu i { transform: none; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
  .menu-open .top nav.menu a:nth-child(1), .menu-open .top nav.menu a:nth-child(1) i { transition-delay: .14s; }
  .menu-open .top nav.menu a:nth-child(2), .menu-open .top nav.menu a:nth-child(2) i { transition-delay: .2s; }
  .menu-open .top nav.menu a:nth-child(3), .menu-open .top nav.menu a:nth-child(3) i { transition-delay: .26s; }
  .menu-open .top nav.menu a:nth-child(4), .menu-open .top nav.menu a:nth-child(4) i { transition-delay: .32s; }
  .menu-open .top nav.menu a:nth-child(5) { transition-delay: .4s; }
  .menu-open .top nav.menu a:hover, .menu-open .top nav.menu a:focus-visible { transition-delay: 0s; }

  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: var(--header-bg); opacity: 0; visibility: hidden;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity .25s, visibility 0s .25s; }
  .menu-open .menu-scrim { opacity: 1; visibility: visible; transition: opacity .35s; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .menu-btn .bar, .top nav.menu, .menu::before, .menu::after, .top nav.menu a, .menu i, .menu-scrim { transition: none !important; }
}


/* ---------- This version ---------- */
/* Version H: house. One screen on desktop: the panel on the left, the floor plan filling the rest. */
.v-house .to-top { display: none; }
.house { display: grid; grid-template-columns: minmax(340px, 30vw) minmax(0, 1fr); height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); min-height: 560px; }
@media (min-width: 1024px) { html:has(.v-house) { overflow: hidden; } }

.panel { position: relative; overflow-y: auto; padding: clamp(24px, 3vw, 44px) 28px 32px 6vw; border-right: 1px solid var(--green-line); background: var(--surface); scrollbar-width: thin; }
/* Panel changes: the old content eases out, the new one eases in block by block. */
.panel-in { transition: opacity .32s cubic-bezier(.4, 0, .6, 1), transform .32s cubic-bezier(.4, 0, .6, 1); }
.panel-in.is-out { opacity: 0; transform: translateY(-6px); }
.panel-in.is-in .fade-item { animation: panel-in .8s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px); } }

.hello { margin: 0 0 2px; font: 500 var(--fs-title)/1.2 var(--head); letter-spacing: var(--track-head); }
.creds { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 4px; color: var(--muted); }
.creds .text-link { color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
/* Below the rooms, after a divider: the work outside the day job. */
.outside-line { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--green-line); gap: 8px; line-height: 1.6; }
/* Every text link in the panel turns blue on hover, like the room list and the back link. */
.panel .text-link { transition: color .2s, background-size .35s cubic-bezier(.2,.7,.2,1); }
.panel .text-link:hover, .panel .text-link:focus-visible { color: var(--blue); }
.intro h1 { margin: 0; font: 700 clamp(38px, calc(22px + 1.7vw), 56px)/1.04 var(--head); letter-spacing: var(--track-head); text-transform: uppercase; color: var(--blue); }
.intro { container-type: inline-size; }
/* Always three lines (the breaks are in the markup). Its widest line is about 13 times the font size,
   so on a narrow panel the type eases down just enough for every word pair to fit. */
.intro-sub { margin: 14px 0 0; font: 500 min(var(--fs-title), calc(100cqi / 13.4))/1.2 var(--head); letter-spacing: var(--track-head); }
.hl { color: var(--blue); font-weight: 700; }
/* The rolling words: while a word changes, a strip of words slides up inside a clipped box, like a slot machine reel. */
.roll { white-space: nowrap; display: inline-block; vertical-align: bottom; }
.roll.is-rolling { overflow: hidden; }
.roll .strip { display: block; }
.roll .strip > span { display: block; }
.roll-probe { position: absolute; visibility: hidden; white-space: pre; }
.nowrap { white-space: nowrap; }
.intro-body { margin: 14px 0 0; color: var(--muted); }
.intro-actions { display: flex; align-items: center; gap: 22px; margin: 24px 0 0; }
/* A divider sets the room list apart from the intro above. */
.rooms-h { margin: 32px 0 8px; padding-top: 28px; border-top: 1px solid var(--green-line); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--head); }
.small { font-size: var(--fs-small); }
.muted { color: var(--muted); }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { padding: 5px 0; }
/* Plain links, no dividers or dots; hover matches the back link: blue, with an underline drawing in. */
.room-list button { padding: 0 0 2px; border: 0; color: var(--ink); font: 500 var(--fs-body)/1.4 var(--body); text-align: left; cursor: pointer;
  background: linear-gradient(var(--blue), var(--blue)) no-repeat right bottom / 0% 1.5px; transition: color .2s, background-size .35s cubic-bezier(.2,.7,.2,1); }
.room-list button:hover, .room-list button:focus-visible { color: var(--blue); background-position: left bottom; background-size: 100% 1.5px; }
/* On hover a forward arrow eases in from the left and the name slides over to make room for it. */
.room-list button { display: inline-flex; align-items: center; }
.go-arrow { width: 0; height: 1.05em; flex: none; margin-right: 0; opacity: 0; transform: translateX(-8px);
  transition: width .4s cubic-bezier(.4, 0, .2, 1), margin-right .4s cubic-bezier(.4, 0, .2, 1), opacity .3s ease, transform .4s cubic-bezier(.4, 0, .2, 1); }
.room-list button:hover .go-arrow, .room-list button:focus-visible .go-arrow { width: 1.05em; margin-right: 6px; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .room-list button, .go-arrow { transition: color .2s, opacity .2s; } }

.room h2 { margin: 18px 0 6px; font: 800 var(--fs-title)/1.2 var(--head); text-transform: uppercase; color: var(--blue); }
.back { border: 0; background-color: transparent; padding: 0 0 2px; font: 500 var(--fs-body)/1.4 var(--body); color: var(--ink); cursor: pointer;
  transition: color .2s, background-size .35s cubic-bezier(.2,.7,.2,1); }
/* Hover: blue like the room list, with the link underline drawing in. */
.back:hover, .back:focus-visible { color: var(--blue); }
.back { display: inline-flex; align-items: center; gap: 6px; }
.back-arrow { width: 1.05em; height: 1.05em; flex: none; }
.blurb { margin: 0 0 20px; color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
/* Stacked cards: the cover runs the full width of the panel, with the title and line below it. */
.it { display: grid; gap: 12px; text-decoration: none; color: inherit; }
.it .media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--green-line); border-radius: 4px; }
.it-text { display: grid; line-height: 1.35; }
.it-text b { font: 600 calc(var(--fs-body) * 1.12)/1.25 var(--head); letter-spacing: var(--track-head); transition: color .2s; }
.it-text span { margin-top: 4px; font-size: var(--fs-small); color: var(--muted); }
a.it:hover .it-text b, a.it:focus-visible .it-text b { color: var(--blue); }
.it .tag { justify-self: start; font-style: normal; }
.skillset > div { padding: 12px 0; border-top: 1px solid var(--green-line); }
.skillset h3 { margin: 0 0 2px; font: 700 var(--fs-body)/1.3 var(--head); text-transform: uppercase; letter-spacing: .02em; color: var(--blue); }
.skillset p { margin: 0; color: var(--muted); }

/* The plan */
.plan { position: relative; margin: 0; min-width: 0; overflow: hidden; } /* labels stay inside the plan, never over the sidebar */
.plan canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.room-labels { position: absolute; inset: 0; pointer-events: none; }
.room-label { position: absolute; left: 0; top: 0; pointer-events: auto; padding: 4px 10px; border: 1px solid var(--green-line); border-radius: 6px; background: var(--surface);
  font: 500 var(--fs-small)/1.3 var(--body); color: var(--ink); white-space: nowrap; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s, box-shadow .4s, opacity .4s; }
/* In the top view a label can sit on furniture, so a soft shadow lifts it off the drawing. */
.room-label.can-wrap { white-space: normal; text-align: center; text-wrap: balance;
  box-shadow: 0 1px 3px rgba(22, 28, 36, .08), 0 6px 20px rgba(22, 28, 36, .16); }
:root[data-theme="dark"] .room-label.can-wrap { box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 22px rgba(0, 0, 0, .55); }
.room-label.is-dim { opacity: .4; } /* other rooms' labels, while one room is open */
.room-label.is-hover, .room-label:hover { color: var(--blue); border-color: var(--blue); }
.room-label.is-on { background: var(--blue); border-color: var(--blue); color: var(--on-ink); }
/* Dark mode: the open room's label is white with blue text, so it stands out on the blue floor. */
:root[data-theme="dark"] .room-label.is-on { background: #fff; border-color: #fff; color: #1a56db; }
/* Mouse only, inside an open room: a dotted line runs from the pointer to the room's label. */
.room-link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; transition: opacity .35s cubic-bezier(.4, 0, .2, 1); }
.room-link.is-on { opacity: 1; }
.room-link line { stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 0.1 6; animation: link-flow .9s linear infinite; }
@keyframes link-flow { to { stroke-dashoffset: -6.1; } }
:root[data-theme="dark"] .room-link line { stroke: #fff; } /* the blue line gets lost on dark mode's gray floors */
/* Dark mode, over a room's floor: a white version of the cursor. */
.cursor.on-floor:not(.is-ext) .cursor-dot { background: rgb(255 255 255 / .3); }
.cursor.on-floor:not(.is-ext) .cursor-dot::after { background: #fff; }
/* Leaving a room: the dot becomes the back arrow from the panel's 'Floor plan' link. */
.cursor-dot::before { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; background: var(--blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 12H4.5M10.5 6l-6 6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 12H4.5M10.5 6l-6 6 6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transform: translateX(4px) scale(.6); transition: opacity .15s, transform .25s cubic-bezier(.2,.8,.2,1); }
.cursor.is-exit:not(.is-ext) .cursor-dot::before { opacity: 1; transform: none; }
.cursor.is-exit:not(.is-ext) .cursor-dot::after { opacity: 0; }
/* Outside every room while one is open: a small tip beside the pointer. */
.plan-tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 5px 10px; border: 1px solid var(--green-line); border-radius: 6px; background: var(--surface);
  font: 500 var(--fs-small)/1.2 var(--body); color: var(--muted); white-space: nowrap; box-shadow: 0 1px 3px rgba(22, 28, 36, .08), 0 6px 20px rgba(22, 28, 36, .12);
  opacity: 0; transition: opacity .3s cubic-bezier(.4, 0, .2, 1); }
.plan-tip.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .room-link line { animation: none; } }
/* The hint sits at the right end of the bottom bar. */
.plan-hint { flex: 1 1 auto; min-width: 0; margin: 0; text-align: right; text-wrap: balance; pointer-events: none; }

/* Plan controls, bottom left: round buttons in two groups. Active icon blue, inactive gray. */
/* Bottom bar: the view buttons and the music player on the left, the hint on the right. */
.plan-controls { position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.plan-controls > * { pointer-events: auto; }
/* A soft fade behind the bottom bar, so the dotted grid doesn't run under the controls. */
.plan::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 112px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 0%, transparent), color-mix(in srgb, var(--paper) 88%, transparent) 60%, var(--paper)); }
.ctl-set { display: flex; gap: 10px; flex: none; }
@media (max-width: 1099px) { .plan-hint { display: none; } } /* too narrow to fit beside the controls */
.player { flex: none; }
.ctl-group[hidden] { display: none; }
.ctl-group { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--green-line); border-radius: 999px; background: var(--surface); }
/* "Reset view" tip: points down at the 3D button when the house has been turned. */
.ctl-group { position: relative; }
.reset-tip { position: absolute; left: 0; bottom: calc(100% + 10px); transform: translateY(4px); padding: 5px 10px; border: 1px solid var(--blue); border-radius: 6px;
  background: var(--blue); color: var(--on-ink); font: 500 var(--fs-small)/1.2 var(--body); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 1px 3px rgba(22, 28, 36, .08), 0 6px 18px rgba(22, 28, 36, .14); }
.reset-tip::after { content: ''; position: absolute; left: 17px; top: 100%; /* under the 3D icon */ border: 5px solid transparent; border-top-color: var(--blue); }
.reset-tip.is-on { opacity: 1; transform: none; }
:root[data-theme="dark"] .reset-tip { background: #fff; border-color: #fff; color: #1a56db; }
:root[data-theme="dark"] .reset-tip::after { border-top-color: #fff; }
.ctl { flex: none; /* never squeezed: the song name gives up space instead */ display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  transition: color .2s, background-color .2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ctl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ctl[data-motion="on"] svg { fill: currentColor; }
.ctl[aria-pressed="true"] { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
@media (hover: hover) { .ctl[aria-pressed="false"]:not(:disabled):hover { color: var(--ink); } }
.ctl:disabled { opacity: .35; cursor: default; }

/* Music player: play/pause and the song's name scrolling inside while it plays. */
.player { align-items: center; }
.ctl[data-music] .i-pause, .player.is-playing .ctl[data-music] .i-play { display: none; }
.player.is-playing .ctl[data-music] .i-pause { display: block; }
.ctl[data-music] .i-play { fill: currentColor; }
.marquee { position: relative; width: 150px; margin: 0 4px 0 6px; overflow: hidden; font-size: var(--fs-small); color: var(--muted); white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.mq-track { display: inline-flex; animation: mq 12s linear infinite; animation-play-state: paused; }
.mq-text { padding-right: 2.5em; }
.player.is-playing .marquee { color: var(--ink); }
.player.is-playing .mq-track { animation-play-state: running; }
@keyframes mq { to { transform: translateX(-50%); } }
.ctl-out { text-decoration: none; }
@media (hover: hover) { .ctl-out:hover { color: var(--blue); } }
@media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } .mq-text + .mq-text { display: none; } .mq-text { text-overflow: ellipsis; } }

/* Tablet and phone: the plan on top, the panel below, and the page scrolls. */
@media (max-width: 1023px) {
  .house { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .plan { order: -1; height: min(72vh, 640px); border-bottom: 1px solid var(--green-line); }
  .panel { overflow: visible; border-right: 0; padding: 28px var(--pad) 56px; scroll-margin-top: var(--header-h); }
  .room-label { font-size: 13px; padding: 4px 9px; }
  .plan-hint { display: none; }
  .plan-controls { left: 12px; right: 12px; bottom: 12px; }
}

/* Phones: the controls sit centered below the plan, in their own strip, so the plan never runs under them. */
@media (max-width: 600px) {
  /* The plan is sized to the top view's shape (with the same small margin all round), but never so tall that the
     intro below can't peek in at the bottom of the screen. The controls sit in one row just under it. */
  .plan { height: min(calc(138.5vw + 62px), calc(100vh - 140px)); height: min(calc(138.5vw + 62px), calc(100svh - 140px)); }
  .plan canvas, .room-labels { inset: 0 0 62px 0; height: auto; }
  .plan canvas { height: calc(100% - 62px); }
  .plan::after { height: 70px; }
  .plan-controls { left: 12px; right: 12px; bottom: 14px; flex-wrap: nowrap; justify-content: center; column-gap: 8px; }
  .ctl-set { flex: 1 1 100%; flex-wrap: nowrap; justify-content: center; gap: 8px; min-width: 0; }
  .player { flex: 1 1 auto; min-width: 0; max-width: 300px; }
  .marquee { flex: 1 1 auto; width: auto; min-width: 0; }
  .room-label.can-wrap { font-size: 13px; line-height: 1.25; padding: 4px 8px; border-radius: 6px; min-width: min-content; } /* never narrower than its longest word */
}

/* Very small phones (iPhone SE and narrower): a smaller label so it stays inside its room. */
@media (max-width: 375px) {
  .room-label.can-wrap { font-size: 11.5px; padding: 3px 6px; border-radius: 5px; }
}

/* Cursor over a link that opens another page: a small pill shaped like the room labels, with the caps label and arrow. */
.cursor { --pill-pad: 42px; } /* label inset + gap + arrow + right inset; cursor.js adds it to the label's width */
.cursor.is-ext .cursor-dot { top: -15px; height: 30px; border-radius: 6px; padding-right: 10px; border: 1px solid var(--green-line); background: var(--surface);
  box-shadow: 0 1px 3px rgba(22, 28, 36, .08), 0 6px 20px rgba(22, 28, 36, .14); }
.cursor.is-ext .cursor-dot svg { width: 14px; height: 14px; color: var(--blue); }
.cursor-label { left: 11px; font: 600 11px/1 var(--head); letter-spacing: .07em; color: var(--blue); }
:root[data-theme="dark"] .cursor.is-ext .cursor-dot { box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 22px rgba(0, 0, 0, .5); }

/* Header (desktop): the logo on the left, the theme toggle in the center, Let's connect on the right.
   Work, Skills, Outside work and Resume are hidden for now (still in the markup); phones keep their menu. */
@media (min-width: 768px) {
  .top { grid-template-columns: 1fr auto 1fr; }
  .top .mark { grid-column: 1; grid-row: 1; }
  .top .theme-toggle { grid-column: 2; grid-row: 1; }
  .top nav.menu { grid-column: 3; grid-row: 1; justify-self: end; }
  .top nav.menu a:not(.menu-connect) { display: none; }
  /* Hover: blue like the room list, with the underline drawing in. */
  .top nav a { transition: color .2s, background-size .35s cubic-bezier(.2,.7,.2,1); }
  .top nav a:hover, .top nav a:focus-visible { color: var(--blue); }
  /* Same type as the room list: a little bolder than the live site's header link. */
  .top nav a.menu-connect { font: 500 var(--fs-body)/1.4 var(--body); }
}

/* Header (phones): the same layout as desktop. The logo on the left, the toggle in the center, and a round mail
   button on the right (45px, black, white icon, as on the live tobia.work). The menu is hidden for now. */
.mail-btn { display: none; }
@media (max-width: 767px) {
  .top .menu-btn, .top nav.menu, .menu-scrim { display: none !important; }
  .mail-btn { grid-column: 3; grid-row: 1; justify-self: end; display: block; width: 45px; height: 45px; margin: -4px 0; padding: 10px; border-radius: 50%;
    background: var(--ink); color: var(--on-ink); transition: background-color .2s; -webkit-tap-highlight-color: transparent; }
  .mail-btn:hover, .mail-btn:focus-visible { background: var(--blue); }
  .mail-btn svg { display: block; width: 100%; height: 100%; fill: currentColor; }
}

/* Theme control: a wall light switch on its side, drawn like the plan (ink outlines, paper faces, a blue accent).
   A plate with two screws and a rocker that tips in 3D, with the sun on the left and the moon on the right:
   left pressed = lights on (light theme), right pressed = lights off (dark theme). The side that's on is blue.
   In the dark, a small blue locator light glows on the rocker, like real switches.
   The original toggle stays in the header, hidden. */
.top .theme-toggle { display: none; }
.light-switch { grid-column: 2; grid-row: 1; justify-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ls-icon { display: grid; place-items: center; width: 17px; height: 17px; color: var(--muted); opacity: .4; transition: color .25s, opacity .25s; } /* the mode that's off: light gray, dimmed */
.ls-icon svg { width: 17px; height: 17px; }
.ls-sun { color: var(--blue); opacity: 1; }
:root[data-theme="dark"] .ls-sun { color: var(--muted); opacity: .4; }
:root[data-theme="dark"] .ls-moon { color: var(--blue); opacity: 1; }
.ls-plate { position: relative; display: block; width: 54px; height: 36px; border: 1.5px solid currentColor; border-radius: 7px; background: var(--surface); perspective: 60px; transition: color .2s; }
.ls-screw { position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 50%; }
.ls-screw::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 0; border-top: 1px solid color-mix(in srgb, currentColor 45%, transparent); transform: rotate(-35deg); }
.ls-screw:first-child { left: 4px; } .ls-screw:nth-child(2) { right: 4px; }
.ls-rocker { position: absolute; left: 50%; top: 50%; width: 30px; height: 20px; margin: -10px 0 0 -15px; border: 1.5px solid currentColor; border-radius: 4px; overflow: hidden;
  transform-style: preserve-3d; transform: rotateY(24deg); transition: transform .22s cubic-bezier(.3, 1.5, .5, 1), box-shadow .22s;
  box-shadow: 2px 0 0 color-mix(in srgb, currentColor 22%, transparent); } /* the raised end casts a small shadow on the plate */
.ls-face { position: absolute; top: 0; bottom: 0; width: 50%; display: grid; place-items: center; background: var(--surface); transition: background-color .22s, box-shadow .22s; }
.ls-a { left: 0; } .ls-b { right: 0; }
/* The pressed-in half sits in shadow; the raised half catches the light, with a line where the two halves meet. */
.ls-a { background: color-mix(in srgb, currentColor 16%, var(--surface)); }
.ls-b { box-shadow: inset 1px 0 0 color-mix(in srgb, currentColor 55%, transparent); }
.ls-led { display: block; width: 4px; height: 4px; border-radius: 50%; background: color-mix(in srgb, currentColor 30%, transparent); transition: background-color .3s, box-shadow .3s; }
:root[data-theme="dark"] .ls-rocker { transform: rotateY(-24deg); box-shadow: -2px 0 0 color-mix(in srgb, currentColor 22%, transparent); }
:root[data-theme="dark"] .ls-a { background: var(--surface); box-shadow: inset -1px 0 0 color-mix(in srgb, currentColor 55%, transparent); }
:root[data-theme="dark"] .ls-b { background: color-mix(in srgb, currentColor 16%, var(--surface)); box-shadow: none; }
:root[data-theme="dark"] .ls-led { background: var(--blue); box-shadow: 0 0 4px 1px var(--blue); }
/* Hover: the switch outline turns blue, like the other controls. Press: the rocker gives a little. */
.light-switch:hover .ls-plate, .light-switch:focus-visible .ls-plate { color: var(--blue); }
.light-switch:focus-visible { outline: none; }
.light-switch:focus-visible .ls-plate { outline: 2px solid var(--blue); outline-offset: 3px; }
.light-switch:active .ls-rocker { transform: rotateY(0deg); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .ls-rocker { transition: none; } }

/* Header: the same line as the side panel's edge, so the header reads clearly against the plan. */
.top { border-bottom-color: var(--green-line); }

/* Theme change: the whole page crossfades softly instead of snapping. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .6s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }

