/* Kelly Blue — portfolio. Plain CSS, no build step.
   Breakpoints match the original design: 640px (sm), 768px (md), 1024px (lg). */

:root {
  --bg: #0a0a0a;
  --bg-alt: #0d0d0d;
  --fg: #fafafa;
  --card: #1a1a1a;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --display: 'Bebas Neue', sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --size-hero: clamp(4rem, 15vw, 12rem);
  --size-section: clamp(3rem, 10vw, 8rem);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background-color: rgba(156, 163, 175, 0.3); color: var(--fg); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

.font-display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.85;
}

/* ---------- grain overlay ---------- */
.grain-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: overlay;
}
.grain-overlay::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* ---------- navigation ---------- */
.nav-text {
  font-size: 0.875rem; line-height: 1.25rem;
  color: #fff;
  mix-blend-mode: difference;
  transition: opacity 0.3s;
}
.nav-text:hover { opacity: 0.6; }
.nav-link { position: relative; padding: 0.25rem 0; }
.nav-link.is-active::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: #fff;
}
.social { display: flex; align-items: center; gap: 1rem; }

/* mobile header (below 768px) */
.nav-mobile {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1.5rem;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.nav-mobile__list {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  margin-top: 1.5rem;
  transition: opacity 0.3s, transform 0.3s;
}
/* With JavaScript the list is a toggled dropdown; without it, it just shows. */
.js .nav-mobile__list { opacity: 0; transform: translateY(-1rem); pointer-events: none; }
.js .nav-mobile.is-open .nav-mobile__list { opacity: 1; transform: none; pointer-events: auto; }

/* desktop: social top-right, sections bottom-right */
.nav-desktop-social, .nav-desktop { display: none; }
@media (min-width: 768px) {
  .nav-mobile { display: none; }
  .nav-desktop-social {
    display: flex; gap: 1.5rem; justify-content: flex-end;
    position: fixed; top: 0; right: 0; z-index: 50; padding: 2.5rem;
  }
  .nav-desktop {
    display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem;
    position: fixed; bottom: 0; right: 0; z-index: 50; padding: 2.5rem;
    transition: opacity 0.5s, transform 0.5s;
  }
  .nav-desktop.is-hidden { opacity: 0; transform: translateX(2rem); pointer-events: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; width: 100%; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.hero__content {
  position: relative; z-index: 10; height: 100%;
  display: flex; align-items: flex-end;
  padding: 0 1rem 8rem;
}
.hero__inner { width: 100%; max-width: 64rem; }
.hero__title {
  font-size: 15vw;
  letter-spacing: -0.04em;
  color: #fff;
  animation: fade-up 0.8s ease-out both;
}
.hero__title span { display: block; }
.hero__lead {
  margin-top: 1.5rem;
  max-width: 24rem;
  font-size: 0.875rem; line-height: 1.625;
  color: rgba(255, 255, 255, 0.8);
  animation: fade-in 0.8s ease-out 0.5s both;
}
@media (min-width: 640px) {
  .hero__content { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero__title { font-size: 12vw; }
  .hero__lead { font-size: 1rem; }
}
@media (min-width: 768px) {
  .hero__shade { background: rgba(0, 0, 0, 0.4); }
  .hero__content { align-items: center; padding: 0 3rem; }
  .hero__title { font-size: var(--size-hero); }
  .hero__lead { margin-top: 2rem; max-width: 28rem; }
}
@media (min-width: 1024px) { .hero__content { padding: 0 4rem; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- sections ---------- */
.section { padding: 8rem 2rem; }
.section--alt { background: var(--bg-alt); }
.section--clip { overflow: hidden; }
@media (min-width: 768px) { .section { padding: 12rem 4rem; } }
@media (min-width: 1024px) { .section { padding: 16rem 6rem; } }
.container { max-width: 80rem; margin: 0 auto; }

.section-label { margin-bottom: 4rem; }
.section-label > span,
.meta-label {
  font-size: 0.875rem; line-height: 1.25rem;
  color: var(--gray-500);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.section-label__rule { width: 1.5rem; height: 1px; background: var(--gray-600); margin-top: 0.5rem; }

.heading { font-size: 10vw; margin-bottom: 4rem; }
.heading--skills { margin-bottom: 3rem; }
.heading--proof { margin-bottom: 2rem; }
.heading--contact { font-size: 12vw; margin-bottom: 2rem; }
@media (min-width: 1024px) {
  .heading { font-size: var(--size-section); margin-bottom: 6rem; }
  .heading--skills { margin-bottom: 5rem; }
  .heading--proof { margin-bottom: 2rem; }
  .heading--contact { font-size: var(--size-hero); margin-bottom: 2rem; }
}

/* ---------- about ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.split--gap { margin-bottom: 6rem; }
.split--top-gap { margin-top: 6rem; }
.split__text { display: flex; align-items: center; }
.order-last-mobile { order: 2; }
.body-text { font-size: 1rem; line-height: 1.625; color: var(--gray-300); }
.caption {
  margin-top: 1rem;
  font-size: 0.75rem; line-height: 1rem;
  color: var(--gray-500); letter-spacing: 0.1em; text-transform: uppercase;
}
.grayscale { width: 100%; filter: grayscale(100%); }
.grayscale--hover { transition: filter 0.7s; }
.grayscale--hover:hover { filter: grayscale(0%); }

.quote { margin-bottom: 6rem; }
.quote__text { font-size: 8vw; color: var(--gray-300); }
.quote__highlight { color: #fff; text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.quote__source { margin-top: 1.5rem; }

@media (min-width: 1024px) {
  .split { grid-template-columns: 1fr 1fr; gap: 6rem; }
  .split--gap, .quote { margin-bottom: 8rem; }
  .split--top-gap { margin-top: 8rem; }
  .order-last-mobile { order: 0; }
  .body-text { font-size: 1.125rem; }
  .text-right-desktop { text-align: right; }
  .quote__text { font-size: var(--size-section); }
}

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: 1fr; column-gap: 4rem; row-gap: 1rem; }
.skills li {
  border-bottom: 1px solid var(--gray-800);
  padding-bottom: 1rem;
  font-size: 1.125rem; line-height: 1.75rem; font-weight: 300;
  color: var(--gray-300);
}
@media (min-width: 768px) { .skills { grid-template-columns: 1fr 1fr; } .skills li { font-size: 1.25rem; } }
@media (min-width: 1024px) { .skills { row-gap: 1.5rem; } .skills li { font-size: 1.5rem; line-height: 2rem; } }

/* ---------- work & certs rows ---------- */
.row, .link-row, .contact-link, .rows__end { border-top: 1px solid var(--gray-800); }
.row { display: grid; grid-template-columns: 1fr; }
.row--work { padding: 2rem 0; gap: 1.5rem; }
.row--cert { padding: 2rem 0; gap: 1rem; }
.row__title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 300; color: #fff; margin-bottom: 0.5rem; }
.row__org { font-size: 1rem; color: var(--gray-400); }
.row__org-sm { font-size: 0.875rem; color: var(--gray-500); }
.row__place { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.5rem; }
.row__desc { font-size: 0.875rem; line-height: 1.625; color: var(--gray-400); }
.row--work .row__desc { margin-bottom: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem; line-height: 1rem; color: var(--gray-500);
  border: 1px solid var(--gray-800); border-radius: 9999px;
}
@media (min-width: 768px) {
  .row--work { padding: 3rem 0; }
  .row--cert { padding: 2.5rem 0; }
  .row__title { font-size: 1.5rem; line-height: 2rem; }
}
@media (min-width: 1024px) {
  .row { grid-template-columns: 5fr 2fr 5fr; gap: 2rem; }
  .row--work { padding: 4rem 0; }
  .row__title--lg { font-size: 1.875rem; line-height: 2.25rem; }
  .row__org { font-size: 1.125rem; }
  .row__desc { font-size: 1rem; }
}

/* ---------- writeups & hall of fame ---------- */
.link-row {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.5rem 1rem; margin: 0 -1rem;
  transition: background-color 0.3s;
}
.link-row:hover { background: rgba(17, 24, 39, 0.3); }
.link-row--lighter:hover { background: rgba(31, 41, 55, 0.3); }
.link-row__title { font-size: 1.125rem; line-height: 1.75rem; font-weight: 300; color: #fff; transition: color 0.3s; }
.link-row:hover .link-row__title { color: var(--gray-300); }
.link-row__sub { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }
.link-row__year { font-size: 0.875rem; color: var(--gray-600); }
@media (min-width: 768px) {
  .link-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem 1rem; }
  .link-row__title { font-size: 1.25rem; }
  .link-row__sub { margin-top: 0.5rem; }
}
@media (min-width: 1024px) { .link-row__title { font-size: 1.5rem; line-height: 2rem; } }

/* rows that aren't links (private programs): no hover effect */
.link-row--static:hover { background: none; }
.link-row--static:hover .link-row__title { color: #fff; }
.inline-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color 0.3s; }
.inline-link:hover { color: #fff; }
.hero__lead strong { color: #fff; font-weight: 500; }

/* ---------- featured disclosed report ---------- */
.report {
  display: block;
  border: 1px solid var(--gray-800);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.3s, background-color 0.3s;
}
.report:hover { border-color: var(--gray-600); background: rgba(17, 24, 39, 0.3); }
.report__kicker { margin-bottom: 1rem; }
.report__title { font-size: 1.375rem; line-height: 1.3; font-weight: 300; color: #fff; max-width: 52rem; }
.report__facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem;
  margin: 2rem 0; padding: 1.5rem 0;
  border-top: 1px solid var(--gray-800); border-bottom: 1px solid var(--gray-800);
}
.report__facts dt { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 0.25rem; }
.report__facts dd { font-size: 1rem; color: var(--gray-300); }
.report__summary { font-size: 0.9375rem; line-height: 1.7; color: var(--gray-400); max-width: 48rem; }
.report__cta { display: inline-block; margin-top: 1.5rem; font-size: 0.875rem; letter-spacing: 0.05em; color: var(--gray-300); transition: color 0.3s; }
.report:hover .report__cta { color: #fff; }
@media (min-width: 768px) {
  .report { padding: 2.5rem; }
  .report__title { font-size: 1.875rem; }
  .report__facts { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .report { padding: 3.5rem; }
  .report__title { font-size: 2.25rem; }
  .report__summary { font-size: 1.0625rem; }
}

/* ---------- proof collage ---------- */
.proof-intro { max-width: 36rem; margin-bottom: 4rem; }
@media (min-width: 1024px) { .proof-intro { margin-bottom: 6rem; } }
.proof-stack { position: relative; width: 100%; height: 152vw; }
@media (min-width: 640px) { .proof-stack { height: 82vw; } }
@media (min-width: 1024px) { .proof-stack { height: 41rem; } }
.proof {
  --r: var(--mr);
  position: absolute;
  left: var(--ml); top: var(--mt); width: var(--mw);
  z-index: var(--z);
  border-radius: 6px; overflow: hidden;
  background: var(--card);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 60px -12px rgba(0, 0, 0, 0.9);
  transform: rotate(var(--r));
  transition: transform 0.3s ease;
}
@media (min-width: 768px) { .proof { --r: var(--dr); left: var(--dl); top: var(--dt); width: var(--dw); } }
.proof img { width: 100%; }
.proof:hover { transform: rotate(0deg) scale(1.05); z-index: 99; }

/* ---------- contact ---------- */
.contact-rule { width: 100%; height: 1px; background: var(--gray-700); margin-bottom: 3rem; }
.contact-intro { max-width: 42rem; margin-bottom: 3rem; }
.contact-intro__title { font-size: 1.25rem; line-height: 0.9; font-weight: 300; color: #fff; margin-bottom: 1rem; }
.contact-links { max-width: 42rem; }
.contact-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem; margin: 0 -1rem;
  transition: background-color 0.3s;
}
.contact-link:hover { background: rgba(17, 24, 39, 0.3); }
.contact-link__label { font-size: 0.875rem; color: var(--gray-400); letter-spacing: 0.1em; }
.contact-link__arrow { color: var(--gray-500); transition: color 0.3s; }
.contact-link:hover .contact-link__arrow { color: #fff; }
.direct { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--gray-800); }
.direct__label { margin-bottom: 1.5rem; }
.direct__links { display: flex; flex-direction: column; gap: 1rem; }
.direct__links a {
  font-size: 1.125rem; color: var(--gray-300);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: color 0.3s;
}
.direct__links a:hover { color: #fff; }
.footer {
  margin-top: 6rem; padding-top: 2rem; border-top: 1px solid var(--gray-900);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 1rem;
  font-size: 0.75rem; color: var(--gray-600);
}
@media (min-width: 640px) { .direct__links { flex-direction: row; gap: 2rem; } }
@media (min-width: 768px) {
  .contact-intro__title { font-size: 1.5rem; }
  .contact-link { padding: 1.5rem 1rem; }
  .direct__links { gap: 4rem; }
  .footer { flex-direction: row; }
}
@media (min-width: 1024px) {
  .contact-rule, .contact-intro { margin-bottom: 4rem; }
  .contact-intro__title { font-size: 1.875rem; }
  .direct { margin-top: 6rem; padding-top: 4rem; }
  .direct__label { margin-bottom: 2rem; }
  .direct__links a { font-size: 1.25rem; }
  .footer { margin-top: 8rem; }
}

/* ---------- scroll-in animations (only with JavaScript) ----------
   Elements start offset by --x/--y and fade in when script.js marks them
   .is-visible. Per-element timing comes from inline --dur / --delay. */
.js .reveal {
  opacity: 0;
  transform: translate(var(--x, 0), var(--y, 40px));
  transition: opacity var(--dur, 0.8s) ease-out var(--delay, 0s),
              transform var(--dur, 0.8s) ease-out var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* proof cards: start tilted more and slightly smaller, settle into place */
.js .proof {
  opacity: 0;
  transform: translateY(30px) rotate(calc(var(--r) * 2.5)) scale(0.94);
  transition: opacity 0.7s ease-out var(--delay, 0s), transform 0.7s ease-out var(--delay, 0s);
}
.js .proof.is-visible { opacity: 1; transform: rotate(var(--r)); }
.js .proof.is-settled { transition: transform 0.3s ease; }   /* snappy hover once in place */
.js .proof.is-visible:hover { transform: rotate(0deg) scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain-overlay::before, .hero__title, .hero__lead { animation: none; }
  .js .reveal, .js .proof { opacity: 1; transition: none; }
  .js .reveal { transform: none; }
  .js .proof { transform: rotate(var(--r)); }
}
