/* Base + shared site styles for John Costello portfolio */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; max-width: 100%; }
body { margin: 0; background: var(--paper); color: var(--slate-12);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-synthesis: none; transition: background .5s var(--ease-out), color .5s var(--ease-out); overflow-x: clip; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; }

:root { --edge: 64px; --maxw: 2040px; }
@media (max-width: 1500px) { :root { --maxw: 1340px; } }
@media (max-width: 900px) { :root { --edge: 24px; } }
@media (max-width: 760px) { :root { --edge: 16px; } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--edge); padding-right: var(--edge); }

/* ── floating blurred gradient aura (subtle life) ── */
.jc-aura { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.jc-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
.jc-aura span { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.jc-aura .b1 { width: 640px; height: 640px; left: -140px; top: -120px;
  background: radial-gradient(circle, var(--aura-1), transparent 68%); animation: jc-aura1 28s ease-in-out infinite; }
.jc-aura .b2 { width: 720px; height: 720px; right: -160px; top: 26%;
  background: radial-gradient(circle, var(--aura-2), transparent 68%); animation: jc-aura2 34s ease-in-out infinite; }
.jc-aura .b3 { width: 600px; height: 600px; left: 4%; bottom: -200px;
  background: radial-gradient(circle, var(--aura-3), transparent 68%); animation: jc-aura3 31s ease-in-out infinite; }
@keyframes jc-aura1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(70px,50px) scale(1.08); } }
@keyframes jc-aura2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px,40px) scale(1.06); } }
@keyframes jc-aura3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,-60px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .jc-aura span { animation: none; } }
/* keep all page content above the aura */
.jc-home, .jc-cs, .jc-rs { position: relative; z-index: 1; }
/* particle-name canvas (shared by home + resume) */
.jc-namecanvas { position: relative; width: 100%; height: clamp(240px, 42vh, 540px); }
.jc-namecanvas canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.jc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
/* page-in transition (v2) — fill-mode intentionally NOT 'both': a lingering
   filled transform (even identity) creates a containing block that breaks the
   sticky pin in the work section. Default fill reverts to truly-none after. */
.jc-page { animation: jc-pagein .55s cubic-bezier(.22,.61,.36,1) backwards; }
@keyframes jc-pagein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jc-page { animation: none; } }

/* labels */
.eyebrow { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-9); }
.cond { font-family: var(--font-condensed); }
.mono { font-family: var(--font-mono); }

/* display helpers — Bricolage Grotesque grotesque; hierarchy via weight, never italics */
.disp { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.ital { font-style: normal; font-weight: 600; }
.accent { color: var(--accent); }
/* Apple-Intelligence-style gradient text */
.ai-gradient {
  background: linear-gradient(100deg, #5a8cff 0%, #9b6bff 26%, #d65bb5 50%, #f4606c 72%, #f7943f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
blockquote { font-style: normal; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .85s var(--ease-out), transform .85s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal-img { clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--ease-out); }
.reveal-img.in { clip-path: inset(0 0 0 0); }
/* reserve area before a lazy image loads, so the IntersectionObserver (which can't fire for a
   zero-area target) always reveals it — otherwise the clip-path stays closed forever. */
.reveal-img:not(.in) { min-height: 220px; }

/* top bar — centered floating nav pill */
/* top bar — wordmark left, centered floating liquid-glass nav pill, meta right */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--edge) 0; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.tb-logo { justify-self: start; font-family: 'Satoshi', sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.01em; color: var(--slate-12); transition: color .3s var(--ease-out); }
.tb-now { justify-self: end; font-family: var(--font-sans); font-weight: 500; font-size: 14px; color: var(--slate-11); white-space: nowrap; transition: color .3s var(--ease-out); }
.tb-logo.is-dark { color: #fff; }
.tb-now.is-dark { color: rgba(255,255,255,.82); }
.glass-defs { position: absolute; width: 0; height: 0; }

/* mirror layers removed */
.tb-glass-mirror, .tb-glass-inner, .tb-liquid { display: none; }

/* the floating liquid-glass capsule */
.tb-nav { justify-self: center; grid-column: 2; position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; gap: 2px; padding: 5px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
  -webkit-backdrop-filter: blur(10px) saturate(170%) brightness(1.04);
  backdrop-filter: blur(10px) saturate(170%) brightness(1.04);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.9),          /* top edge catch-light */
    inset 0 8px 14px -10px rgba(255,255,255,.85),   /* domed upper sheen */
    inset 0 -8px 16px -10px rgba(120,130,160,.35),  /* curved lower shade */
    inset 1px 0 1px rgba(255,255,255,.5),
    inset -1px 0 1px rgba(255,255,255,.5),
    0 18px 40px -16px rgba(30,32,50,.5),
    0 4px 12px -6px rgba(30,32,50,.28); }
/* refined edge-lens: inner light ring, gentle chromatic rim, top sheen */
.tb-nav::after { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.45),
    inset 1.5px 0 2px -1px rgba(255,40,80,.4),
    inset -1.5px 0 2px -1px rgba(40,180,255,.4),
    inset 0 3px 5px -3px rgba(255,255,255,.85);
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 34%); opacity: .6; }
/* sliding selected knob */
.tb-knob { position: absolute; z-index: 1; top: 5px; left: 0; height: calc(100% - 10px); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.2));
  box-shadow: 0 2px 6px -2px rgba(30,32,50,.3), inset 0 1px 0 rgba(255,255,255,.85), inset 0 -2px 4px -1px rgba(120,130,160,.3);
  transform-origin: center;
  transition: transform .3s cubic-bezier(.5,1.55,.45,1), width .26s cubic-bezier(.5,1.55,.45,1), scale .26s cubic-bezier(.5,1.6,.45,1), opacity .25s; }
