/* fPHXlabs: one page, Liquid Glass project list over a soft gradient glow.
   Background: "Background Gradient Glow" (meghtrix / patterncraft.fun), recreated in CSS. */
:root {
  --ink: #1e1630;
  --muted: #5b5070;
  --faint: #8a7f9e;
  --accent: #7b4fd6;
  --glass-top: rgba(255, 255, 255, .38);
  --glass-bot: rgba(255, 255, 255, .12);
  --glass-edge: rgba(255, 255, 255, .7);
  --shadow: 0 1px 2px rgba(60, 30, 100, .06), 0 12px 32px -8px rgba(80, 40, 130, .18);
  --radius: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* The page canvas carries the base gradient too: iOS Safari draws its bars over
   the page and fills anything the fixed .bg does not reach with this. */
html { background: #f7eaff linear-gradient(180deg, #f7eaff 0%, #fde2ea 100%) no-repeat; min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* Background: the "Background Gradient Glow" (meghtrix / patterncraft.fun).
   With a mouse, js/fluid.js draws it in WebGL (a canvas in .bg, class .gl) so the
   cursor can push the colours around. Otherwise these CSS layers are the
   background: one per glow, each drifting on its own loop (transform only). */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
      /* Overhangs the screen at the top and bottom. iOS Safari treats a fixed,
         full-width element that sits on an edge as a header/footer and paints its
         bar with one flat colour taken from it; overhanging both edges lets the
         gradient show through the bars instead. 100lvh = the large viewport, the
         height with Safari's bars collapsed (viewport-fit=cover in the HTML). */
      top: -80px; bottom: auto; height: calc(100vh + 160px); height: calc(100lvh + 160px);
      background: linear-gradient(180deg, #f7eaff 0%, #fde2ea 100%); }
.bg canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; } /* the viewport, not the overhang: fluid.js sizes to the window */
.bg.gl i { display: none; }
.bg i { position: absolute; inset: -12%; will-change: transform; translate: 0 var(--par, 0px); } /* --par: depth parallax, js/glass.js */
.bg .b1 { background: radial-gradient(ellipse 85% 65% at 8% 8%, rgba(175, 109, 255, .42), transparent 60%); }
.bg .b2 { background: radial-gradient(ellipse 75% 60% at 75% 35%, rgba(255, 235, 170, .55), transparent 62%); }
.bg .b3 { background: radial-gradient(ellipse 70% 60% at 15% 80%, rgba(255, 100, 180, .40), transparent 62%); }
.bg .b4 { background: radial-gradient(ellipse 70% 60% at 92% 92%, rgba(120, 190, 255, .45), transparent 62%); }
@media (prefers-reduced-motion: no-preference) {
  .bg .b1 { animation: orbit-a 34s ease-in-out infinite alternate; }
  .bg .b2 { animation: orbit-b 46s ease-in-out infinite alternate; }
  .bg .b3 { animation: orbit-c 40s ease-in-out infinite alternate; }
  .bg .b4 { animation: orbit-d 52s ease-in-out infinite alternate; }
}
@keyframes orbit-a { 0% { transform: none; } 35% { transform: translate3d(7%, 5%, 0) scale(1.08); } 70% { transform: translate3d(-3%, 9%, 0) scale(.96); } 100% { transform: translate3d(5%, -2%, 0) scale(1.04); } }
@keyframes orbit-b { 0% { transform: none; } 30% { transform: translate3d(-8%, 6%, 0) scale(1.06); } 65% { transform: translate3d(-4%, -6%, 0) scale(1.1); } 100% { transform: translate3d(5%, 4%, 0) scale(.97); } }
@keyframes orbit-c { 0% { transform: none; } 40% { transform: translate3d(9%, -7%, 0) scale(1.07); } 75% { transform: translate3d(3%, -2%, 0) scale(.95); } 100% { transform: translate3d(-4%, -8%, 0) scale(1.05); } }
@keyframes orbit-d { 0% { transform: none; } 35% { transform: translate3d(-7%, -6%, 0) scale(1.05); } 70% { transform: translate3d(-10%, 2%, 0) scale(1.1); } 100% { transform: translate3d(-2%, -9%, 0) scale(.98); } }

/* full-height column so the footer sits at the bottom of the window */
.wrap { max-width: 760px; margin: 0 auto;
        /* safe-area insets: the notch in landscape, the home bar at the bottom */
        padding: clamp(56px, 12vh, 120px) max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
        min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap > * { flex-shrink: 0; }

/* Intro */
.intro { margin-bottom: 40px; }
h1 { margin: 0; font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
/* Neon RGB split on the title ("Neon RGB Text Effect", xubohuah): red and blue
   copies shifted either side of the letters, with a faint neon glow. */
h1 {
  text-shadow:
    -.035em 0 rgba(255, 30, 90, .55),
    .035em 0 rgba(0, 150, 255, .55),
    0 0 .35em rgba(175, 109, 255, .35);
}
@media (prefers-reduced-motion: no-preference) {
  h1 { animation: rgbsplit 7s ease-in-out infinite; }
}
@keyframes rgbsplit {
  0%, 100% { text-shadow: -.035em 0 rgba(255, 30, 90, .55), .035em 0 rgba(0, 150, 255, .55), 0 0 .35em rgba(175, 109, 255, .35); }
  50%      { text-shadow: -.06em 0 rgba(255, 30, 90, .45), .06em 0 rgba(0, 150, 255, .45), 0 0 .5em rgba(175, 109, 255, .45); }
}
/* smoked glass text: dark ink at partial opacity, so the letters stay readable
   and pick up a faint tint from the background behind them */
.tagline {
  margin: 12px 0 0; font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(30, 22, 48, .55);
}
.about { margin: 18px 0 0; max-width: 54ch; font-size: 1.05rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
/* contact pills left, radio pill right, one row; the radio wraps under on narrow screens */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; }

/* Liquid Glass surface */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(160deg, var(--glass-top), var(--glass-bot));
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .25);
  border-radius: var(--radius);
}
/* bright rim: brighter top-left, fading toward the bottom-right */
.glass::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, var(--glass-edge), rgba(255, 255, 255, .1) 45%, rgba(255, 255, 255, .5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* sheen that follows the pointer (position set by js/glass.js) */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(240px circle at var(--x, 30%) var(--y, 0%), rgba(255, 255, 255, .55), transparent 65%);
  opacity: 0; transition: opacity .35s ease;
}
@media (hover: hover) { .glass:hover::after { opacity: 1; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 16px; border-radius: 999px; text-decoration: none; font-size: .92rem; font-weight: 600; transition: transform .2s ease; }
@media (hover: hover) { .pill:hover { transform: translateY(-1px); } }
.go span { color: var(--accent); }

/* Radio pill (js/player.js): play button, now-playing text, level bars.
   Hidden until the script shows it ([hidden] has to beat .pill's display). */
.player[hidden] { display: none; }
.player { display: flex; min-width: 0; max-width: min(100%, 360px);
          align-items: center; padding: 3px 16px 3px 3px; gap: 10px; cursor: default; } /* 34px tall, same as the contact pills */
.play { flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
        display: grid; place-items: center; color: var(--ink); background: #fff;
        box-shadow: 0 2px 6px -1px rgba(60, 30, 100, .18), inset 0 0 0 1px rgba(255, 255, 255, .8);
        transition: transform .15s ease, background .2s; }
.play:hover { background: rgba(255, 255, 255, .85); }
.play:active { transform: scale(.92); }
.play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.play svg { width: 12px; height: 12px; fill: currentColor; grid-area: 1 / 1; }
.play .i-play { margin-left: 2px; }
.play .i-pause, .play .i-load { display: none; }
.player.playing .i-play, .player.loading .i-play { display: none; }
.player.playing .i-pause { display: block; }
.player.loading .i-load { display: block; fill: none; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* one line: "Title · Artist". Too long for the pill: it scrolls as a ticker
   (player.js appends a second copy and sets --dur; -50% then loops seamlessly). */
.np { min-width: 0; overflow: hidden; line-height: 1.2; }
.np-line { display: inline-flex; white-space: nowrap; }
.np-text { flex: 0 0 auto; font-size: .86rem; }
.np-title { font-weight: 650; }
.np-sep, .np-artist { color: var(--muted); font-weight: 500; }
.np-line.run .np-text { padding-right: 2.5em; }
.np-line.run { animation: np-tick var(--dur, 12s) linear infinite; }
@keyframes np-tick { to { transform: translateX(-50%); } }
.np:has(.run) { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 16px), transparent);
                mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 16px), transparent); }
