/* Swiss layout with a rounded geometric font (Outfit). Shared by the site and the editor. */
:root {
  --ink: #111111;
  --soft: #77746e;
  --line: #e6e3dd;
  --paper: #ffffff;
  --accent: #F0AD00;
  --side: 250px;
  --gap: 2px;
  --cell: 180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: "Outfit", "Helvetica Neue", Arial, sans-serif; font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

#app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
#side { position: sticky; top: 0; height: 100vh; padding: 34px 26px; display: flex; flex-direction: column; gap: 34px; }
#brand { display: flex; flex-direction: column; gap: 8px; }
#name { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.05; }
#role { font-size: 14px; color: var(--soft); line-height: 1.4; font-weight: 300; }

/* Bookmarks: one per section, the one in view lit by the accent ribbon. */
#nav { display: flex; flex-direction: column; gap: 2px; }
.bm { position: relative; display: flex; align-items: baseline; gap: 12px; padding: 7px 0 7px 16px; text-decoration: none; color: var(--soft); font-size: 16px; transition: color .25s; }
.bm .no { font-size: 12px; font-weight: 600; width: 18px; color: var(--line); transition: color .25s; }
.bm::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .45s var(--ease); }
.bm:hover { color: var(--ink); }
.bm.on { color: var(--ink); font-weight: 600; }
.bm.on .no { color: var(--accent); }
.bm.on::before { transform: scaleY(1); }

/* Links as logos, drawn in ink through a mask so every logo has the same weight. */
#links { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lk { display: inline-flex; width: 22px; height: 22px; color: var(--ink); opacity: .75; transition: opacity .2s, transform .2s; text-decoration: none; }
.lk:hover { opacity: 1; transform: translateY(-2px); }
.lk .ic { width: 100%; height: 100%; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.lk .tx { font-size: 13px; line-height: 22px; white-space: nowrap; }
.lk.text { width: auto; }

#main { padding: 34px 34px 40vh; min-width: 0; }
.sec { scroll-margin-top: 24px; margin-bottom: 72px; }
.sec-title { font-size: 64px; font-weight: 700; letter-spacing: -2px; line-height: 1; margin: 0 0 26px; display: flex; gap: 16px; align-items: baseline; }
.sec-title .n { color: var(--accent); }

/* Asymmetric grid: a tile spans W columns and H rows (up to 4×3 / 3×4); dense flow fills the holes. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); grid-auto-rows: var(--cell); grid-auto-flow: dense; gap: var(--gap); }
.tile { position: relative; overflow: hidden; background: #f1efeb; cursor: zoom-in; border-radius: 2px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.tile:not(.open):hover img { transform: scale(1.03); }
.tile .t { position: absolute; left: 0; bottom: 0; right: 0; padding: 10px 12px; font-size: 13px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .25s; pointer-events: none; }
.tile:hover .t { opacity: 1; }
/* Open view: a fixed layer; the mask grows from the tile to the screen and pushes the page away (see site.js). */
.pv { position: fixed; inset: 0; z-index: 40; overflow: hidden; }
.pv[hidden] { display: none; }
.pv.scroll { overflow-y: auto; }
.pv-mask { position: absolute; overflow: hidden; background: #0d0d0d; cursor: zoom-out; }
.pv-img { position: absolute; max-width: none; display: block; }
.pv-ui > * { opacity: 0; transition: opacity .35s ease-out; }
.pv.ready .pv-ui > * { opacity: 1; }
/* The white band over the view: section number and title, then the project title (it fades when it changes). */
.pv-head { position: fixed; top: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 22px; padding: 0 64px 0 34px; background: var(--paper); }
.pv-head .sec-title { margin: 0; }
.pv-t { font-size: 22px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-x { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); border: 0; background: none; color: var(--ink); font-size: 34px; line-height: 1; cursor: pointer; padding: 6px 10px; }
.pv-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 30px; width: 44px; height: 64px; cursor: pointer; border-radius: 4px; }
.pv-nav:hover { background: rgba(255,255,255,.22); }
.pv-nav.prev { left: 14px; }
.pv-nav.next { right: 14px; }
.pv.single .pv-nav, .pv.single .strip { visibility: hidden; }
.strip { position: absolute; left: 0; right: 0; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 0 14px; overflow-x: auto; z-index: 2; }
.shot { flex: 0 0 auto; height: 62px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 3px; background: #222; cursor: pointer; overflow: hidden; opacity: .6; transition: opacity .2s, border-color .2s; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover { opacity: 1; }
.shot.on { border-color: var(--accent); opacity: 1; }
.shot.first { margin-left: 14px; } /* a new project starts: a little more space */

.pre { opacity: 0; }
.page { max-width: 680px; font-size: 18px; line-height: 1.65; font-weight: 300; }
.page p { margin: 0 0 1em; }
.empty { color: var(--soft); }

/* About at the foot of the side panel (built by site.js), desktop only: the phone keeps About as a section. */
#side-about { display: none; }
@media (min-width: 761px) {
  #side { overflow-y: auto; }
  .about-side #side-about { display: block; margin-top: auto; font-size: 13px; line-height: 1.5; font-weight: 300; color: var(--soft); overflow-wrap: anywhere; }
  .about-side #side-about p { margin: 0 0 .7em; }
  .about-side #links { margin-top: 0; }
  .about-side #about, .about-side .bm[data-id="about"] { display: none; }
}
/* Short laptop screens (about 650 px of page under the browser bar): tighter panel so the links stay in view. */
@media (min-width: 761px) and (max-height: 760px) {
  #side { padding: 22px 26px; gap: 18px; }
  .bm { padding: 5px 0 5px 16px; }
  .about-side #side-about { font-size: 12px; line-height: 1.4; }
  .about-side #side-about p { margin-bottom: .55em; }
}

/* Night colours when the phone or PC uses a dark theme. Not in the editor, whose own styles are light. */
@media (prefers-color-scheme: dark) {
  :root:not(:has(body.editing)) { --ink: #ecebe8; --soft: #9a978f; --line: #3a3934; --paper: #161616; }
  body:not(.editing) .tile { background: #242424; }
}

@media (max-width: 760px) {
  :root { --cell: 140px; }
  #app { grid-template-columns: 1fr; }
  #side { position: sticky; top: 0; z-index: 5; height: auto; padding: 14px 16px; gap: 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
  #name { font-size: 22px; }
  #role { display: none; }
  #nav { flex-direction: row; gap: 4px 14px; flex-wrap: wrap; }
  .bm { padding: 4px 0 6px; }
  .bm .no { display: none; }
  .bm::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 3px; transform: scaleX(0); transform-origin: left; }
  .bm.on::before { transform: scaleX(1); }
  #links { margin-top: 0; }
  #main { padding: 20px 16px 30vh; }
  .sec-title { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
