/* ───────────────────────────────────────────────────────────────────────────
   Vincent Allen — vincentallen.pro
   Built against DESIGN_BRIEF.md.

   THE PURPLE RULES — the whole look depends on these three:
     1. SATURATED VIOLET IS LIGHT, NOT PAINT. It appears as glow, hairline and
        small text — never as a large filled block. A big #8B5CF6 panel is
        exactly what makes a purple site look like a free template.
     2. VIOLET TEXT ON DARK IS --lilac, NEVER --violet. #8B5CF6 on #08060F is
        ~4.0:1 and fails WCAG AA. #C4B5FD passes comfortably.
     3. ONE WARM ACCENT. Gold appears on the availability dot and nowhere else,
        so the palette isn't monochromatically cold.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --void:      #08060F;
  --plum:      #120C1F;
  --plum-2:    #1B1230;
  --violet:    #8B5CF6;
  --violet-lo: #6D28D9;
  --lilac:     #C4B5FD;
  --paper:     #EDEAF5;
  --muted:     #9B93B4;
  --muted-2:   #645C7E;
  --gold:      #D9B26A;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad:  clamp(3.5rem, 7vw, 6.5rem);
}

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.75;
  color: var(--paper); background: var(--void);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
figure { margin: 0; }                    /* UA default is 1em 40px — see 5.Fokhrul */
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 3px; }

::selection { background: rgba(139,92,246,.35); color: #fff; }

/* ── the spotlight ─────────────────────────────────────────────────────────
   A violet glow that follows the pointer. Fixed + pointer-events:none so it
   never intercepts a click, and behind everything via z-index. This is the one
   piece of expensive motion on the page. */
.spot {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(
    36rem 36rem at var(--mx, 50%) var(--my, 30%),
    rgba(139,92,246,.13), rgba(109,40,217,.05) 42%, transparent 70%);
  transition: background-position .2s ease-out;
}
/* Static ambient wash for touch devices, where there is no pointer to track. */
.field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 40% at 12% 8%, rgba(109,40,217,.20), transparent 70%),
    radial-gradient(45% 38% at 88% 92%, rgba(139,92,246,.11), transparent 72%);
}

/* ── shell: sticky identity | scrolling content ────────────────────────── */
.shell {
  position: relative; z-index: 1;
  width: min(1280px, 92vw); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5.5rem);
}

.aside {
  position: sticky; top: 0; align-self: start;
  height: 100vh; max-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: var(--pad);
  /* A sticky panel that runs long stops reading as a fixed identity and starts
     reading as a second article. Hard cap on measure. */
  max-width: 34ch;
}
.main { padding-block: var(--pad); min-width: 0; }

/* ── identity ──────────────────────────────────────────────────────────── */
.avatar {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  margin-bottom: 1.75rem; position: relative;
  border: 1px solid rgba(139,92,246,.35);
  box-shadow: 0 0 0 6px rgba(139,92,246,.06), 0 18px 40px -18px rgba(0,0,0,.9);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
/* The source is a phone photo against a domestic door. A tight crop plus this
   vignette pushes the background down so it reads as a portrait, not a selfie. */
.avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, transparent 45%, rgba(8,6,15,.55));
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.2rem); letter-spacing: -0.04em;
  margin-bottom: .6rem;
}
.role {
  font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em;
  color: var(--lilac); margin-bottom: 1.25rem;
}
.pitch { color: var(--muted); font-size: 1.02rem; margin-bottom: 2.5rem; }
.pitch a { color: var(--paper); text-decoration: none; border-bottom: 1px solid rgba(139,92,246,.5); }
.pitch a:hover { border-bottom-color: var(--violet); color: #fff; }

/* section nav — the active link is driven by IntersectionObserver in site.js */
.nav { display: none; margin-bottom: 2.5rem; }
.nav a {
  display: flex; align-items: center; gap: .9rem;
  padding: .45rem 0; text-decoration: none;
  font-size: .78rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-2); transition: color .25s ease;
}
.nav i {
  display: block; height: 1px; width: 2rem; background: var(--muted-2);
  transition: width .3s var(--ease), background-color .25s ease;
}
.nav a:hover, .nav a.is-active { color: var(--paper); }
.nav a:hover i, .nav a.is-active i { width: 3.5rem; background: var(--violet); }

.socials { display: flex; gap: .6rem; margin-bottom: 1.75rem; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--plum-2); color: var(--muted);
  transition: color .25s ease, border-color .25s ease, transform .25s var(--ease), background-color .25s ease;
}
.socials a:hover {
  color: var(--lilac); border-color: rgba(139,92,246,.6);
  background: rgba(139,92,246,.08); transform: translateY(-2px);
}
.socials svg { width: 17px; height: 17px; }