/* reduced motion: no ticker, just an ellipsis */
@media (prefers-reduced-motion: reduce) { .np-text { overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; } .np-line { display: flex; } }

/* Project list */
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* Card hover: the glass rim lights up around the cursor (--x/--y from glass.js),
   in the background's lavender/pink/blue, plus a soft coloured halo. --rim fades
   it in and out; keyboard focus gets the same glow. */
@property --rim { syntax: "<number>"; inherits: true; initial-value: 0; }
.row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 22px;
       --rim: 0; transition: transform .25s ease, box-shadow .3s ease, --rim .35s ease; }
.row::before {
  padding: 1.5px;
  background:
    /* no white centre (it bleached the edge under the cursor); warm pink/peach
       first, blue next, only a trace of lavender at the fade */
    radial-gradient(240px circle at var(--x, 30%) var(--y, 0%),
      rgba(255, 160, 210, calc(.8 * var(--rim))),
      rgba(255, 205, 165, calc(.6 * var(--rim))) 28%,
      rgba(130, 190, 255, calc(.5 * var(--rim))) 56%,
      rgba(190, 150, 255, calc(.22 * var(--rim))) 78%,
      transparent 92%),
    linear-gradient(135deg, var(--glass-edge), rgba(255, 255, 255, .1) 45%, rgba(255, 255, 255, .5));
}
/* Hover only on devices that really hover (a tap on a phone would leave it stuck),
   and keyboard focus only when it is visible focus. Two rules, not one list: a
   browser without :has() would drop the whole list. */
