:root{
  --ink:#141414;
  --muted:#8a8a8a;
  --rule:#e6e4e0;
  --bg:#fbfaf8;
}
@media (prefers-color-scheme: dark){
  :root{ --ink:#e9e7e3; --muted:#8b8b8b; --rule:#2a2a2a; --bg:#111110; }
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; overscroll-behavior:none; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:ui-sans-serif,-apple-system,"Segoe UI",Inter,Helvetica,Arial,sans-serif;
  font-size:17px;
  line-height:1.65;
  letter-spacing:-0.005em;
  -webkit-font-smoothing:antialiased;
}
@media (max-width:640px){
  body{ font-size:16px; }
}

 a{
  color:inherit;
  font-weight:600;
  text-decoration:none;
  border-bottom:1px
  solid var(--muted);
}

a:hover{
  border-bottom-color:currentColor;
}
a:focus-visible{
  outline:2px solid currentColor;
  outline-offset:3px;
  border-radius:12px;
}

/* ---------- splash ---------- */
/* The large 3:2 photo shrinks into a small rounded-rectangle avatar, then the
   name and role fade in. This is a two-state morph, not a scroll-scrub: main.js
   toggles .is-collapsed on a single wheel/swipe/arrow gesture, and the transition
   below plays --t (shrink), --tn (name) and --tr (role) from 0 to 1 at a fixed
   eased speed. Registering them with @property is what lets a plain number
   transition. Logo "bubbles" pop into a ring around the name. */
@property --t{ syntax:'<number>'; inherits:true; initial-value:0; }
@property --tn{ syntax:'<number>'; inherits:true; initial-value:0; }
@property --tr{ syntax:'<number>'; inherits:true; initial-value:0; }
/* Asymmetric timing: a CSS transition uses the timing of the state it moves INTO.
   Expanding moves into .splash (base), so the name/role fade out fast — gone well
   before the photo has grown back over where they sit. Collapsing moves into
   .is-collapsed, whose delayed timing lets them fade in only after the shrink. */
.splash{
  height:100svh;
  transition:--t 720ms cubic-bezier(.22,1,.36,1),
             --tn 150ms ease,
             --tr 150ms ease;
}
.splash.is-collapsed{
  --t:1; --tn:1; --tr:1;
  transition:--t 720ms cubic-bezier(.22,1,.36,1),
             --tn 380ms ease 220ms,
             --tr 380ms ease 320ms;
}
.splash-stage{
  position:relative;
  height:100svh;
  overflow:hidden;
  --frame-w:min(92vw, 84svh * 1.5); /* 3:2, fits the viewport with breathing room */
  --frame-h:calc(var(--frame-w) / 1.5);
  --avatar:160px;
  --rx:min(38vw, 440px);
  --ry:min(36svh, 300px);
  --ri:0.8; /* every other bubble sits at this share of the ring radius */
}

.splash-frame{
  position:absolute;
  left:50%; top:50%;
  width:calc(var(--frame-w) + (var(--avatar) - var(--frame-w)) * var(--t,0));
  height:calc(var(--frame-h) + (var(--avatar) - var(--frame-h)) * var(--t,0));
  border-radius:calc(clamp(16px,2.5vw,32px) + (32px - clamp(16px,2.5vw,32px)) * var(--t,0));
  overflow:hidden;
  transform:translate(-50%, calc(-50% - var(--t,0) * 56px));
  will-change:width,height,transform;
}
/* Desktop: the photo is clickable to toggle between the two sizes (see main.js). */
.splash.is-interactive .splash-frame{ cursor:pointer; }
.splash-photo{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:55% 45%;
}
/* Entrance: on first load the photo settles in — a gentle fade with a
   barely-there zoom-out. Plays once; skipped when reduced motion is requested. */
@media (prefers-reduced-motion: no-preference){
  .splash-photo{ animation:photo-in 1400ms cubic-bezier(.22,1,.36,1) both; }
}
@keyframes photo-in{
  from{ opacity:0; transform:scale(1.05); }
  to{ opacity:1; transform:scale(1); }
}

/* --peek fades the name/role out and back in while main.js swaps the text on a
   bubble hover. Registering it lets the number itself transition, so the
   scroll-driven --tn/--tr opacity stays untouched. */
@property --peek{ syntax:'<number>'; inherits:true; initial-value:1; }
.splash-id{
  --peek:1;
  transition:--peek 160ms ease;
  position:absolute;
  left:50%; top:calc(50% - 56px + 80px + 20px);
  transform:translateX(-50%);
  text-align:center;
  white-space:nowrap;
}
.splash-id.is-swapping{ --peek:0; }
.splash-name{
  margin:0;
  font-size:28px;
  font-weight:600;
  letter-spacing:-0.02em;
  line-height:1.2;
  opacity:calc(var(--tn,0) * var(--peek,1));
  transform:translateY(calc((1 - var(--tn,0)) * 8px));
}
.splash-role{
  margin:4px 0 0;
  color:var(--muted);
  font-size:16px;
  opacity:calc(var(--tr,0) * var(--peek,1));
  transform:translateY(calc((1 - var(--tr,0)) * 8px));
}

.splash-bubbles{
  list-style:none;
  margin:0; padding:0;
  position:absolute;
  inset:0;
  pointer-events:none;
}
.bubble{
  position:absolute;
  left:calc(50% + var(--cx,0) * var(--rx) * var(--rf,1));
  top:calc(50% + var(--cy,0) * var(--ry) * var(--rf,1));
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  background:#fff;
  border:1px solid var(--rule);
  border-radius:16px;
  box-shadow:0 6px 24px -8px rgba(0,0,0,.18);
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transform:translate(-50%,-50%) rotate(var(--rot,0deg)) scale(.6);
  /* fast, undelayed exit when .on is removed */
  transition:opacity 200ms ease,
             transform 200ms ease,
             visibility 200ms ease,
             scale 300ms cubic-bezier(.22,1,.36,1);
}
.bubble.on{
  opacity:1;
  visibility:visible;
  pointer-events:auto; /* bubbles are hoverable once they are in place */
  transform:translate(-50%,-50%) rotate(var(--rot,0deg)) scale(1);
  /* slow, staggered pop-in */
  transition:opacity 320ms ease var(--delay,0ms),
             transform 520ms cubic-bezier(.34,1.56,.64,1) var(--delay,0ms),
             visibility 0ms,
             scale 300ms cubic-bezier(.22,1,.36,1);
}
/* Hover: a very gentle grow. The standalone `scale` property stacks on top of
   `transform`, so it eases on its own long curve instead of the bouncy, delayed
   pop-in transition. */
.bubble.on:hover{ scale:1.04; border-color:var(--rule); } /* bubbles are links: keep the global a:hover underline colour off */
.bubble img{
  display:block;
  height:18px;
  width:auto;
}
/* Per-logo correction: the EK wordmark is very wide, so it gets a little less height */
.bubble img[src*="/ek.svg"]{ height:14px; }
/* Status dot: green = current employer. Sits on the bubble corner and both
   fades and emits a ripple to read as "live / here now". */
.status-dot{
  display:inline-block;
  width:10px; height:10px;
  border-radius:50%;
  flex:none;
}
.status-dot.now{
  background:#30b85c;
  animation:dot-pulse 2.4s ease-in-out infinite;
}
/* Expanding ripple that radiates out from behind the dot. */
.status-dot.now::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:#30b85c;
  animation:dot-ripple 2.4s ease-out infinite;
}
.bubble .status-dot{
  position:absolute;
  /* centre lands on the curve of the 16px corner radius, so it straddles the edge */
  top:0; right:0;
  box-shadow:0 0 0 2px var(--bg);
}