.avail { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--muted-2); }
.avail::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,178,106,.16);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── sections ──────────────────────────────────────────────────────────── */
.sec { margin-bottom: clamp(4.5rem, 9vw, 7.5rem); scroll-margin-top: 2rem; }
.sec:last-child { margin-bottom: 0; }
.label {
  display: flex; align-items: center; gap: .9rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--lilac); margin-bottom: 1.75rem;
}
.label::after {
  content: ''; flex: 1; height: 1px; max-width: 5rem;
  background: linear-gradient(90deg, rgba(139,92,246,.6), transparent);
}
.prose { max-width: 62ch; color: var(--muted); }
.prose p + p { margin-top: 1.1rem; }
.prose strong { color: var(--paper); font-weight: 600; }

/* ── capabilities ──────────────────────────────────────────────────────── */
.caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.cap {
  padding: 1.6rem 1.5rem; border-radius: 10px;
  background: var(--plum); border: 1px solid var(--plum-2);
  transition: border-color .3s ease, transform .3s var(--ease), background-color .3s ease;
}
.cap:hover {
  border-color: rgba(139,92,246,.45); transform: translateY(-3px);
  background: #16102a;
}
.cap__ico {
  width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.28);
  color: var(--lilac); margin-bottom: 1rem; font-size: 18px;
}
.cap h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: .5rem; letter-spacing: -0.01em; }
.cap p { font-size: .92rem; color: var(--muted); line-height: 1.65; }

/* ── work rows ─────────────────────────────────────────────────────────── */
.work { display: flex; flex-direction: column; gap: clamp(2.5rem, 5vw, 4rem); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3vw, 2.75rem); align-items: center; }
.row:nth-child(even) .row__media { order: 2; }

.row__media {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--plum-2); background: var(--plum);
  aspect-ratio: 16 / 10;
}
.row__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s var(--ease);
}
/* The frame stays put; only its contents move. A frame that scales on hover
   nudges everything around it and the grid visibly breathes. */
.row:hover .row__media img { transform: scale(1.03); }
.row__media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,6,15,.10), rgba(8,6,15,.45));
  opacity: .9; transition: opacity .4s ease;
}
.row:hover .row__media::after { opacity: .55; }

.row__team {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .7rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: .7rem;
}
.row__team b { color: var(--lilac); font-weight: 650; }
.row h3 { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.025em; margin-bottom: .7rem; }
.row p { color: var(--muted); font-size: .96rem; line-height: 1.7; }
.row__meta {
  display: flex; align-items: center; gap: .5rem; margin-top: .8rem;
  font-family: var(--mono); font-size: .78rem; color: var(--lilac);
}
.row__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.row__tags li {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  padding: .28rem .6rem; border-radius: 5px;
  background: rgba(139,92,246,.07); border: 1px solid rgba(139,92,246,.16);
}

/* ── stack ─────────────────────────────────────────────────────────────── */
.stack { display: grid; gap: 1.6rem; }
.stack__g h3 {
  font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: .75rem;
}
.stack__g ul { display: flex; flex-wrap: wrap; gap: .45rem; }
.stack__g li {
  font-size: .84rem; color: var(--paper);
  padding: .4rem .8rem; border-radius: 999px;
  background: var(--plum); border: 1px solid var(--plum-2);
  transition: border-color .25s ease, color .25s ease;
}
.stack__g li:hover { border-color: rgba(139,92,246,.5); color: var(--lilac); }

/* ── contact ───────────────────────────────────────────────────────────── */
.contact h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 1rem; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.8rem;
  padding: .95rem 1.7rem; border-radius: 999px; text-decoration: none;
  font-size: .95rem; font-weight: 650;
  color: var(--void); background: var(--lilac);
  transition: transform .25s var(--ease), background-color .25s ease, box-shadow .25s ease;
}
.btn:hover {
  transform: translateY(-2px); background: #fff;
  box-shadow: 0 14px 34px -14px rgba(139,92,246,.7);
}
.btn svg { width: 16px; height: 16px; }

.foot {
  margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: 2rem;
  border-top: 1px solid var(--plum-2);
  font-size: .8rem; color: var(--muted-2);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ── icons ─────────────────────────────────────────────────────────────── */
.ico {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── reveal ────────────────────────────────────────────────────────────────
   Scoped to .js (set inline in <head>). If the script never runs, nothing is
   hidden — a reveal animation must never be able to blank the page. */
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .nav { display: block; }          /* the rail only exists where it can stick */
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .aside {
    position: static; height: auto; max-height: none; max-width: none;
    padding-bottom: 0;
  }
  .main { padding-top: clamp(2.5rem, 6vw, 3.5rem); }
  .spot { display: none; }          /* no pointer to track */
}
@media (max-width: 720px) {
  .caps { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row:nth-child(even) .row__media { order: 0; }   /* stacked: image always first */
  .foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .spot { display: none; }
}