@media (hover: hover) {
  .row:hover {
    --rim: 1;
    transform: translateY(-2px);
    box-shadow:
      0 2px 4px rgba(60, 30, 100, .06), 0 18px 40px -10px rgba(70, 50, 110, .2),
      0 0 24px -4px rgba(255, 150, 200, .24), 0 10px 32px -10px rgba(130, 185, 255, .24),
      inset 0 1px 0 rgba(255, 255, 255, .9);
  }
}
.row:has(:focus-visible) {
  --rim: 1;
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(60, 30, 100, .06), 0 18px 40px -10px rgba(70, 50, 110, .2),
    0 0 24px -4px rgba(255, 150, 200, .24), 0 10px 32px -10px rgba(130, 185, 255, .24),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}
.no { font-size: .8rem; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.body h2 { margin: 0; font-size: 1.08rem; font-weight: 650; letter-spacing: -.01em; }
.kind { margin-left: 8px; font-size: .78rem; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.body p { margin: 4px 0 0; font-size: .93rem; color: var(--muted); }
.go { font-size: .86rem; font-weight: 600; text-decoration: none; white-space: nowrap; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); transition: background .2s; }
.go:hover, .go:focus-visible { background: rgba(255, 255, 255, .85); }
/* whole row clickable when it has a link */
.go::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); z-index: 2; }
.tag { font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 6px 10px; }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.foot { margin-top: auto; padding-top: 40px; text-align: center; font-size: .82rem; color: var(--faint); }

