/* Shared by the inner pages (My Work, Side Projects, About, Contact): page colours, breadcrumb, page head. */
.inner { --page: var(--blue); --fg: var(--ink); --dim: rgba(244, 241, 234, .58); --line: rgba(244, 241, 234, .2); --hud: rgba(255, 255, 255, .9);
  background: var(--page); color: var(--fg); }
.inner.paper { --page: var(--paper); --fg: var(--blue); --dim: rgba(11, 23, 192, .58); --line: rgba(11, 23, 192, .18); --hud: var(--blue); }
html:has(.inner) { background: var(--blue); }
html:has(.inner.paper) { background: var(--paper); }
.inner #bar-bg { background: var(--page); }

/* breadcrumb on the left of the bar: says which page this is, goes back to the landing */
.crumb { --b: calc(34px * var(--s, 1)); position: fixed; left: var(--gutter); top: calc(16px + (34px - var(--b)) / 2); height: var(--b); display: flex; align-items: center; z-index: 6; padding-left: calc(var(--b) + var(--sp-3));
  color: var(--fg); font-weight: 700; font-size: calc(var(--fs-label) * var(--s, 1)); text-decoration: none; }
/* home button, part of the bar: a square the height of the tabs with a pixel house (2 px grid, the site's pixel family) */
.crumb::before { content: ''; position: absolute; left: 0; top: 0; width: var(--b); height: var(--b); box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--fg) 55%, transparent);
  transition: background 160ms ease-out, border-color 160ms ease-out; }
.crumb::after { content: ''; position: absolute; left: calc(var(--b) * .265); top: calc(var(--b) * .265); width: calc(var(--b) * .47); height: calc(var(--b) * .47); background: var(--fg);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'><path d='M7 1h2v1H7zM6 2h4v1H6zM5 3h6v1H5zM4 4h8v1H4zM3 5h10v1H3zM2 6h12v1H2zM3 7h10v4H3zM3 11h4v4H3zM9 11h4v4H9z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'><path d='M7 1h2v1H7zM6 2h4v1H6zM5 3h6v1H5zM4 4h8v1H4zM3 5h10v1H3zM2 6h12v1H2zM3 7h10v4H3zM3 11h4v4H3zM9 11h4v4H9z'/></svg>") center / contain no-repeat; transition: background 160ms ease-out; }
@media (hover: hover) and (pointer: fine) {
  .crumb:hover::before { background: var(--fg); border-color: var(--fg); }
  .crumb:hover::after { background: var(--page); }
}
.crumb:active::before { background: var(--fg); }

.page { position: relative; z-index: 1; padding: 96px 0 0; min-height: 100vh; display: flex; flex-direction: column; }
.page > .ft { margin-top: auto; }             /* short pages: the footer still ends on the bottom edge */
.page-head { padding: 9vh var(--gutter) 2vh; }
.page-head .intro { max-width: 56ch; }
.intro { font-size: var(--fs-body); line-height: 1.6; color: var(--dim); }
.type-cursor { display: inline-block; margin-left: 1px; animation: blink 1s steps(1) infinite; }

/* section heads inside a page */
.sec { margin-top: 10vh; padding: 0 var(--gutter); }
/* section titles: the My Work category look (display face, XL), no numbers, no terminal prompt */
.sec-title { font-size: var(--fs-xl); line-height: var(--lh-xl); color: var(--fg); margin-bottom: var(--sp-7); }
.ph { color: var(--dim); }                                     /* [placeholder text to write] */

/* buttons / links */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--fg, var(--text)); color: var(--fg, var(--text)); background: transparent; cursor: pointer;
  font-weight: 700; text-decoration: none; transition: background 150ms ease-out, color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--fg, var(--text)); color: var(--page, var(--blue)); } }
.btn:active { transform: scale(.97); transition: transform 120ms ease-out; }

/* placeholder media box with HUD corners that open from the centre (same language as the landing frames) */
.box { position: relative; aspect-ratio: var(--ar, 4 / 3); background: rgba(255, 255, 255, .06); display: grid; place-items: center;
  color: var(--dim); }