@media (prefers-color-scheme: dark){
  .bubble{ background:#1c1c1b; }
  .bubble img{ filter:invert(1); }
}

@media (max-width:640px){
  /* Mobile: no morph at all. We render the finished compact state directly
     (--t/--tn/--tr pinned to 1), so the resize transition is switched off here to
     stop it playing once on load. The name and logo ring fade in instead (below). */
  .splash{ height:auto; transition:none; }
  .splash-stage{
    position:static;
    --t:1; --tn:1; --tr:1;
    /* main.js thins the ring to ~7-9 evenly-spaced pills on phones. rx scales with
       viewport width so the ring fills the screen, minus a 60px inset that keeps
       the widest wordmark clear of the edge (offset ≈ 0.94·rx + ~50); the 168px cap
       stops it over-spreading on the largest phones. ry gives vertical spread and
       --ri keeps a gentle loose-bubble stagger. */
    --avatar:128px; --rx:min(50vw - 60px, 168px); --ry:min(44svh, 344px); --ri:0.84;
  }
  .splash-id{ top:calc(50% - 56px + 64px + 16px); }
  .splash-name{ font-size:24px; }
  .splash-role{ font-size:15px; }
  /* Minimum tap target: the icon-only pills (Axcial, CreativeCenter…) would
     otherwise be ~40px and hard to hit on small phones. */
  .bubble{ padding:9px 12px; border-radius:12px; min-height:44px; min-width:56px; }
  .bubble img{ height:13px; }
  .bubble img[src*="/ek.svg"]{ height:10px; }
}

/* Gentle one-time entrance for the compact mobile state (paired with the logo
   bubbles' own pop-in). Skipped when reduced motion is requested. */
@media (max-width:640px) and (prefers-reduced-motion: no-preference){
  .splash-id{ animation:splash-in 600ms ease both; }
}
@keyframes splash-in{
  from{ opacity:0; }
  to{ opacity:1; }
}

@media (prefers-reduced-motion: reduce){
  .splash{ height:auto; transition:none; }
  .splash-stage{ position:static; }
  .bubble{ transition:none; }
  .status-dot.now{ animation:none; }
  .status-dot.now::after{ animation:none; display:none; }
}

@keyframes dot-pulse{
  0%,100%{ opacity:1; transform:scale(1); }
  50%{ opacity:0.45; transform:scale(1.15); }
}
@keyframes dot-ripple{
  0%{ transform:scale(1); opacity:0.5; }
  70%,100%{ transform:scale(2.8); opacity:0; }
}

/* ---------- top-right links ---------- */
.splash-links{
  position:fixed;
  top:24px; right:24px;
  z-index:10;
  display:flex;
  gap:20px;
}
.splash-links a{
  font-size:14px;
  color:var(--muted);
  border-bottom:none;
}
.splash-links a:hover{
  color:var(--ink);
  border-bottom:1px solid currentColor;
}
@media (max-width:640px){
  .splash-links{ top:16px; right:16px; gap:16px; }
}

/* ---------- contact ---------- */
.contact{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:48px;
  text-align:center;
  padding:24px;
}
.contact .dot{
  width:32px; height:32px;
  border-radius:50%;
  background:var(--ink);
  box-shadow:0 0 0 0 transparent;
  animation:
    dot-pulse 2.4s ease-in-out infinite,
    dot-ripple-lg 2.4s ease-out infinite;
}
.contact p{
  margin:0;
  max-width:30ch;
}
@keyframes dot-ripple-lg{
  0%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--ink) 26%, transparent); }
  70%,100%{ box-shadow:0 0 0 26px transparent; }
}