/* Load-in: only when js/glass.js has set html.anim (motion allowed). */
.anim .intro > *, .anim .row { opacity: 0; transform: translateY(14px); }
.anim.ready .intro > *, .anim.ready .row {
  opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, --rim .35s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}
@media (hover: hover) { .anim.ready .row:hover { transform: translateY(-2px); transition-delay: 0s; } }
.anim.ready .row:has(:focus-visible) { transform: translateY(-2px); transition-delay: 0s; }
/* after the load-in, drop the stagger so hover-out is immediate on every card */
.anim.settled .intro > *, .anim.settled .row { transition-delay: 0s; }

/* Scrolling list (desktop/tablet): about 4.5 cards tall, invisible scrollbar,
   soft fades on every edge. The padding holds the cards' shadows (and the hover
   lift), and the mask fades that padding to transparent, so shadows blend out
   instead of clipping. js/glass.js sets the exact height (--list-h) and deepens
   the top/bottom fades while there is more to scroll that way (--ft, --fb).
   Phones keep the full list in the normal page scroll. */
@property --ft { syntax: "<length>"; inherits: false; initial-value: 24px; }
@property --fb { syntax: "<length>"; inherits: false; initial-value: 44px; }
@media (min-width: 601px) {
  .projects {
    --px: 20px;
    position: relative;
    max-height: var(--list-h, 500px);
    overflow-y: auto;
    padding: 24px var(--px) 44px; margin: -24px calc(-1 * var(--px)) -24px;
    scrollbar-width: none;
    --ft: 24px; --fb: 44px;
    -webkit-mask-image:
      linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%),
      linear-gradient(to right, transparent 0, #000 var(--px), #000 calc(100% - var(--px)), transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%),
      linear-gradient(to right, transparent 0, #000 var(--px), #000 calc(100% - var(--px)), transparent 100%);
    mask-composite: intersect;
    transition: --ft .35s ease, --fb .35s ease;
  }
  .projects::-webkit-scrollbar { display: none; }
  /* every card the height of the tallest (--row-h from glass.js), so they match
     even where a line wraps on narrow tablets */
  .row { min-height: var(--row-h, 0); }
  /* end-of-list bounce: js/glass.js sets --ob while the list is stretched */
  .row { top: var(--ob, 0px); }
  @media (min-width: 820px) { .projects { --px: 32px; } }
  .projects:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
}
/* Cards settle in as they scroll into the list and ease back as they leave.
   Uses scale/translate (not transform) so it stacks with the hover lift and load-in. */
@media (min-width: 601px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .row {
      animation: row-in linear both, row-out linear forwards;
      animation-timeline: view(), view();
      animation-range: entry 0% entry 60%, exit 40% exit 100%;
    }
  }
  /* Fallback for browsers without scroll-driven animations: glass.js sets --v (0..1). */
  .no-sda .row {
    scale: calc(.94 + .06 * var(--v, 1));
    translate: 0 calc((1 - var(--v, 1)) * 18px);
    transition: scale .3s ease, translate .3s ease, transform .25s ease, box-shadow .3s ease, opacity .7s ease, --rim .35s ease;
  }
}
@keyframes row-in { from { scale: .94; translate: 0 18px; } to { scale: 1; translate: 0 0; } }
@keyframes row-out { from { scale: 1; } to { scale: .96; translate: 0 -6px; } }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 20px; }
.notfound .card { padding: 48px 40px; max-width: 460px; }
.notfound h1 { font-size: 2.4rem; }
.notfound p { color: var(--muted); margin: 12px 0 24px; }

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr auto; gap: 6px 14px; padding: 16px 18px; }
  .no { grid-column: 1 / -1; }
  .kind { display: block; margin: 2px 0 0; }
}

/* No backdrop-filter support: make the glass more opaque so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, .78); }
}
