/* ==========================================================================
   paulbenson.info - 2026 rebuild
   Palette: ink navy, royal blue, sky, bone.
   Type: DM Serif Display (display) / DM Sans (body) / JetBrains Mono (data)
   ========================================================================== */

@property --glow { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --ink: #0a0f1c;
  --slate: #141b2d;
  --slate-2: #1c2539;
  --glass: #38bdf8;
  --glass-deep: #0ea5e9;
  --copper: #60a5fa;
  --copper-deep: #1a56db;
  --bone: #ece6da;
  --bone-dim: color-mix(in oklab, var(--bone) 62%, transparent);
  --bone-mute: color-mix(in oklab, var(--bone) 40%, transparent);
  --line: color-mix(in oklab, var(--bone) 12%, transparent);

  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --body: "DM Sans", "Segoe UI", Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --max: 82rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
  color-scheme: dark;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--glass); outline-offset: 4px; border-radius: 2px; }

.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.skip { position: absolute; left: -999px; top: 1rem; background: var(--glass); color: var(--ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.printable { display: none; }

/* --- header ------------------------------------------------------------ */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--gutter);
  background: linear-gradient(to bottom, color-mix(in oklab, var(--ink) 85%, transparent), color-mix(in oklab, var(--ink) 55%, transparent) 70%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.mark { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: .02em; }
.mark svg { width: 48px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.nav a { position: relative; padding: .25rem 0; opacity: .75; transition: opacity .3s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: currentColor; transition: right .4s var(--ease-out); }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.nav a:hover::after, .nav a[aria-current]::after { right: 0; }
.top__cv { padding-block: .45rem; }
@media (max-width: 640px) { .nav { display: none; } }

/* --- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.25rem; border-radius: 6px;
  font-family: var(--body); font-size: .92rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  border: 1px solid transparent;
  transition: transform .5s var(--ease-spring), background .3s, color .3s, border-color .3s, box-shadow .3s;
  will-change: transform;
}
.btn--solid { background: var(--glass); color: var(--ink); box-shadow: 0 0 0 0 color-mix(in oklab, var(--glass) 40%, transparent); }
.btn--solid:hover { box-shadow: 0 0 40px -6px var(--glass); }
.btn--ghost { border-color: color-mix(in oklab, var(--bone) 28%, transparent); color: var(--bone); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--bone); background: color-mix(in oklab, var(--bone) 6%, transparent); }

/* --- hero -------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh; isolation: isolate;
  display: grid; grid-template-rows: 1fr auto auto; align-items: end;
  padding: calc(var(--gutter) + 4rem) var(--gutter) var(--gutter);
  overflow: hidden;
}
.hero__art {
  position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; animation: art-in 2.4s var(--ease-out) .2s forwards;
  transform: scale(1.06); transform-origin: 60% 50%;
}
@keyframes art-in { to { opacity: .9; transform: scale(1); } }
.hero__gl { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 80% at 20% 60%, color-mix(in oklab, var(--ink) 72%, transparent), transparent 70%),
    linear-gradient(to top, var(--ink) 0%, transparent 38%),
    linear-gradient(to bottom, color-mix(in oklab, var(--ink) 60%, transparent), transparent 30%);
}
.hero__body { max-width: none; }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; color: var(--bone-dim); margin-bottom: 1.75rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--glass); box-shadow: 0 0 0 0 var(--glass); animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--glass) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

.hero__name {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4rem, 11.5vw, 12rem);
  line-height: .92; letter-spacing: -.015em;
  text-wrap: nowrap; margin: 0 0 1.25rem -.04em;
  color: var(--bone);
}
.hero__name .line { display: block; overflow: hidden; }
.hero__name .line::after { content: none; }
.hero__name .line { clip-path: inset(0 0 -20% 0); }
.hero__name .line { animation: rise 1.3s var(--ease-out) both; }
.hero__name .line:nth-child(2) { animation-delay: .12s; color: var(--copper); }
@keyframes rise { from { translate: 0 110%; } to { translate: 0 0; } }
@keyframes sheen { to { background-position: -200% 0; } }

.hero__role { font-family: var(--body); font-weight: 500; font-size: clamp(1.25rem, 2.4vw, 1.9rem); letter-spacing: -.01em; margin-bottom: 1.25rem; animation: fade 1s var(--ease-out) .5s both; }
.hero__role em { font-style: normal; color: var(--copper); }
.hero__lede { max-width: 34rem; color: var(--bone-dim); text-wrap: pretty; margin-bottom: 2rem; animation: fade 1s var(--ease-out) .65s both; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; animation: fade 1s var(--ease-out) .8s both; }
@keyframes fade { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

.hero__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem;
  margin-top: clamp(2.5rem, 6vh, 5rem); padding-top: 1.5rem; border-top: 1px solid var(--line);
  text-transform: none; letter-spacing: 0;
  animation: fade 1s var(--ease-out) 1s both;
}
.hero__facts dt { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: var(--bone-mute); margin-bottom: .3rem; }
.hero__facts dd { font-size: 1rem; color: var(--bone); }

.hero__scroll { position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--bone-mute); }
.hero__scroll span { writing-mode: vertical-rl; }
.hero__scroll i { width: 1px; height: 48px; background: linear-gradient(var(--bone-mute), transparent); overflow: hidden; position: relative; }
.hero__scroll i::after { content: ''; position: absolute; inset: 0; background: var(--glass); translate: 0 -100%; animation: drip 2s ease-in-out infinite; }
@keyframes drip { to { translate: 0 100%; } }
@media (max-width: 720px) { .hero__scroll { display: none; } }

/* --- sections ---------------------------------------------------------- */
.section { position: relative; max-width: var(--max); margin-inline: auto; padding: clamp(5rem, 12vh, 10rem) var(--gutter); }
.kicker { color: var(--glass); margin-bottom: 1.25rem; }
.h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4.4vw, 4rem); line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
.section__head { max-width: 48rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section__sub { color: var(--bone-dim); margin-top: 1.25rem; }

/* reveal on scroll - CSS scroll-driven first, JS fallback */
.reveal { opacity: 0; translate: 0 32px; transition: opacity .9s var(--ease-out), translate .9s var(--ease-out); }
.reveal.in { opacity: 1; translate: 0 0; }
@supports (animation-timeline: view()) {
  .reveal { transition: none; animation: reveal-in linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  @keyframes reveal-in { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
}

/* --- about ------------------------------------------------------------- */
.about { display: grid; grid-template-columns: minmax(12rem, 1fr) 2.2fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about__portrait figure { position: relative; width: min(100%, 18rem); padding: .6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--slate); transform-style: preserve-3d; }
.about__portrait img { width: 100%; height: auto; aspect-ratio: 129 / 160; object-fit: cover; filter: grayscale(1) contrast(1.08); border-radius: 2px; transition: filter .6s; }
.about__portrait figure:hover img { filter: grayscale(0) contrast(1); }
.about__portrait figure::before { content: ''; position: absolute; inset: -1px; border-radius: 4px; padding: 1px; background: conic-gradient(from var(--ang), var(--glass), transparent 30%, var(--copper) 55%, transparent 80%, var(--glass)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; -webkit-mask-composite: xor; animation: spin 8s linear infinite; }
@keyframes spin { to { --ang: 360deg; } }
.about__portrait figcaption { margin-top: .6rem; color: var(--bone-mute); font-size: .68rem; }
.prose { margin-top: 1.75rem; color: var(--bone-dim); display: grid; gap: 1rem; max-width: 40ch; font-size: 1.05em; }
.prose p { text-wrap: pretty; }
.about__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.about__tags li { padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 3px; color: var(--bone-dim); font-size: .68rem; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .about__portrait figure { width: 11rem; } }

/* --- timeline ---------------------------------------------------------- */
.timeline { position: relative; display: grid; gap: clamp(2rem, 4vw, 3rem); }
.timeline::before {
  content: ''; position: absolute; left: clamp(6.5rem, 12vw, 11rem); top: 0; bottom: 0; width: 1px;
  background: var(--line);
  transform: translateX(-.5px);
}
.role { display: grid; grid-template-columns: clamp(6.5rem, 12vw, 11rem) 1fr; gap: 0 clamp(1.5rem, 3vw, 3rem); position: relative; }
.role::before { content: ''; position: absolute; left: clamp(6.5rem, 12vw, 11rem); top: 1.75rem; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); border: 1px solid var(--glass); transform: translateX(-50%); box-shadow: 0 0 0 4px var(--ink); z-index: 1; }
.role:first-child::before { background: var(--glass); }
.role__when { display: flex; flex-direction: column; gap: .2rem; padding-top: 1.55rem; color: var(--bone-mute); text-transform: none; letter-spacing: 0; font-size: .74rem; }
.role__when time, .role__when .now { color: var(--bone-dim); }
.role__when .now { color: var(--glass); }
.role__when b { font-weight: 500; color: var(--copper); margin-top: .35rem; }
.role__card {
  position: relative; padding: clamp(1.25rem, 2.5vw, 2rem);
  background: color-mix(in oklab, var(--slate) 80%, transparent);
  border: 1px solid var(--line); border-radius: 6px;
  transform-style: preserve-3d; transition: border-color .4s, background .4s;
}
.role__card:hover { border-color: color-mix(in oklab, var(--glass) 40%, transparent); }
.role__card--major { border-color: color-mix(in oklab, var(--copper) 35%, transparent); background: linear-gradient(135deg, color-mix(in oklab, var(--copper) 9%, var(--slate)), var(--slate) 55%); }
.role__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 1.9rem); letter-spacing: 0; line-height: 1.1; }
.role__org { margin: .5rem 0 1rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.role__loc { color: var(--bone-mute); font-weight: 400; font-size: .68rem; }
.role__card > p:not(.role__org) { color: var(--bone-dim); text-wrap: pretty; max-width: 62ch; }
.role__card > p + p:not(.role__org) { margin-top: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.25rem; }
.chips li { font-family: var(--body); font-size: .8rem; letter-spacing: 0; padding: .28rem .55rem; border-radius: 3px; background: color-mix(in oklab, var(--bone) 5%, transparent); color: var(--bone-dim); border: 1px solid var(--line); transition: color .3s, border-color .3s; }
.role__card:hover .chips li { color: var(--bone); }
@media (max-width: 640px) {
  .timeline::before, .role::before { left: 0; }
  .role { grid-template-columns: 1fr; padding-left: 1.5rem; gap: .5rem; }
  .role__when { flex-direction: row; flex-wrap: wrap; gap: .5rem; padding-top: 0; }
}

/* --- wins -------------------------------------------------------------- */
.wins__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.win { padding: 1.5rem 1.5rem 1.5rem 1.75rem; border: 1px solid var(--line); border-left: 3px solid var(--copper); border-radius: 6px; background: var(--slate); }
.win p { font-size: 1.04rem; line-height: 1.55; color: var(--bone-dim); text-wrap: pretty; }
.win strong { color: var(--bone); font-weight: 700; }

/* --- stack ------------------------------------------------------------- */
.stack__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.stack__cell { padding: 1.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--slate); transform-style: preserve-3d; transition: border-color .4s; }
.stack__cell:hover { border-color: color-mix(in oklab, var(--copper) 45%, transparent); }
.stack__cell h3 { color: var(--copper); font-weight: 500; margin-bottom: .5rem; }
.chips--lg { margin-top: .75rem; gap: .5rem; }
.chips--lg li { font-size: .9rem; padding: .4rem .7rem; border-radius: 4px; color: var(--bone); background: transparent; }

/* --- contact ----------------------------------------------------------- */
.contact { padding-bottom: clamp(3rem, 8vh, 6rem); }
.contact__big { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 8.5vw, 8rem); line-height: .98; letter-spacing: -.01em; margin: .5rem 0 2.5rem; }
.contact__big a { display: block; }
.contact__big span { display: block; transition: color .4s, translate .6s var(--ease-spring); }
.contact__big span:last-child { color: var(--glass); }
.contact__big a:hover span:first-child { translate: .5vw 0; }
.contact__big a:hover span:last-child { color: var(--copper); translate: 1.5vw 0; }
.contact__row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* --- footer / toast ---------------------------------------------------- */
.foot { max-width: var(--max); margin-inline: auto; padding: 2rem var(--gutter) max(2rem, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--bone-mute); border-top: 1px solid var(--line); font-size: .68rem; }
.toast { position: fixed; left: 50%; bottom: 2rem; translate: -50% 20px; opacity: 0; padding: .7rem 1.1rem; border-radius: 6px; background: var(--bone); color: var(--ink); z-index: 60; pointer-events: none; transition: opacity .35s, translate .5s var(--ease-spring); }
.toast.show { opacity: 1; translate: -50% 0; }

/* --- 3D tilt cards ----------------------------------------------------- */
.tilt { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .6s var(--ease-spring); }
.tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(240px circle at var(--gx) var(--gy), color-mix(in oklab, var(--glass) 12%, transparent), transparent 60%); opacity: 0; transition: opacity .4s; }
.tilt:hover::after { opacity: 1; }
.tilt.is-tilting { transition: transform .12s ease-out; }

/* --- motion / print ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; translate: 0; animation: none; }
  .hero__gl { display: none; }
  .hero__art { opacity: .9; transform: none; }
}

@media print {
  :root { --ink: #fff; --slate: #f4f4f4; --slate-2: #eee; --bone: #111; --bone-dim: #333; --bone-mute: #666; --line: #ccc; --glass: #0a7a6b; --copper: #a65d22; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .top, .hero__art, .hero__gl, .hero__veil, .hero__scroll, .btn, .toast, .dot, .about__portrait figure::before { display: none !important; }
  .hero { min-height: 0; padding: 0 0 1cm; }
  .hero__name { font-size: 36pt; }
  .hero__name .line:nth-child(2) { color: #111; -webkit-text-stroke: 0; background: none; }
  .section { padding: .8cm 0; break-inside: avoid; }
  .reveal { opacity: 1 !important; translate: 0 !important; animation: none !important; }
  .role__card, .stack__cell, .win { break-inside: avoid; }
  .printable { display: inline; }
  .contact__big { font-size: 20pt; }
  .contact__big span { display: inline; }
}

/* --- additions ---------------------------------------------------------- */
.inline { color: var(--glass); border-bottom: 1px solid color-mix(in oklab, var(--glass) 40%, transparent); transition: border-color .3s; }
.inline:hover { border-color: var(--glass); }
.stack__cell--wide { grid-column: span 2; border-color: color-mix(in oklab, var(--glass) 30%, transparent); background: linear-gradient(135deg, color-mix(in oklab, var(--glass) 8%, var(--slate)), var(--slate) 60%); }
.stack__cell--wide h3 { color: var(--glass); }
@media (max-width: 640px) { .stack__cell--wide { grid-column: auto; } }
.contact__sub { color: var(--bone-mute); margin: -1.5rem 0 1.5rem; }
.hero__facts dd { text-wrap: balance; }