.inner.paper .box { background: rgba(11, 23, 192, .06); }
.box .q { position: absolute; width: 50%; height: 50%; pointer-events: none; transition: transform 620ms var(--ease-out); }
.box .q.tl { left: 0; top: 0; transform: translate(100%, 100%); }
.box .q.br { right: 0; bottom: 0; transform: translate(-100%, -100%); }
.box .q::before { content: ''; position: absolute; width: 14px; height: 14px; border: 0 solid var(--hud); }
.box .q.tl::before { left: 6px; top: 6px; border-top-width: 1.5px; border-left-width: 1.5px; }
.box .q.br::before { right: 6px; bottom: 6px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.box > span { opacity: 0; transition: opacity 300ms ease-out 300ms; }
.box.seen .q { transform: none; }
.box.seen > span { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .box .q { transition: none; } }

/* alternating rows: media + text */
.rows { display: grid; gap: 12vh; }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 2vw; align-items: center; }
.row .box { grid-row: 1; grid-column: 1 / 7; }
.row .txt { grid-row: 1; grid-column: 8 / 13; }
.row:nth-child(even) .box { grid-column: 7 / 13; }
.row:nth-child(even) .txt { grid-column: 1 / 6; }
.txt h3 { font-size: var(--fs-m); line-height: var(--lh-m); margin-bottom: 12px; }
.txt p { font-size: var(--fs-body); line-height: 1.6; }
.meta-line { color: var(--dim); margin-bottom: 10px; }
@media (max-width: 760px) { .row .box, .row:nth-child(even) .box, .row .txt, .row:nth-child(even) .txt { grid-column: 1 / -1; } .row .txt { grid-row: 2; margin-top: 18px; } }

/* card grid (passions, projects) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 18px; }
.card h3 { font-size: var(--fs-m); line-height: var(--lh-m); margin: 14px 0 6px; }
.card p { font-size: var(--fs-small); line-height: 1.5; }

/* quote */

/* career timeline */
.timeline { list-style: none; border-top: 1px solid var(--line); max-width: 900px; }
.timeline li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 2vw; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--dim); padding-top: 4px; }
.timeline h3 { font-size: var(--fs-m); line-height: var(--lh-m); margin-bottom: 6px; }
.timeline p { font-size: var(--fs-body); line-height: 1.6; }
.after { margin-top: 32px; }

/* contact */

/* one app (js/app.js): inner pages open in this layer above the landing, which stays alive underneath */
#app-page { position: fixed; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain; background: var(--page); }
#app-page[hidden] { display: none; }
html.page-open { overflow: hidden; }
.crumb[hidden] { display: none; }

/* ---- footer (js/footer.js), landing + inner pages: ends the page on the pixel mountain, flush with the bottom ---- */
.ft { position: relative; padding: var(--sp-9) var(--gutter) 0; color: var(--fg, var(--text)); }
.ft a { color: inherit; text-decoration: none; }
.ft-meta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 22px 0; }
.ft-clocks { display: flex; gap: 22px; opacity: .75; font-variant-numeric: tabular-nums; }
.ft-clocks b { font-weight: 400; }
.ft-copyright { opacity: .55; }
.ft-totop { justify-self: end; opacity: .75; transition: opacity 150ms ease-out, color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .ft-totop:hover { opacity: 1; color: var(--orange); } }
.ft-ridge { display: block; width: calc(100% + 2 * var(--gutter)); margin: 4vh calc(-1 * var(--gutter)) 0; image-rendering: pixelated; }
@media (max-width: 760px) { .ft-meta { grid-template-columns: 1fr 1fr; } .ft-copyright { display: none; } }
.card.proj { color: inherit; text-decoration: none; }
.card.proj h3 { transition: color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .card.proj:hover h3 { color: var(--orange); } }

/* ---- contact: the email + four networks. Two looks (panel "Contact" on the page): white squares with the logos in
   their colours, or tiny App Store-like icons (rounded, brand colour, a bit of relief) ---- */
