/* Home page: two full-bleed doors. Colours match each site (Projects = the potion blue → purple,
   Portfolio = orange → pink). See index.html for how the reveal works. */

/* registered so it can animate (the reveal grows/shrinks) */
@property --k { syntax: '<number>'; inherits: true; initial-value: 0; }
/* --k = how open the reveal is (0 shut … 1 open). The circle keeps its size; only its stops move,
   and at 0 they sit just before the centre so nothing shows (a 0px circle shows everything in Safari,
   and a tiny one leaves a speck). */

:root {
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --on-accent: #FAFAFA;
  --reveal: clamp(160px, 28vmin, 320px);   /* radius of the see-through circle */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1E1E1E; }
/* No scrolling at all: on iPhone a swipe that turns into a page scroll cancels the touch and the
   window closes. The page is pinned, and swipes on the doors go to js/home.js (taps still open links). */
html, body { overflow: hidden; overscroll-behavior: none; }
/* Safari tints its status/address bar from the background colour of an element pinned to the top —
   here the pinned body. It's the colour at the top edge of the Projects door (on iPhone that door
   is on top), so the bar blends into the gradient instead of showing grey. */
body { position: fixed; inset: 0; background-color: #5C6CF7; }

.doors {
  display: grid; grid-template-columns: 1fr 1fr;
  height: 100vh; height: 100dvh;
}
.door {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; place-items: center;
  color: var(--on-accent); text-decoration: none;
  --x: 50%; --y: 50%; --py: 0%;
  transition: --k .45s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;                      /* swipes move the window instead of scrolling / zooming */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;   /* no text-select / link preview on long press */
}
.door--projects  { --a: #3A8DFF; --b: #6B4BEF; --c: #A62FDB; }
.door--portfolio { --a: #FF8853; --b: #FB5F5F; --c: #F84467; }

/* the gallery snapshot, behind everything: shown at the door's width, scrolled by js/home.js */
.door__preview { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: #fff; }
.door__preview img {
  display: block; width: 100%; height: auto; will-change: transform;
  min-height: 100%; object-fit: cover; object-position: top center;   /* a short gallery (projects) still reaches the bottom: no empty bar */
}
@media (prefers-color-scheme: dark) { .door__preview { background: #000; } }
/* the gradient, with a soft see-through circle at the pointer */
.door__veil {
  position: absolute; inset: 0; z-index: -1;
  background: var(--a) radial-gradient(ellipse 90% 66% at 50% 45%, var(--c) 0%, var(--b) 45%, var(--a) 100%);   /* fallback */
  /* smoother: wider glow, eased in-between stops, blended in oklab (no muddy/banded middle) */
  background: var(--a) radial-gradient(in oklab ellipse 90% 66% at 50% 45%,
    var(--c) 0%, color-mix(in oklab, var(--c) 70%, var(--b)) 14%, color-mix(in oklab, var(--c) 30%, var(--b)) 30%,
    var(--b) 46%, color-mix(in oklab, var(--b) 60%, var(--a)) 64%, color-mix(in oklab, var(--b) 25%, var(--a)) 82%, var(--a) 100%);
  -webkit-mask-image: radial-gradient(circle var(--reveal) at var(--x) var(--y), transparent calc(var(--k) * 63% - 1%), #000 calc(var(--k) * 101% - 1%));
          mask-image: radial-gradient(circle var(--reveal) at var(--x) var(--y), transparent calc(var(--k) * 63% - 1%), #000 calc(var(--k) * 101% - 1%));
  -webkit-mask-composite: source-in;            /* several holes (js trail): keep all of them */
          mask-composite: intersect;
}
.door:hover, .door.is-peeking, .door:focus-visible { --k: 1; }
.door:focus-visible { outline: 3px solid var(--on-accent); outline-offset: -6px; }

.door__label {
  font: 600 clamp(2rem, 6vw, 4.5rem)/1 var(--font);
  text-transform: uppercase; letter-spacing: .12em;
  text-shadow: 0 2px 18px rgb(0 0 0 / .25);   /* stays readable over the snapshot */
  pointer-events: none;
}

/* phones / narrow: stacked */
@media (max-width: 720px) {
  .doors { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  :root { --reveal: clamp(110px, 30vmin, 180px); }
}
@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
}
