@font-face {
  font-family: "Archivo Variable";
  src: url("assets/fonts/archivo-variable.woff2") format("woff2-variations"), url("assets/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
:root {
  --bg: #000;
  --fg: #fff;
  --dim: #8c8c8c;
  --gutter: 16px;
  --tile: clamp(160px, 22vw, 300px);
  --font: "Archivo Variable", "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
body { font: 500 13px/1.15 var(--font); letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font: inherit; }

header {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: var(--gutter);
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
header a { pointer-events: auto; }
.brand { display: block; padding: 10px 0; color: var(--fg); transition: color .2s; }
.brand:hover { color: var(--dim); }
body[data-view="home"] .brand { visibility: hidden; }   /* the big title on the home page says it */
header nav { display: flex; gap: clamp(18px, 3vw, 34px); }
header nav a { position: relative; display: block; padding: 10px 0; color: var(--fg); }
/* iridescent underline: grows on hover, stays on the current page */
header nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px;
  background: linear-gradient(90deg, #3ff5e0, #5a7bff, #a56bff); transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
header nav a:hover::after, header nav a[aria-current="page"]::after,
body[data-view="work"] header a[data-nav="work"]::after,
body[data-view="about"] header a[data-nav="about"]::after,
body[data-view="contact"] header a[data-nav="contact"]::after { transform: scaleX(1); }

main { position: fixed; inset: 0; }
#trail { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.view {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility 0s .5s;
}
body[data-view="work"] #work,
body[data-view="about"] #about { opacity: 1; visibility: visible; transition-delay: 0s; }
body:not([data-view="home"]):not([data-view="work"]) #trail { opacity: 0; transition: opacity .4s; }

/* Work strip: infinite loop, moved with transform (see work.js) */
#strip, #mstrip {
  position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden;
  padding: 0 0 calc(var(--gutter) + env(safe-area-inset-bottom));
}
#strip { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#strip.dragging { cursor: grabbing; }
#track, #mtrack { display: flex; align-items: flex-end; gap: var(--gutter); width: max-content; will-change: transform; }
.item { flex: 0 0 auto; width: var(--tile); display: block; user-select: none; }
.item .tile { position: relative; width: 100%; height: var(--tile); transition: height .7s cubic-bezier(.2,.7,.2,1); }
/* hover: the tile grows taller (it grows upward, the names stay put) */
.item:hover .tile, .mitem.hover .tile { height: calc(var(--tile) * 1.42); }
.item .meta { margin-top: 8px; min-height: 2.4em; }
/* the name reacts on hover / keyboard focus: brighter, and an iridescent underline draws */
.item .meta span { position: relative; display: inline-block; padding-bottom: 3px; color: var(--dim); transition: color .35s; }
.item .meta span::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, #3ff5e0, #5a7bff, #a56bff); transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.item:hover .meta span, .item:focus-visible .meta span { color: var(--fg); }
.item:hover .meta span::before, .item:focus-visible .meta span::before { transform: scaleX(1); }
.item:focus-visible { outline: none; }
.item:focus-visible .tile { outline: 2px solid #3ff5e0; outline-offset: 4px; }

/* live windows: a black layer with white squares (multiplied) lets the animation show only inside the tiles */
#mask { position: absolute; inset: 0; background: #000; mix-blend-mode: multiply; pointer-events: none; }
.mitem .tile { background: #fff; }
.mitem .meta { visibility: hidden; }

/* fallback (no WebGL, or reduced motion): still iridescent gradients, no animation layer */
html.no-fluid #trail { display: none; }
html.no-fluid body[data-view="work"] .fluid-base { display: none; }
html.no-fluid body[data-view="home"] .fluid-base { opacity: .85; }
html.no-fluid .item .tile {
  overflow: hidden; background-size: 190% 190%; background-position: 20% 30%; background-repeat: no-repeat;
  transition: height .7s cubic-bezier(.2,.7,.2,1), background-position 1.6s cubic-bezier(.2,.7,.2,1);
}
html.no-fluid .item .tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html.no-fluid .item:hover .tile { background-position: 85% 75%; }

/* About */
.info {
  position: absolute; inset: 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); align-content: end;
  padding-bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
}
.info p { margin-bottom: 1.15em; max-width: 34ch; }
.info h2 { color: var(--dim); margin-bottom: .3em; }
.info ul { margin-bottom: 1.15em; }
.info a:hover { color: var(--dim); }

@media (max-width: 720px) {
  .hide-mobile { display: none; }
  .info { grid-template-columns: 1fr; align-content: start; padding-top: 130px; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* page transitions (cross-document View Transitions; browsers without support simply navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
::view-transition-group(case-cover) { animation-duration: .9s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
::view-transition-old(case-cover), ::view-transition-new(case-cover) { height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* cookie / analytics consent panel */
#consent {
  position: fixed; right: var(--gutter); bottom: max(var(--gutter), env(safe-area-inset-bottom)); z-index: 60;
  width: min(340px, calc(100vw - 2 * var(--gutter))); padding: 14px 16px 16px; background: #000; color: #fff;
  border: 1px solid #333; font-size: 13px; line-height: 1.3;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease, visibility 0s .4s; view-transition-name: consent;
}
#consent.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
#consent p { margin: 0 0 .8em; }
#consent .consent-k { color: var(--dim); margin-bottom: .4em; }
#consent .consent-links { display: flex; gap: 14px; color: var(--dim); }
#consent .consent-links a { border-bottom: 1px solid currentColor; } #consent .consent-links a:hover { color: #fff; }
#consent .consent-actions { display: flex; gap: 8px; margin-top: 4px; }
#consent button {
  font: inherit; cursor: pointer; padding: 8px 14px; border-radius: 99px; border: 1px solid #fff; background: none; color: #fff;
  transition: background .2s, color .2s;
}
#consent button:hover { background: #fff; color: #000; }
#consent #consentAccept { background: #fff; color: #000; }
#consent #consentAccept:hover { background: none; color: #fff; }
#consent a:focus-visible, #consent button:focus-visible { outline: 2px solid #3ff5e0; outline-offset: 2px; }
::view-transition-group(consent) { animation: none; }
@media (prefers-reduced-motion: reduce) { #consent { transition: none; } }


/* home: black screen, name cut out, animation visible through the letters */
.fluid-base {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, hsl(178 95% 52%), hsl(205 90% 58%) 30%, hsl(262 85% 60%) 58%, hsl(292 85% 62%) 80%, hsl(178 95% 52%));
  background-size: 300% 300%; opacity: .34; animation: base-drift 24s ease-in-out infinite alternate;
}
@keyframes base-drift { from { background-position: 0% 40%; } to { background-position: 100% 60%; } }
body[data-view="home"] #trail, body[data-view="work"] #trail { mix-blend-mode: screen; }   /* fluid adds light on top of the base glow */
.cutout {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; background: #000; mix-blend-mode: multiply;
  display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter);
}
.cutout-title {
  margin: 0; color: #fff; text-transform: uppercase; font-weight: 900; font-stretch: 100%; letter-spacing: -.035em; line-height: .8;
  font-family: var(--font); font-size: 100px;
}
.cutout-title span { display: block; white-space: nowrap; width: max-content; }
.hero-sub {
  position: absolute; left: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 3; pointer-events: none;
  font-size: clamp(13px, 1.2vw, 16px); line-height: 1.3; letter-spacing: -.005em; color: #e6e6e6; max-width: 34em; margin: 0;
  animation: rise 1.1s .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .fluid-base { opacity: .48; } }
@media (prefers-reduced-motion: reduce) { .fluid-base, .hero-sub { animation: none; } }
.info .dim { color: var(--dim); }

/* touch screens have no hover, so the project names are simply bright */
@media (hover: none) {
  .item .meta span { color: var(--fg); }
  .item .meta span::before { transform: scaleX(1); }   /* no hover on touch, so the underline is always drawn */
}

/* the home page's small text carries a link to the Kent page */
.hero-sub a { pointer-events: auto; border-bottom: 1px solid currentColor; transition: color .3s; }
.hero-sub a:hover { color: var(--dim); }


/* Contact: one sentence to fill in. Black page; the word SEND is cut out of it so the live animation shows through. */
body[data-view="contact"][data-fluid] #trail { opacity: 1; mix-blend-mode: screen; }
.cutout-soft { display: block; background: rgba(0,0,0,.9); padding: 0; }   /* a faint glow stays behind the sentence */
#sendCut {
  position: absolute; display: block; margin: 0; padding: 0; color: #fff; white-space: nowrap; overflow: visible;
  font: 900 100px/.8 var(--font); font-stretch: 100%; text-transform: uppercase; letter-spacing: -.035em;
  transition: opacity .3s;
}
body.sending #sendCut { animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
body.sent .cutout-soft { background: rgba(0,0,0,.66); transition: background 1.4s ease; }   /* after sending, the whole screen lights up (still dark enough to read) */
body.sent #sendCut { opacity: 0; }
body.sent .thanks .dimmer { color: #e6e6e6; }
html.no-fluid body[data-view="contact"] .fluid-base { opacity: .85; }

.contact-scroll {
  position: absolute; inset: 0; z-index: 4; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column;
  padding: calc(64px + env(safe-area-inset-top)) var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.contact-scroll::-webkit-scrollbar { display: none; }
.sentence, .thanks { margin: auto 0; max-width: 1500px; transition: opacity .5s ease; }
.sentence[hidden], .thanks[hidden] { display: none; }
.line {
  margin: 0 0 .28em; font: 800 var(--fs, clamp(26px, 4.7vw, 72px))/1.12 var(--font); font-stretch: 90%; letter-spacing: -.03em; color: #fff;
  border: 0; padding: 0; min-width: 0;
}
.dimmer { color: var(--dim); font-weight: 600; }
.thanks:focus { outline: none; }
.thanks { animation: rise 1.1s .5s cubic-bezier(.2,.7,.2,1) both; }
body.sent .sentence { opacity: 0; }

/* a blank in the sentence: the input sits over a hidden copy of its own text, so it is exactly as wide as what is typed */
.f { display: inline-grid; max-width: 100%; vertical-align: baseline; border-bottom: .045em solid #6f6f6f; transition: border-color .3s; }
.f::after { content: attr(data-v) " "; grid-area: 1 / 1; visibility: hidden; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 2ch; }
.f input, .f textarea {
  grid-area: 1 / 1; width: 0; min-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; outline: none; resize: none; overflow: hidden;
  font: inherit; font-stretch: inherit; letter-spacing: inherit; line-height: inherit; text-transform: none; caret-color: #3ff5e0;
  color: #fff; background: linear-gradient(100deg, #3ff5e0, #5a7bff 40%, #a56bff 70%, #f06eff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.f input::placeholder, .f textarea::placeholder { color: #858585; opacity: 1; -webkit-text-fill-color: #858585; }
.f input:-webkit-autofill, .f input:-webkit-autofill:focus { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 100px #000 inset; caret-color: #fff; }
.f:focus-within { border-bottom-color: transparent; border-image: linear-gradient(90deg, #3ff5e0, #5a7bff, #a56bff, #f06eff) 1; }
.f:has([aria-invalid="true"]) { border-bottom-color: #f06eff; border-image: none; }
.f.msg { display: grid; width: 100%; margin-top: .1em; }
.f.msg::after { min-height: 1.2em; }
.opt { white-space: normal; }

/* project type: words to pick from; the chosen one takes the swirl colours */
.pick .opts { display: inline; }
.pick label { display: inline; position: relative; cursor: pointer; }
.pick label:not(:last-child)::after { content: " / "; color: #6f6f6f; white-space: pre; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pick label span { color: #858585; transition: color .25s; border-radius: 4px; }
.pick label:hover span { color: #cfcfcf; }
.pick input:checked + span {
  color: #fff; background: linear-gradient(100deg, #3ff5e0, #5a7bff 45%, #a56bff 75%, #f06eff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pick input:focus-visible + span { outline: 2px solid #3ff5e0; outline-offset: 4px; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.send-row { display: flex; align-items: flex-end; gap: clamp(18px, 3vw, 44px); flex-wrap: wrap; margin-top: clamp(8px, 2vh, 40px); }
#sendBtn {
  appearance: none; -webkit-appearance: none; border: 0; background: none; margin: 0; padding: 0; cursor: pointer; position: relative;
  font: 900 calc(var(--fs, 60px) * 4)/.8 var(--font); font-stretch: 100%; text-transform: uppercase; letter-spacing: -.035em;
  color: transparent;   /* the visible letters are the cut-out copy underneath */
}
#sendBtn span { display: block; }
#sendBtn:disabled { cursor: progress; }
#sendBtn:focus-visible { outline: 2px solid #3ff5e0; outline-offset: 10px; }
.note { max-width: 26em; margin: 0 0 .5em; font-size: clamp(13px, 1.1vw, 15px); line-height: 1.35; color: var(--dim); }
.note a { color: #e6e6e6; border-bottom: 1px solid currentColor; transition: color .3s; }
.note a:hover { color: var(--dim); }
.note.err { color: #f06eff; }
.note.err a { color: #f06eff; }

@media (max-width: 720px) {
  .send-row { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .thanks, body.sending #sendCut { animation: none; } body.sent .cutout-soft { transition: none; } }


/* About: the first screen is the fixed layout above; a second section (how I work) sits below it and the page scrolls */
body[data-view="about"] #about { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; scroll-behavior: smooth; }
body[data-view="about"] #about::-webkit-scrollbar { display: none; }
#about .info { position: relative; inset: auto; min-height: 100vh; min-height: 100dvh; }
.how-link { border-bottom: 1px solid currentColor; }
.story {
  position: relative; min-height: 100vh; min-height: 100dvh; padding: 120px var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between; gap: 64px;
}
.story-lead { font: 800 clamp(26px, 4.2vw, 64px)/1.1 var(--font); font-stretch: 90%; letter-spacing: -.03em; max-width: 22em; margin: 0; }
.story-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.story-cols p { max-width: 34ch; margin: 0; }
.story-cols h3 { color: var(--dim); margin-bottom: .3em; }
.story-end { margin: 0; font: 800 clamp(22px, 3vw, 44px)/1.1 var(--font); font-stretch: 90%; letter-spacing: -.03em; }
.story-end a { border-bottom: .06em solid transparent; border-image: linear-gradient(90deg, #3ff5e0, #5a7bff, #a56bff, #f06eff) 1; transition: color .3s; }
.story-end a:hover { color: var(--dim); }
@media (max-width: 720px) {
  #about .info { position: relative; height: auto; min-height: 100dvh; overflow: visible; }
  .story-cols { grid-template-columns: 1fr; gap: 28px; }
  .story { padding-top: 90px; gap: 44px; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { body[data-view="about"] #about { scroll-behavior: auto; } }



/* Work page: the projects, as a quiet list top-left (the tiles are the types of work) */
.work-index { position: absolute; z-index: 5; left: var(--gutter); top: calc(64px + env(safe-area-inset-top)); }
.work-index p { color: var(--dim); margin: 0 0 .45em; }
.work-index ul { display: grid; gap: .25em; }
.work-index a { color: var(--fg); transition: color .3s; }
.work-index a:hover, .work-index a:focus-visible { color: var(--dim); outline: none; }
@media (max-width: 720px) { .work-index { top: calc(58px + env(safe-area-inset-top)); } }


/* Work page: switch between the ways of browsing (plain words, the current one underlined) */
.work-switch { position: absolute; z-index: 5; left: var(--gutter); top: calc(64px + env(safe-area-inset-top)); }
.work-switch p { color: var(--dim); margin: 0 0 .45em; }
.work-switch ul { display: grid; gap: .1em; justify-items: start; }
.work-switch button { position: relative; font: inherit; color: var(--dim); background: none; border: 0; padding: .1em 0 .25em; cursor: pointer; transition: color .3s; }
.work-switch button:hover, .work-switch button:focus-visible { color: var(--fg); outline: none; }
.work-switch button[aria-pressed="true"] { color: var(--fg); }
.work-switch button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, #3ff5e0, #5a7bff, #a56bff); transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.work-switch button[aria-pressed="true"]::after, .work-switch button:hover::after { transform: scaleX(1); }
@media (max-width: 720px) { .work-switch { top: calc(58px + env(safe-area-inset-top)); } }
