/* DanielLynas.com: one pinned stage, line-art drawing in the middle, bold black type around it. Light only. */
:root {
  --paper: #ffffff;
  --ink: #0c0c0e;
  --off: #0c0c0e40;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
:root { --blue: #1b3a8c; --green: #1e6b3c; --red: #b3132f; --purple: #5a2a86; --rust: #b0461a; --teal: #0d6b6b; --ochre: #a8740a; --slate: #3e5871; }
:root[data-theme="dark"] { --paper: #0b0b0d; --ink: #f3f3f0; --off: #f3f3f040; color-scheme: dark; --blue: #3354c4; --green: #278a4e; --red: #a3172f; --purple: #63308f; --rust: #c4531f; --teal: #16817f; --ochre: #b8840f; --slate: #4f6f8c; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); transition: background .3s, color .3s; font: 600 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, p { margin: 0; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gutter);
  pointer-events: none;
}
.top a { pointer-events: auto; text-decoration: none; }
.mark { display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
/* the logo: a small glassy cube drawn by js/logo.js */
.cube { width: 22px; height: 22px; flex: none; display: block; }
.top-right { display: flex; align-items: center; gap: 22px; }
.top-mail { font-weight: 800; font-size: 14px; border-bottom: 2px solid var(--ink); padding: 3px 0 1px; }   /* top padding balances the underline so the text centres */
.theme { pointer-events: auto; font: 800 13px/1 var(--sans); color: var(--ink); background: none; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.theme:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 1100px) { .top-mail { display: none; } }   /* keeps the name, nav and switch on one line */

/* ---- section nav, in the header */
.nav { pointer-events: auto; display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.nav a { text-decoration: none; font-weight: 800; font-size: 17px; text-transform: uppercase; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 9px; padding: 4px 0; border-top: 2px solid transparent; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a[data-c]::before { content: ""; width: 13px; height: 13px; border-radius: 3px; background: var(--c); flex: none; }
.nav a[data-c="blue"] { --c: var(--blue); } .nav a[data-c="green"] { --c: var(--green); }
.nav a[data-c="red"] { --c: var(--red); } .nav a[data-c="purple"] { --c: var(--purple); }
.nav a[data-c="ink"] { --c: var(--ink); }
.nav a[data-c="rust"] { --c: var(--rust); } .nav a[data-c="teal"] { --c: var(--teal); } .nav a[data-c="ochre"] { --c: var(--ochre); } .nav a[data-c="slate"] { --c: var(--slate); }
/* ETC's swatch: its four scenes' colours in quarters, as the tiles sit on its overview */
.nav a[data-c="etc"] { --c: conic-gradient(var(--teal) 0 25%, var(--slate) 0 50%, var(--ochre) 0 75%, var(--rust) 0); }
/* ETC's sub-links: shown under it on hover, and kept open while one of its scenes is on */
.etc { position: relative; display: inline-flex; }
.subnav { position: absolute; top: 100%; left: 50%; display: flex; gap: 16px; padding: 7px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
  opacity: 0; visibility: hidden; transform: translate(-50%, -4px); transition: opacity .18s, transform .18s, visibility 0s .18s; }
html.in-etc .subnav { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s; }
/* on hover only where there is real hover (a mouse or trackpad), and for keyboard focus: on touch screens a hover reveal
   makes the first tap on ETC only open the menu (iOS), so there it opens with the ETC scenes instead */
@media (hover: hover) { .etc:hover .subnav { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s; } }
.etc:has(:focus-visible) .subnav { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s; }
.subnav a { font-size: 13px; gap: 7px; }
.subnav a[data-c]::before { width: 10px; height: 10px; border-radius: 2px; }
.nav a.on, .nav a:hover { border-bottom-color: var(--ink); }
/* no backdrop blur: some mobile browsers won't draw the 3D logo cube inside a blurred parent */
.top { background: color-mix(in srgb, var(--paper) 94%, transparent); pointer-events: auto; }
@media (max-width: 900px) {
  .top { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 10px; row-gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; gap: 10px; justify-content: space-between; }
  .nav a { font-size: 13.5px; letter-spacing: 0.01em; gap: 6px; }
  .nav a[data-c]::before { width: 11px; height: 11px; }
  .etc { position: static; }   /* the sub-links drop below the whole header, as a row */
  .subnav { left: 0; right: 0; justify-content: center; border-radius: 0; border-width: 0 0 2px; transform: translateY(-4px); }
  html.in-etc .subnav, .etc:hover .subnav, .etc:has(:focus-visible) .subnav { transform: none; }
  .subnav a { font-size: 12px; }
  .nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 360px) {
  .nav { gap: 6px; }
  .nav a { font-size: 11.5px; letter-spacing: 0; gap: 4px; }
  .nav a[data-c]::before { width: 9px; height: 9px; }
}

/* ---- the track: one screen per chapter; the stage is pinned over all of them */
.track { position: relative; }
.track > section { height: 100vh; height: 100svh; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
  overflow: hidden; z-index: 1;
}
#gl, #ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl { touch-action: pan-y; cursor: grab; -webkit-tap-highlight-color: transparent; }
#ov { pointer-events: none; }
#gl, #ov { transition: opacity .3s ease; }
.stage.fading #gl, .stage.fading #ov { opacity: 0; }

/* ---- chapter copy, top left */
.copy {
  position: absolute; left: var(--gutter); top: clamp(84px, 13vh, 140px); max-width: min(calc(30rem * var(--ts, 1)), calc(100% - 2 * var(--gutter)));
  pointer-events: none; will-change: opacity, transform;
}
.copy a { pointer-events: auto; }
.copy h1, .copy h2 { font-weight: 900; letter-spacing: -0.02em; line-height: 0.96; font-size: calc(clamp(2.1rem, 4.8vw, 4.1rem) * var(--ts, 1)); text-transform: uppercase; }
.copy[data-ch="1"] { --c: var(--blue); } .copy[data-ch="2"] { --c: var(--green); }
.copy[data-ch="3"] { --c: var(--hred, var(--red)); } .copy[data-ch="4"] { --c: var(--hpurple, var(--purple)); }
.copy[data-ch="6"] { --c: var(--rust); } .copy[data-ch="7"] { --c: var(--hteal, var(--teal)); } .copy[data-ch="8"] { --c: var(--ochre); } .copy[data-ch="9"] { --c: var(--hslate, var(--slate)); }
/* section headings in their scene's colour (night uses lighter red and purple so they stay crisp on near-black) */
.copy h2 { color: var(--c, var(--ink)); }
:root[data-theme="dark"] { --hred: #e3202d; --hpurple: #8e55cb; --hteal: #1fa3a0; --hslate: #7f9dbb; }
.copy p { margin-top: calc(16px * var(--ts, 1)); font-size: calc(clamp(1.02rem, 1.3vw, 1.16rem) * var(--ts, 1)); font-weight: 600; max-width: 26em; }
.copy .email { display: inline-block; margin-top: 22px; font-weight: 800; font-size: calc(clamp(1.3rem, 2.4vw, 1.9rem) * var(--ts, 1)); letter-spacing: -0.02em; text-decoration: none; border-bottom: 3px solid var(--ink); overflow-wrap: anywhere; }

/* ---- one swipe (or wheel flick, or key press) = one scene: each section is a snap point that can't be skipped past */
/* (only once the stage is running: before that the sections are hidden and the footer would be the only snap point) */
html.gl-ready { scroll-snap-type: y mandatory; }
.gl-ready .track > section { scroll-snap-align: start; scroll-snap-stop: always; }
.gl-ready .foot { scroll-snap-align: end; }
/* touch screens: the page reads vertical swipes itself (one swipe = one scene), so the browser never pans or flings it */
@media (pointer: coarse) {
  html.gl-ready, html.gl-ready body, html.gl-ready #gl { touch-action: pinch-zoom; }
  html.gl-ready .nav { touch-action: pan-x pinch-zoom; }
}

/* ---- footer */
.foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 22px var(--gutter) 28px; font: 700 12px/1.5 var(--mono); color: var(--ink); border-top: 2px solid var(--ink); background: var(--paper); }

/* ---- without WebGL (or scripts): the copy simply stacks */
.no-gl .stage, html:not(.js):not(.gl-ready) .stage { position: static; height: auto; margin: 0; padding: 96px var(--gutter) 40px; }
.no-gl .copy, html:not(.js):not(.gl-ready) .copy { position: static; opacity: 1 !important; visibility: visible !important; transform: none !important; margin-bottom: 56px; max-width: 34rem; }
.no-gl #gl, .no-gl #ov, html:not(.js):not(.gl-ready) #gl, html:not(.js):not(.gl-ready) #ov { display: none; }
.no-gl .track > section, html:not(.js):not(.gl-ready) .track > section { display: none; }
/* while the stage is loading (scripts on, not ready yet): a blank stage, no text flashing in the wrong place */
html.js:not(.gl-ready):not(.no-gl) .copy, html.js:not(.gl-ready):not(.no-gl) .foot { visibility: hidden; }

/* ---- touch screens: the page itself never scrolls. One fixed screen; each swipe changes the scene by exactly one
   (js/app.js), so no browser momentum can ever skip a scene. The footer slides up after the last scene. */
html.touch-mode, html.touch-mode body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.touch-mode .track > section { display: none; }
.touch-mode .stage { position: fixed; inset: 0; height: 100%; margin: 0; }
.touch-mode .foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; transform: translateY(100%); transition: transform .35s ease; }
.touch-mode.foot-open .foot { transform: none; }

/* ---- the name in caps, like the nav */
.mark span { text-transform: uppercase; letter-spacing: 0.02em; }

/* ---- no lonely last words: headings wrap into balanced lines (when js/type.js can't fit them on one), paragraphs wrap prettily */
.copy h1, .copy h2 { text-wrap: balance; }
.copy p { text-wrap: pretty; }

/* a section's text that is faded out: still in the document for screen readers and search engines, but not clickable */
.copy.off, .copy.off a { pointer-events: none; }

/* ---- text cards: each section's text sits on a card with its own foundation: stacked layers in the section colour
   along the bottom and the right side, like the scenes' plinths */
html.cards.gl-ready .copy {
  background: var(--paper); border: 2px solid var(--ink); border-radius: calc(16px * var(--ts, 1));
  padding: calc(22px * var(--ts, 1)) calc(26px * var(--ts, 1)) calc(26px * var(--ts, 1));
  box-shadow:
    6px 6px 0 -2px var(--cb, var(--c, var(--ink))), 6px 6px 0 0 var(--ink),
    12px 12px 0 -2px var(--cb, var(--c, var(--ink))), 12px 12px 0 0 var(--ink);
}
html.cards.gl-ready .copy[data-ch="0"], html.cards.gl-ready .copy[data-ch="5"] { --cb: var(--paper); }

/* day <-> night: a slow, even dissolve between the two looks (see the theme button in app.js) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- ETC: four small heading-only cards, one per scene, each in its colour and each a link to it */
html.cards.gl-ready .copy.etc-cards { background: none; border: 0; box-shadow: none; padding: 0; }
.etc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: calc(22px * var(--ts, 1)) calc(28px * var(--ts, 1)); }
.etc-cards .mini {
  display: block; text-decoration: none; background: var(--paper); border: 2px solid var(--ink); border-radius: calc(12px * var(--ts, 1));
  padding: calc(16px * var(--ts, 1)) calc(22px * var(--ts, 1)) calc(18px * var(--ts, 1));
  box-shadow: 5px 5px 0 -2px var(--c), 5px 5px 0 0 var(--ink), 10px 10px 0 -2px var(--c), 10px 10px 0 0 var(--ink);
  transition: translate .15s;
}
.etc-cards .mini:hover { translate: -2px -2px; }
.etc-cards h3 { margin: 0; font-weight: 900; letter-spacing: -0.02em; line-height: 0.96; text-transform: uppercase; color: var(--c); font-size: calc(clamp(1.45rem, 2.5vw, 2.2rem) * var(--ts, 1)); }
.etc-cards [data-c="rust"] { --c: var(--rust); } .etc-cards [data-c="teal"] { --c: var(--hteal, var(--teal)); }
.etc-cards [data-c="ochre"] { --c: var(--ochre); } .etc-cards [data-c="slate"] { --c: var(--hslate, var(--slate)); }

/* ---- the work card: three sections under their own headings, each closed until opened (one open at a time). The
   card keeps one width whatever is open, and the page re-composes round its new height. */
.work-copy { width: min(calc(30rem * var(--ts, 1)), 100%); }
.work-copy .sections { margin-top: calc(12px * var(--ts, 1)); border-top: 2px solid var(--ink); }
.work-copy .sections > details { border-bottom: 2px solid var(--ink); }
.work-copy .sections > details > summary { pointer-events: auto; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 9px; padding: calc(10px * var(--ts, 1)) 0; }
.work-copy .sections > details > summary::-webkit-details-marker { display: none; }
.work-copy .sections > details > summary::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 2px; background: linear-gradient(90deg, var(--c) 50%, var(--c2, var(--c)) 50%); }
.work-copy .sections > details > summary::after { content: ""; margin: 0 3px 0 auto; width: calc(8px * var(--ts, 1)); height: calc(8px * var(--ts, 1)); border: solid var(--ink); border-width: 0 2.5px 2.5px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .2s, translate .2s; }
.work-copy .sections > details[open] > summary::after { rotate: 225deg; translate: 0 2px; }
.work-copy summary h3 { margin: 0; font: 800 calc(15px * var(--ts, 1))/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.02em; }
.work-copy .sections > details > summary:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.work-copy .body > :last-child { margin-bottom: calc(12px * var(--ts, 1)); }   /* (a margin inside, not padding: the body can slide all the way shut) */
.work-copy p, .work-copy li { font-size: calc(clamp(0.95rem, 1.15vw, 1.05rem) * var(--ts, 1)); }
.work-copy p { margin-top: calc(6px * var(--ts, 1)); max-width: none; }
.work-copy ul { list-style: none; margin: calc(8px * var(--ts, 1)) 0 0; padding: 0; }
.work-copy li { position: relative; padding-left: 18px; margin-top: 6px; font-weight: 700; line-height: 1.35; }
.work-copy li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.work-copy li span { display: block; font-weight: 500; }
.work-copy .links a { border-bottom: 2px solid var(--ink); text-decoration: none; }
/* each section in its own colours: its heading's swatch and its bullets (design and IT is both) */
.work-copy [data-tab="0"] { --c: var(--blue); --c2: var(--green); } .work-copy [data-tab="1"] { --c: var(--hred, var(--red)); } .work-copy [data-tab="2"] { --c: var(--hpurple, var(--purple)); }
.work-copy [data-tab="0"] li:nth-child(even)::before { background: var(--c2); }
/* phones: the work card is the longest text on the site, so it sets tighter there and the drawing keeps some room */
@media (max-width: 600px) {
  .work-copy .sections > details > summary { padding: 8px 0; }
  .work-copy summary h3 { font-size: 13px; }
  .work-copy p, .work-copy li { font-size: 13px; }
  .work-copy li { margin-top: 4px; padding-left: 14px; line-height: 1.3; }
  .work-copy li::before { width: 6px; height: 6px; }
  .work-copy li span { font-size: 12px; }
  .work-copy h2 { font-size: 2rem; }
}

/* a second paragraph on a card follows closely, as a line break would */
.copy p.more { margin-top: calc(8px * var(--ts, 1)); }

/* ---- a site preview on the work card: a small browser window playing the site's own frames (a slow cross-fade with a
   push-in); moving across it scrubs through them, and it opens the site */
.work-copy .site { display: block; margin-top: 10px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; text-decoration: none; background: var(--paper);
  box-shadow: 5px 5px 0 -2px var(--c), 5px 5px 0 0 var(--ink); transition: translate .15s; }
.work-copy .site:hover { translate: -2px -2px; }
.work-copy .site .bar { display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-bottom: 2px solid var(--ink); font: 700 12px/1 var(--mono); }
.work-copy .site .bar i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); }
.work-copy .site .bar span { margin-left: 8px; }
.work-copy .site .screen { position: relative; display: block; aspect-ratio: 16 / 10; background: #0b0b0d; overflow: hidden; }
.work-copy .site .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; scale: 1; transition: opacity .9s, scale 4s linear; }
.work-copy .site .screen img.on { opacity: 1; scale: 1.06; }
.work-copy .site .ticks { display: flex; gap: 3px; padding: 6px 9px 7px; border-top: 2px solid var(--ink); height: 19px; box-sizing: border-box; }   /* the same height before its ticks are added */
.work-copy .site .ticks b { flex: 1; height: 4px; border-radius: 2px; background: var(--ink); opacity: .18; transition: opacity .3s; }
.work-copy .site .ticks b.on { opacity: 1; background: var(--c); }
@media (prefers-reduced-motion: reduce) { .work-copy .site .screen img { transition: opacity .2s; } .work-copy .site .screen img.on { scale: 1; } }
.work-copy .site { width: min(100%, calc(260px * var(--ts, 1))); }   /* small enough that the open card fits a laptop screen */