.cx { padding: 0 var(--gutter); }
@media (max-width: 640px) { .cx-nets { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); width: auto; } }
.cx-mailrow { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.cx-mail { font-family: var(--font-italic); font-style: italic; font-weight: var(--w-italic); font-size: var(--fs-xl); line-height: 1; letter-spacing: -.01em; color: var(--fg); text-decoration: none;
  background: linear-gradient(var(--orange), var(--orange)) left 100% / 0 3px no-repeat; transition: background-size 280ms var(--ease-out); padding-bottom: 6px; }
@media (hover: hover) and (pointer: fine) { .cx-mail:hover { background-size: 100% 3px; } }
.cx-nets { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: max-content; gap: var(--sp-5); margin-top: var(--sp-8); }
.cx-net { display: grid; justify-items: start; align-content: start; gap: var(--sp-2); color: var(--fg); text-decoration: none; }
.cx-name { margin-top: var(--sp-1); }
.cx-name { font-family: var(--font-text); font-size: var(--fs-small); font-weight: var(--w-strong); }
.cx-handle { font-family: var(--font-label); font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--dim); }
.cx-ico { display: block; position: relative; }
.cx-ico::before { content: ''; position: absolute; inset: 0; margin: auto; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; background: var(--logo-c); }
.cx-net[data-net="github"] { --logo: url(../assets/logos/github.svg); --brand: #181717; }
.cx-net[data-net="x"] { --logo: url(../assets/logos/x.svg); --brand: #000; }
.cx-net[data-net="linkedin"] { --logo: url(../assets/logos/linkedin.svg); --brand: #0a66c2; }
.cx-net[data-net="instagram"] { --logo: url(../assets/logos/instagram.svg); --brand: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
/* A: white squares, logos in their colours */
[data-cx="white"] .cx-ico { width: 88px; height: 88px; background: var(--ink); transition: transform 200ms var(--ease-out); }
[data-cx="white"] .cx-ico::before { width: 40px; height: 40px; --logo-c: var(--brand); }
@media (hover: hover) and (pointer: fine) { [data-cx="white"] .cx-net:hover .cx-ico { transform: translateY(-3px); } }
/* B: tiny App Store icons: rounded square in the brand colour, white glyph, gloss on top, soft shadow under */
[data-cx="app"] .cx-ico { width: 54px; height: 54px; border-radius: 24%; background: var(--brand); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 6px rgba(0, 0, 0, .28), 0 1px 1px rgba(0, 0, 30, .3), 0 8px 18px rgba(0, 0, 40, .35);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease-out; }
[data-cx="app"] .cx-ico::before { width: 26px; height: 26px; --logo-c: #fff; z-index: 1; }
[data-cx="app"] .cx-ico::after { content: ''; position: absolute; inset: 0 0 48% 0; background: linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); border-radius: 24% 24% 40% 40% / 24% 24% 18% 18%; }
[data-cx="app"] .cx-net[data-net="github"] .cx-ico, [data-cx="app"] .cx-net[data-net="x"] .cx-ico { background: linear-gradient(#2b2b2b, #0d0d0d); }
@media (hover: hover) and (pointer: fine) { [data-cx="app"] .cx-net:hover .cx-ico { transform: translateY(-2px) scale(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 6px rgba(0, 0, 0, .28), 0 2px 2px rgba(0, 0, 30, .3), 0 12px 24px rgba(0, 0, 40, .4); } }
.cx-net:active .cx-ico { transform: scale(.96); }
.cx-net.ph .cx-ico { opacity: .55; }
/* C: pixel icons (default): the same app icons drawn on the site's pixel grid. 13 x 13 glyphs at 2 px, stepped
   corners instead of a radius, flat brand colour with a 4 px light band on top and dark band below, hard pixel shadow;
   hover lifts it, press pushes it into its shadow */
[data-cx="pixel"] .cx-net[data-net="github"] { --logo: url(../assets/logos/pixel/github.svg); --brand: #1b1b1b; }
[data-cx="pixel"] .cx-net[data-net="x"] { --logo: url(../assets/logos/pixel/x.svg); --brand: #1b1b1b; }
[data-cx="pixel"] .cx-net[data-net="linkedin"] { --logo: url(../assets/logos/pixel/linkedin.svg); }
[data-cx="pixel"] .cx-net[data-net="instagram"] { --logo: url(../assets/logos/pixel/instagram.svg); --brand: linear-gradient(135deg, #feda75, #fa7e1e 30%, #d62976 60%, #962fbf 80%, #4f5bd5); }
[data-cx="pixel"] .cx-ico { width: 52px; height: 52px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 40, .45)); transition: transform 200ms var(--ease-out), filter 200ms var(--ease-out); }
[data-cx="pixel"] .cx-ico::after { content: ''; position: absolute; inset: 0; background: var(--brand);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .26), inset 0 -4px 0 rgba(0, 0, 0, .28);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px),
    0 8px, 4px 8px, 4px 4px, 8px 4px); }
[data-cx="pixel"] .cx-ico::before { width: 26px; height: 26px; --logo-c: #fff; z-index: 1; }
@media (hover: hover) and (pointer: fine) { [data-cx="pixel"] .cx-net:hover .cx-ico { transform: translate(-2px, -2px); filter: drop-shadow(6px 6px 0 rgba(0, 0, 40, .45)); } }
[data-cx="pixel"] .cx-net:active .cx-ico { transition-duration: 80ms; transform: translate(3px, 3px); filter: drop-shadow(1px 1px 0 rgba(0, 0, 40, .45)); }
/* links written inside texts (CMS): underlined, orange on hover */
.intro a, .t-body a, .txt p a, .card p a, .tl-text a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .intro a:hover, .t-body a:hover, .txt p a:hover, .card p a:hover, .tl-text a:hover { color: var(--orange); } }
.box.has-anim > span, .box.has-media > span { display: none; }
.box.has-media > .pa { display: none; }   /* a real image / video from the CMS replaces the animation */
/* a picture in an icon (the X one: profile picture, set in the CMS): same pixel frame, same bands, same motion */
.cx-ico > .cms-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; image-rendering: pixelated; }
[data-cx="pixel"] .cx-ico > .cms-media { clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px),
    0 8px, 4px 8px, 4px 4px, 8px 4px); }
[data-cx="app"] .cx-ico > .cms-media { border-radius: 24%; }
.cx-ico.has-media::before { display: none; }
[data-cx="pixel"] .cx-ico.has-media::after { z-index: 2; background: transparent; }
.cx-ico .cms-chips { top: auto; bottom: calc(100% + 4px); right: auto; left: 0; flex-direction: column; }

/* texts emptied in the CMS take no room outside edit mode; a section without its title closes up under the page title */
html:not(.cms-on) .cms-empty { display: none; }
html:not(.cms-on) .sec:has(> .sec-title.cms-empty) { margin-top: var(--sp-6); }
html:not(.cms-on) .page-head:has(> .intro.cms-empty) .page-title { margin-bottom: 0; }
/* titles, one size per level, whatever was typed in the CMS: page titles in Grain, section titles in the display face */
.page-title { margin-bottom: var(--sp-5); color: var(--fg); font-family: var(--font-accent); font-style: normal; font-weight: 400; letter-spacing: 0; font-size: var(--fs-page); line-height: .9; }
.sec-title { font-size: var(--fs-section); line-height: .98; }   /* same size as the My Work categories (css/work.css) */
@media (max-width: 720px) {
  .crumb { font-size: 0; padding-left: var(--b); }               /* home: the icon only, the tabs need the room */
  .page { padding-top: 76px; }
  .page-head { padding: 4vh var(--gutter) 1vh; }
  .sec { margin-top: 7vh; }
  .cx-mail { font-size: clamp(30px, 9vw, 44px); overflow-wrap: anywhere; }
  .cx-nets { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: var(--sp-6) var(--sp-4); }
  .cards { grid-template-columns: 1fr !important; }
  .rows .row { grid-template-columns: 1fr !important; }
  .rows .row .box, .rows .row .txt { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .timeline li { grid-template-columns: 1fr; gap: var(--sp-2); }
  .ft-meta { grid-template-columns: 1fr auto; } .ft-clocks { flex-direction: column; gap: 2px; }
}

/* ---- About: one paragraph, then small still icons of what I love (rendered by js/about3d.js renderIcon) ---- */
.me-text { max-width: 60ch; font-size: var(--fs-m); line-height: 1.5; }
.me-text a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .me-text a:hover { color: var(--orange); } }
.me-icons { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-6); margin-top: var(--sp-8); }
.me-icons li { display: grid; justify-items: center; gap: var(--sp-2); }
.me-icons img { width: 88px; height: 88px; image-rendering: pixelated; }
.me-icons span { font-family: var(--font-label); font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--dim); }
@media (max-width: 720px) { .me-text { font-size: var(--fs-body); } .me-icons { gap: var(--sp-4); } .me-icons img { width: 64px; height: 64px; } }