/* ---------- gate ---------- */
/* Project pages: a centred password card. The lock is only cosmetic; gate.js
   answers every attempt with the same "not right" message. */
.gate{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:24px;
  padding:24px;
}
.gate-card{
  width:100%;
  max-width:384px;
  margin:0;
  padding:32px 24px 24px;
  background:#fff;
  border:1px solid var(--rule);
  border-radius:16px;
  box-shadow:0 6px 24px -8px rgba(0,0,0,.18);
}
.gate-logo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:48px;
  padding:0 16px;
  margin-bottom:20px;
  border:1px solid var(--rule);
  border-radius:12px;
}
.gate-logo img{
  display:block;
  height:18px;
  width:auto;
}
.gate-logo img[src*="/ek.svg"]{ height:14px; }
.gate-title{
  margin:0;
  font-size:20px;
  font-weight:600;
  letter-spacing:-0.02em;
  line-height:1.3;
}
.gate-sub{
  margin:4px 0 24px;
  color:var(--muted);
  font-size:15px;
  line-height:1.5;
}
.gate-label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:500;
}
.gate-input{
  display:block;
  width:100%;
  height:40px;
  padding:0 12px;
  font:inherit;
  font-size:15px;
  color:var(--ink);
  background:var(--bg);
  border:1px solid var(--rule);
  border-radius:10px;
  outline:none;
}
.gate-input:focus-visible{
  border-color:var(--ink);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}
.gate-input[aria-invalid="true"]{ border-color:#e5484d; }
.gate-error{
  margin:8px 0 0;
  color:#e5484d;
  font-size:14px;
  line-height:1.4;
}
.gate-button{
  display:block;
  width:100%;
  height:40px;
  margin-top:16px;
  font:inherit;
  font-size:15px;
  font-weight:600;
  color:var(--bg);
  background:var(--ink);
  border:0;
  border-radius:10px;
  cursor:pointer;
}
.gate-button:hover{ background:color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.gate-button:focus-visible{
  outline:2px solid var(--ink);
  outline-offset:2px;
}
.gate-links{
  margin:0;
  display:flex;
  gap:20px;
  font-size:14px;
  color:var(--muted);
}
.gate-links a{ font-weight:500; }
.gate-card.is-wrong .gate-input{ animation:gate-shake 320ms ease; }
@keyframes gate-shake{
  0%,100%{ transform:translateX(0); }
  25%{ transform:translateX(-5px); }
  50%{ transform:translateX(5px); }
  75%{ transform:translateX(-3px); }
}
@media (prefers-color-scheme: dark){
  .gate-card{ background:#1c1c1b; }
  .gate-logo img{ filter:invert(1); }
}
@media (prefers-reduced-motion: reduce){
  .gate-card.is-wrong .gate-input{ animation:none; }
}