/* items inside a section: each with a detail line is its own small disclosure, closed until clicked. Every toggle
   shows a chevron, pointing down while closed and up once open */
.work-copy li details summary, .work-copy details.more > summary { pointer-events: auto; cursor: pointer; list-style: none; display: inline; }
.work-copy li details summary::-webkit-details-marker, .work-copy details.more > summary::-webkit-details-marker { display: none; }
.work-copy li details summary::after, .work-copy details.more > summary::after { content: ""; display: inline-block; vertical-align: middle; margin-left: 8px; width: 6px; height: 6px; border: solid var(--ink); border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -3px; transition: rotate .2s, translate .2s; }
.work-copy li details[open] summary::after, .work-copy details.more[open] > summary::after { rotate: 225deg; translate: 0 0; }
.work-copy li details summary:hover, .work-copy details.more > summary:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.work-copy li details span { margin-top: 2px; }
.work-copy details.more { margin-top: calc(10px * var(--ts, 1)); }
.work-copy details.more > summary { font-weight: 700; font-size: calc(clamp(0.95rem, 1.15vw, 1.05rem) * var(--ts, 1)); }

/* two previews side by side where the card is wide enough */
.work-copy details.more:has(.site + .site) .site { display: inline-block; vertical-align: top; width: calc(50% - 10px); }
.work-copy details.more .site + .site { margin-left: 12px; }
.work-copy .site .bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the sliding parts lay out the same while they slide (clipped) as after, so nothing jumps when a slide ends */
.work-copy details > .body, .work-copy li details > span { display: flow-root; }
