/* Shared look for every page.
   Light: the original portfolio gradient (#99CDEB to #FFB6D9) with white headings.
   Dark (system setting): the dark style of my Wallpaper App design. Near-black blue,
   slate-blue and lavender glows, a touch of pink, soft bokeh lights, and the
   iridescent blue-lavender-pink of its "W" logo on edges, headings and buttons.
   Font: Arial, as on the original site. */
:root {
  --g1: #99cdeb;
  --g2: #ffb6d9;
  --page: linear-gradient(135deg, var(--g1), var(--g2));
  --on-accent: #ffffff;
  --head: #ffffff;
  --head-shadow: 0 2px 14px rgba(38, 50, 74, 0.18);
  --ink: #26324a;
  --ink-2: #46516b;
  --ink-3: #6b7590;
  --card: rgba(255, 255, 255, 0.74);
  --card-solid: #ffffff;
  --card-line: rgba(255, 255, 255, 0.9);
  --chip: rgba(255, 255, 255, 0.55);
  --accent: #517df6;
  --accent-2: #f391b5;
  --shadow: 0 10px 30px rgba(38, 50, 74, 0.12);
  --shadow-hover: 0 16px 40px rgba(38, 50, 74, 0.2);
  --radius: 18px;
  --font: Arial, Helvetica, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --g1: #0f1116;
    --night: #0f1116;
    /* the "W" logo shimmer */
    --iris: linear-gradient(120deg, #9fc4ff 0%, #b9a6ff 45%, #ffb6d9 100%);
    --iris-soft: linear-gradient(135deg, rgba(159, 196, 255, 0.55), rgba(185, 166, 255, 0.22) 45%, rgba(255, 182, 217, 0.5));
    --page:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
      linear-gradient(180deg, #0d0f15 0%, #121624 55%, #171a2b 100%);
    --head: #ffffff;
    --head-shadow: none;
    --ink: #eef1f7;
    --ink-2: #c3cad9;
    --ink-3: #8f99b0;
    --card: rgba(22, 26, 40, 0.58);
    --card-solid: #171c2b;
    --card-line: rgba(140, 158, 205, 0.22);
    --chip: rgba(140, 158, 205, 0.15);
    --accent: #aebcf2;
    --accent-2: #ffb6d9;
    --on-accent: #0f1116;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 22px 54px rgba(0, 0, 0, 0.55), 0 0 40px rgba(130, 120, 230, 0.2);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html { background: var(--g1); }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font: 16px/1.6 var(--font);
  overflow-x: hidden;
}
/* The gradient sits on a fixed layer, which works everywhere (iOS ignores fixed backgrounds) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--page); pointer-events: none; }
img { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; }
::selection { background: rgba(81, 125, 246, 0.25); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }

/* Headings on the gradient */
.on-page { color: var(--head); text-shadow: var(--head-shadow); }
.section { padding: 64px 0 8px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-head h2 { font-size: 2em; color: var(--head); text-shadow: var(--head-shadow); margin-bottom: 10px; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 17px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lift { transition: transform 0.3s, box-shadow 0.3s; }
.lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

/* Buttons: the original pill outline, plus a filled one */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 25px; text-decoration: none; cursor: pointer;
  font: bold 15px var(--font); color: #fff; background: rgba(255, 255, 255, 0.16); border: 2px solid #fff;
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.26); }
/* Gradients span the whole button, border included; otherwise they repeat into the transparent
   border and leave a pink sliver on the left edge and a blue one on the right */
/* !important because every `background:` shorthand below (solid, card, hover, popup links) would reset it */
.btn, .filters button { background-origin: border-box !important; }
.btn.sm { padding: 7px 14px; font-size: 13px; border-width: 1.5px; }
/* Every button has white text. The main one is a deeper version of the site gradient, so white reads on it;
   secondary buttons inside cards get a soft filled colour instead of a dark outline. */
:root { --btn-main: linear-gradient(120deg, #4a86d1, #9273e0 55%, #df6ba6); --btn-soft: linear-gradient(120deg, #6f86c4, #9a86d6); }
@media (prefers-color-scheme: dark) {
  /* --btn-soft is a real fill in dark mode too (it was 8% white, so card buttons looked like empty outlines) */
  :root { --btn-main: linear-gradient(120deg, #5a7fe0, #8a68ea 52%, #d968a8); --btn-soft: linear-gradient(120deg, #4d68b8, #7a64c8); }
  .btn { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.8); }
  .btn:hover { background: rgba(174, 188, 242, 0.16); box-shadow: 0 0 24px rgba(174, 188, 242, 0.2); }
}
.btn.solid, .card .btn.solid { background: var(--btn-main); border-color: transparent; color: #fff; }
.btn.solid:hover, .card .btn.solid:hover { background: var(--btn-main); box-shadow: 0 8px 28px rgba(146, 115, 224, 0.42); }
.card .btn { color: #fff; background: var(--btn-soft); border-color: transparent; }
.card .btn:hover { background: var(--btn-soft); box-shadow: 0 8px 24px rgba(111, 134, 196, 0.35); }
@media (prefers-color-scheme: dark) { .card .btn:not(.solid):hover { box-shadow: 0 0 26px rgba(122, 100, 200, 0.45); } }

/* Filter pills (projects and art) */
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.filters button { font: bold 14px var(--font); color: #fff; background: rgba(255, 255, 255, 0.16); border: 2px solid #fff; border-radius: 25px; padding: 8px 18px; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.filters button:hover { transform: translateY(-2px); }
.filters button[aria-pressed="true"] { background: var(--btn-main); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(146, 115, 224, 0.3); }
@media (prefers-color-scheme: dark) {
  .filters button { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.55); }
  .filters button:hover { border-color: #fff; }
}

.tag { display: inline-block; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); border: 1px solid var(--card-line); }
.ic { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }

/* Back link on inner pages (as on the original site) */
.back { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: bold; padding: 8px 14px; border-radius: 10px; transition: background 0.2s, transform 0.12s; }
.back:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0 6px; }
.top h1 { font-size: clamp(28px, 4vw, 40px); }

/* Scroll reveal: hidden only when the script that shows it runs */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Image viewer */
.lb { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(20, 26, 40, 0.88); padding: 24px; }
.lb.open { display: grid; }
.lb img { max-width: min(1500px, 96vw); max-height: 84vh; width: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.lb figcaption { text-align: center; color: #e6ebf3; margin-top: 12px; font-size: 14px; }
.lb button { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb .prev { left: 18px; } .lb .next { right: 18px; } .lb .x { top: 22px; right: 22px; transform: none; }

.foot { text-align: center; color: var(--ink-2); font-size: 14px; padding: 48px 0 40px; }
.foot a { color: var(--ink-2); }

@media (max-width: 680px) {
  .section { padding-top: 48px; }
  .section-head h2 { font-size: 1.7em; }
  .lb .prev, .lb .next { top: auto; bottom: 18px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* White text on the pale gradient: a small, crisp shadow keeps it readable (never inside cards) */
@media (prefers-color-scheme: light) {
  .btn:not(.solid), .filters button:not([aria-pressed="true"]), .back { text-shadow: 0 1px 2px rgba(38, 50, 74, 0.35); }
  .card .btn { text-shadow: none; }
}

/* Dark: immersive layers. Glows (slow) and bokeh lights (faster) sit behind everything and drift a
   little with scroll and the pointer (site.js adds the two layers and moves them). Nothing moves while idle. */
.bg-glow, .bg-bokeh { display: none; }
@media (prefers-color-scheme: dark) {
  .bg-glow, .bg-bokeh { display: block; position: fixed; z-index: -1; pointer-events: none; will-change: transform; transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .bg-glow {
    inset: -18%;
    background:
      radial-gradient(36vmax 24vmax at 50% 10%, rgba(150, 132, 255, 0.26), transparent 70%),
      radial-gradient(46vmax 34vmax at 12% 16%, rgba(88, 120, 182, 0.62), transparent 66%),
      radial-gradient(40vmax 32vmax at 90% 84%, rgba(112, 116, 205, 0.58), transparent 66%),
      radial-gradient(30vmax 24vmax at 84% 16%, rgba(255, 170, 214, 0.26), transparent 66%),
      radial-gradient(32vmax 26vmax at 16% 88%, rgba(126, 160, 220, 0.28), transparent 66%),
      radial-gradient(28vmax 22vmax at 55% 58%, rgba(150, 120, 240, 0.14), transparent 70%);
  }
  .bg-bokeh {
    inset: -10%;
    background:
      radial-gradient(70px 70px at 72% 28%, rgba(185, 166, 255, 0.16), transparent),
      radial-gradient(90px 90px at 18% 52%, rgba(159, 196, 255, 0.12), transparent),
      radial-gradient(56px 56px at 40% 82%, rgba(255, 182, 217, 0.14), transparent),
      radial-gradient(110px 110px at 88% 62%, rgba(185, 166, 255, 0.1), transparent),
      radial-gradient(48px 48px at 30% 14%, rgba(220, 228, 255, 0.12), transparent),
      radial-gradient(6px 6px at 12% 22%, rgba(230, 236, 255, 0.7), transparent),
      radial-gradient(4px 4px at 38% 12%, rgba(255, 255, 255, 0.65), transparent),
      radial-gradient(5px 5px at 58% 34%, rgba(255, 220, 238, 0.6), transparent),
      radial-gradient(4px 4px at 77% 9%, rgba(230, 236, 255, 0.6), transparent),
      radial-gradient(8px 8px at 86% 40%, rgba(170, 205, 255, 0.45), transparent),
      radial-gradient(5px 5px at 6% 84%, rgba(255, 220, 238, 0.5), transparent),
      radial-gradient(3px 3px at 63% 92%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(4px 4px at 47% 66%, rgba(230, 236, 255, 0.5), transparent),
      radial-gradient(3px 3px at 93% 18%, rgba(255, 255, 255, 0.55), transparent);
  }

  /* Glass cards with the logo shimmer on the edge, and a soft light that follows the pointer */
  .card, .piece {
    border: 1px solid transparent;
    background:
      radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), rgba(174, 188, 242, 0.13), transparent 60%) padding-box,
      linear-gradient(var(--card), var(--card)) padding-box,
      var(--iris-soft) border-box;
    backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  }
  .card.lift:hover, .piece:hover { box-shadow: var(--shadow-hover); }
  .proj .thumb, .shot { background: #10131c; }

  /* Iridescent headings, like the logo */
  html .hero h1, .section-head h2, .art-hero h1 {
    background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: none; filter: drop-shadow(0 0 22px rgba(160, 150, 255, 0.28));
    width: fit-content; max-width: 100%;
  }
  html .hero h1, .section-head h2 { margin-left: auto; margin-right: auto; }
  html .avatar { border: 3px solid transparent; background: var(--iris) border-box; box-shadow: 0 0 0 6px rgba(185, 166, 255, 0.08), 0 0 50px rgba(160, 150, 255, 0.35); }
  .lb { background: rgba(8, 10, 16, 0.9); }
  ::selection { background: rgba(185, 166, 255, 0.35); }
}