.tb-knob.moving { scale: 1 1.16; }
.tb-link { position: relative; z-index: 2; padding: 9px 18px; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 500; font-size: 15px; color: var(--slate-11); line-height: 1;
  white-space: nowrap; transition: color .25s; }
.tb-link:hover { color: var(--slate-12); }
.tb-link.active { color: var(--slate-12); }
/* dark-aware: over photographic project frames the glass tints dark with light text */
.tb-nav.is-dark { background: linear-gradient(180deg, rgba(20,22,28,.46), rgba(20,22,28,.30));
  -webkit-backdrop-filter: blur(16px) saturate(150%) brightness(.92);
  backdrop-filter: blur(16px) saturate(150%) brightness(.92);
  border-color: rgba(255,255,255,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -8px 16px -10px rgba(0,0,0,.5),
    0 18px 40px -16px rgba(0,0,0,.55); }
.tb-nav.is-dark::after { box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    inset 1.5px 0 2px -1px rgba(255,80,110,.4),
    inset -1.5px 0 2px -1px rgba(90,200,255,.4),
    inset 0 2px 4px -2px rgba(255,255,255,.45);
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 36%); opacity: .65; }
.tb-nav.is-dark .tb-link { color: rgba(255,255,255,.72); }
.tb-nav.is-dark .tb-link:hover, .tb-nav.is-dark .tb-link.active { color: #fff; }
.tb-nav.is-dark .tb-knob { background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px -2px rgba(0,0,0,.5); }
@media (max-width: 760px) {
  .tb-now { display: none; }
  .tb-logo { display: none; }
  .tb-link { padding: 10px 16px; font-size: 16px; }
  .tb-nav { padding: 5px; }
}
.tb-clock { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--slate-9); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-daynight { flex: 0 0 auto; }
.tb-daynight.sun { color: var(--accent); }
.tb-daynight.moon { color: var(--slate-10); }
/* fixed bottom-right clock */
.jc-fixedclock { position: fixed; right: var(--edge); bottom: 18px; z-index: 110; pointer-events: none; }
.jc-fixedclock .tb-clock { mix-blend-mode: difference; color: #d6cdbd; }
.tb-clock .live { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-9); }

/* curtain page transition — fast expo wipe */
.curtain { position: fixed; inset: 0; z-index: 300; background: var(--ink); color: #fff;
  transform: translateY(100%); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.curtain.cover { transform: translateY(0); transition: transform .44s cubic-bezier(.83,0,.17,1); }
.curtain.exit  { transform: translateY(-100%); transition: transform .46s cubic-bezier(.83,0,.17,1); }
.curtain.reset { transform: translateY(100%); transition: none; }
.curtain .label { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 7vw, 96px); letter-spacing: -.018em;
  opacity: 0; transform: translateY(18px); transition: opacity .26s var(--ease-out) .06s, transform .3s var(--ease-out) .06s; }
.curtain.cover .label { opacity: 1; transform: none; }
.curtain .label .ital { color: var(--accent-7); }

/* generic pill / link-arrow */
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid currentColor; border-radius: 9999px; padding: 9px 18px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.arrowlink { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; transition: gap .25s var(--ease-out), color .2s; }
.arrowlink:hover { gap: 18px; color: var(--accent); }

/* footer / contact */
.site-foot { background: var(--ink); color: #fff; padding: 96px 0 40px; }
.site-foot .big { font-family: var(--font-display); font-weight: 600; letter-spacing: -.022em; line-height: .98; font-size: clamp(48px, 9vw, 132px); margin-bottom: 56px;
  background:
    linear-gradient(to bottom, #ffffff 0%, #f4f4f7 34%, rgba(244,244,247,0) 100%),
    linear-gradient(100deg, #bda6ec 0%, #a7c5f2 15%, #8fd7ac 30%, #eec3d2 41%, #f2e35c 53%, #f6b96a 66%, #f78fb4 80%, #f368a0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.site-foot .big .ai-gradient { background: none; -webkit-text-fill-color: inherit; color: inherit; }
.site-foot a { text-decoration: none; }
.site-foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.site-foot .links { display: flex; flex-direction: column; gap: 29px; font-size: 23px; font-family: var(--font-sans); }
.site-foot .links a { color: var(--slate-7); transition: color .2s; }
.site-foot .links a:hover { color: #fff; }
.site-foot .meta .cr { font-size: 1.75em; line-height: 1; position: relative; top: .12em; }
.site-foot .meta .cline { display: inline-flex; align-items: center; gap: .55em; }
.site-foot .meta .cline .sep { opacity: .85; position: relative; top: -.02em; margin: 0 -.04em; }
.site-foot .meta .tb-clock { font-family: var(--font-sans); color: inherit; font-size: inherit; letter-spacing: normal; gap: 0; }
.site-foot .meta .tb-clock svg, .site-foot .meta .tb-clock .live { display: none; }

/* email — grey by default; accent gradient fades in over the grey + underline
   draws in, once scrolled to the bottom (gradient is static, just fades on) */
.site-foot .links a.email-grad { position: relative; color: var(--slate-8); align-self: flex-start; width: fit-content; cursor: pointer; }
.site-foot .links a.email-grad::before {
  content: attr(data-email);
  position: absolute; left: 0; top: 0; opacity: 0;
  background: linear-gradient(100deg, #5a8cff 0%, #9b6bff 26%, #d65bb5 50%, #f4606c 72%, #f7943f 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  pointer-events: none;
}
.site-foot .links a.email-grad.in-view::before {
  animation: email-grad-in .7s var(--ease-out) .9s forwards, email-grad-flow 8.5s ease-in-out 1.6s infinite;
}
.site-foot .links a.email-grad.in-view::after {
  content: ''; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: linear-gradient(100deg, #5a8cff 0%, #9b6bff 26%, #d65bb5 50%, #f4606c 72%, #f7943f 100%);
  background-size: 220% 100%;
  animation: email-underline .7s var(--ease-out) .95s forwards, email-grad-flow 8.5s ease-in-out 1.6s infinite;
}
@keyframes email-grad-in { to { opacity: 1; } }
@keyframes email-grad-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes email-underline { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .site-foot .links a.email-grad.in-view::before { animation: none; opacity: 1; }
  .site-foot .links a.email-grad.in-view::after { animation: none; width: 100%; }
}
.site-foot .links button { text-align: left; color: var(--slate-7); font-size: 23px; font-family: var(--font-sans); transition: color .2s; }
.site-foot .links button:hover { color: #fff; }
.site-foot .meta { margin-top: 64px; display: flex; justify-content: space-between; align-items: center; gap: 28px; padding-top: 24px; border-top: 1px solid var(--slate-a-8);
  font-family: var(--font-mono); font-size: 14.4px; letter-spacing: .08em; color: var(--slate-9); }
.site-foot .meta > span:first-child { display: inline-flex; align-items: center; }
.site-foot .meta .foot-clock { display: inline-flex; align-items: center; gap: 9px; }
.site-foot .meta .foot-clock .tb-daynight { flex: 0 0 auto; }
.site-foot .meta .foot-clock .tb-daynight.sun { color: var(--accent); }
.site-foot .meta .foot-clock .tb-daynight.moon { color: inherit; }
.site-foot .foot-note { margin-top: 0; max-width: 420px; font-family: var(--font-condensed); font-size: 17px; color: var(--slate-7); }

/* ── intro loader ── */
/* ── intro: iridescent ring on the page's own paper background ── */
.jc-intro { position: fixed; inset: 0; z-index: 500; background: #efefef;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .7s var(--ease-out); }
.jc-intro.leaving { opacity: 0; pointer-events: none; }
.jc-intro-ring { width: min(44vmin, 300px); aspect-ratio: 1; animation: jc-ring-in .9s var(--ease-out) both; }
.jc-intro-ring i { display: block; width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(from 0deg, #5a8cff, #9b6bff, #d65bb5, #f4606c, #f7943f, #f2e35c, #8fd7ac, #5a8cff);
  -webkit-mask: radial-gradient(closest-side, transparent 56%, #000 61%, #000 87%, transparent 93%);
          mask: radial-gradient(closest-side, transparent 56%, #000 61%, #000 87%, transparent 93%);
  filter: blur(7px) saturate(1.15); animation: jc-ring-spin 2.6s linear infinite; }
@keyframes jc-ring-spin { to { transform: rotate(360deg); } }
@keyframes jc-ring-in { from { opacity: 0; transform: scale(.62); } to { opacity: 1; transform: scale(1); } }
.jc-intro.leaving .jc-intro-ring { transform: scale(1.12); transition: transform .7s var(--ease-out); }

/* ── custom cursor ── */
@media (hover: hover) and (pointer: fine) {
  .jc-cursor { position: fixed; top: 0; left: 0; z-index: 400; width: 9px; height: 9px; border-radius: 50%;
    background: #8c8c80; pointer-events: none; opacity: 0; mix-blend-mode: normal;
    display: flex; align-items: center; justify-content: center;
    transition: width .3s var(--ease-out), height .3s var(--ease-out), background .3s, opacity .25s; }
  .jc-cursor.vis { opacity: 1; }
  .jc-cursor .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--slate-12); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease-out); white-space: nowrap; }
  .jc-cursor.active { width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.03));
    -webkit-backdrop-filter: blur(12px) saturate(170%) brightness(1.04); backdrop-filter: blur(12px) saturate(170%) brightness(1.04);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 8px 14px -10px rgba(255,255,255,.85), inset 0 -8px 16px -10px rgba(120,130,160,.35), inset 1px 0 1px rgba(255,255,255,.5), inset -1px 0 1px rgba(255,255,255,.5), inset 1.5px 0 2px -1px rgba(255,40,80,.2), inset -1.5px 0 2px -1px rgba(40,180,255,.2), 0 18px 40px -16px rgba(30,32,50,.5), 0 4px 12px -6px rgba(30,32,50,.28); }
  .jc-cursor.active .lbl { opacity: 1; transform: none; }
  /* dark-glass cursor over dark imagery (white label, smoked fill) */
  .jc-cursor.active.on-dark {
    background: linear-gradient(180deg, rgba(20,22,28,.5), rgba(20,22,28,.32));
    border: 1px solid rgba(255,255,255,.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 8px 16px -10px rgba(255,255,255,.3), inset 0 -8px 16px -10px rgba(0,0,0,.5), inset 1.5px 0 2px -1px rgba(255,80,110,.4), inset -1.5px 0 2px -1px rgba(40,180,255,.4), 0 18px 40px -16px rgba(0,0,0,.55), 0 4px 12px -6px rgba(0,0,0,.4); }
  .jc-cursor.active.on-dark .lbl { color: #fff; }
  /* hide native cursor on interactive media so the custom one reads cleanly */
  [data-cursor] { cursor: none; }
}

/* ── hand-drawn scribbles ── */
.scribble-ul, .scribble-circle { position: absolute; left: -2%; width: 104%; pointer-events: none; }
.scribble-ul { bottom: -.18em; height: .42em; }
.scribble-circle { top: -18%; height: 136%; left: -8%; width: 116%; z-index: -1; }
.scribble-ul path, .scribble-circle path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.scribble-ul.drawn path, .scribble-circle.drawn path { animation: jc-draw .9s var(--ease-out) forwards; }
@keyframes jc-draw { to { stroke-dashoffset: 0; } }
.scribble-aster { display: inline-block; vertical-align: middle; }
.scribble-aster .ap { stroke-dasharray: 1; stroke-dashoffset: 1; }
.scribble-aster.drawn .ap { animation: jc-draw .5s var(--ease-out) forwards; }
.scribbled { position: relative; display: inline-block; }
.jc-starburst { animation: jc-spin 18s linear infinite; transform-origin: center; }
@keyframes jc-spin { to { transform: rotate(360deg); } }
/* signature: writes itself in, stroke by stroke, when scrolled into view */
svg.jc-sign path { stroke-dasharray: 1; stroke-dashoffset: 1; }
svg.jc-sign.drawn path { animation: jc-sign-draw .8s var(--ease-out) forwards; }
@keyframes jc-sign-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { svg.jc-sign path { stroke-dashoffset: 0; animation: none; } }

/* particle name canvas — shared by home + résumé so it sits identically */
.jc-namecanvas { position: relative; width: 100%; height: clamp(260px, 46vh, 580px); margin-top: -100px; }
.jc-namecanvas canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
