/* =========================================================
   Kenny Haas — Portfolio (Option 1)
   ========================================================= */

:root {
  color-scheme: light;

  --brand:         #2563eb;
  --brand-dark:    #1d4ed8;   /* hover accent */
  --brand-light:   #7cb0ff;
  --brand-50:      #eff5ff;   /* tinted surface: section bg, panels, hover fills */
  --brand-100:     #dbe9ff;   /* icon-chip bg */
  --ink:           #14143a;
  --ink-soft:      #3a3a5c;
  --body:          #5b5b74;
  --line:          #e3e9f3;
  --white:         #ffffff;
  --bg:            #ffffff;
  --bg-alt:        #f7f9fe;

  --surface:       #ffffff;   /* cards, panels, mobile nav */
  --surface-2:     #f3f4f8;   /* modal stage, photo frame */
  --header-bg:     rgba(255, 255, 255, .85);
  --hero-top:      #ffffff;   /* hero gradient top */
  --thumb-bg:      #eef4ff;   /* project screenshot backdrop */
  --hover-bg:      #f1f0f7;   /* subtle hover surface */
  --muted:         #9aacc8;   /* placeholder / fallback text */
  --footer-bg:     #14143a;
  --footer-fg:     #b9b7d6;

  --accent-violet: #7c3aed;
  --accent-orange: #f0842b;
  --accent-green:  #4aa745;
  --accent-red:    #dc2626;
  --accent-teal:   #12a2a2;
  --accent-pink:   #e0468c;

  --radius:        16px;
  --radius-sm:     10px;
  --shadow-sm:     0 1px 3px rgba(20, 20, 58, .06), 0 1px 2px rgba(20, 20, 58, .04);
  --shadow-md:     0 10px 30px rgba(20, 20, 58, .08);
  --shadow-lg:     0 24px 60px rgba(29, 78, 216, .18);
  --container:     1140px;
  --ease:          cubic-bezier(.4, 0, .2, 1);

  --font-head: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --brand:         #5b9dff;
  --brand-dark:    #82b6ff;   /* hover = brighter on dark */
  --brand-light:   #6f9de8;
  --brand-50:      #172032;
  --brand-100:     #1f2c48;
  --ink:           #f2f4fb;
  --ink-soft:      #c2c8dd;
  --body:          #9aa1bb;
  --line:          #2a3350;
  --bg:            #0f1220;
  --bg-alt:        #12162a;

  --surface:       #171c2e;
  --surface-2:     #10131f;
  --header-bg:     rgba(15, 18, 32, .82);
  --hero-top:      #0d0f18;
  --thumb-bg:      #0e1626;
  --hover-bg:      #20263c;
  --muted:         #5a6178;
  --footer-bg:     #0a0c14;
  --footer-fg:     #8b90a8;

  --shadow-sm:     0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md:     0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg:     0 24px 60px rgba(0, 0, 0, .55);
}

/* Smooth colour fade only while the toggle is flipping (JS adds/removes .theme-anim) */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color .3s var(--ease),
              border-color .3s var(--ease),
              color .3s var(--ease),
              fill .3s var(--ease),
              stroke .3s var(--ease),
              box-shadow .3s var(--ease) !important;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .32);
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .4);
}
.btn:active { transform: scale(.97); }
.btn-primary:active { transform: translateY(0) scale(.97); }
.btn-lg { padding: 15px 30px; font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 74px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  flex-shrink: 0;
  transition: transform .18s var(--ease);
}
.logo:hover { transform: translateY(-2px); }
.logo:active { transform: translateY(0) scale(.98); }
.logo-badge {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .5px;
}
.logo-text { font-weight: 700; font-size: 1.15rem; color: var(--ink); white-space: nowrap; }

.main-nav {
  display: flex;
  gap: 34px;
  margin-left: auto;
}
.main-nav a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
  transition: color .18s var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--brand);
  transition: width .22s var(--ease);
}
.main-nav a:hover,
.main-nav a.is-active { color: var(--brand); }
.main-nav a:hover::after,
.main-nav a.is-active::after { width: 100%; }

/* Below ~1120px the full desktop header runs out of room and the "Kenny Haas"
   logo starts wrapping. Drop the CTA (Contact is still in the nav) and tighten
   the header/nav spacing so it stays on one line down to the mobile breakpoint. */
@media (max-width: 1120px) {
  .header-cta { display: none; }
  .header-inner { gap: 16px; }
  .main-nav { gap: 22px; }
}

.header-cta { flex-shrink: 0; }

.header-social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.header-social:hover { color: var(--brand); background: var(--brand-50); }
.header-social svg { width: 20px; height: 20px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.theme-toggle:hover { color: var(--brand); background: var(--brand-50); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .tt-sun { display: none; }
.theme-toggle .tt-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Decorative shapes ---------- */
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.dot-grid {
  position: absolute;
  width: 130px; height: 120px;
  background-image: radial-gradient(var(--brand-light) 1.6px, transparent 1.6px);
  background-size: 16px 16px;
  opacity: .5;
}
.dot-grid-hero { left: 8px; top: 40px; }
.dot-grid-contact { left: 12px; bottom: 30px; }

/* Hero geometric decoration (top-right) */
.hero-deco {
  position: absolute;
  top: -40px;
  right: -40px;
  width: min(46vw, 560px);
  height: auto;
  overflow: visible;
  color: var(--brand);
}
.hero-deco .hd-ring   { fill: none; stroke: currentColor; stroke-width: 1.5; }
.hero-deco .hd-fill   { fill: currentColor; }
.hero-deco .hd-dot-lt { fill: var(--brand-light); }

/* Contact geometric decoration (bottom-right) */
.contact-deco {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: min(46vw, 560px);
  height: auto;
  overflow: visible;
  color: var(--brand);
}
.contact-deco .cd-ring   { fill: none; stroke: currentColor; stroke-width: 1.5; }
.contact-deco .cd-fill   { fill: currentColor; }
.contact-deco .cd-dot-lt { fill: var(--brand-light); }

/* Projects ambient decoration (top-left, quieter than the hero) */
.section-projects .container { position: relative; z-index: 1; }
.projects-deco {
  position: absolute;
  left: -70px;
  top: -50px;
  width: min(44vw, 500px);
  height: auto;
  overflow: visible;
  color: var(--brand);
}
.projects-deco .pd-ring   { fill: none; stroke: currentColor; stroke-width: 1.5; }
.projects-deco .pd-fill   { fill: currentColor; }
.projects-deco .pd-dot-lt { fill: var(--brand-light); }

@media (max-width: 780px) {
  .hero-deco { top: -24px; right: -30px; width: min(64vw, 360px); }
  .contact-deco { right: -30px; bottom: -40px; width: min(64vw, 360px); }
  .projects-deco { left: -50px; top: -30px; width: min(66vw, 360px); }
  /* on phones these small floating dots crowd the headings and read like stray punctuation */
  .hero-deco .hd-accent,
  .hero-deco .hd-dot-lt,
  .projects-deco .pd-accent,
  .projects-deco .pd-dot-lt,
  .contact-deco .cd-accent,
  .contact-deco .cd-dot-lt { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--brand-50) 100%);
  padding: 90px 0 110px;
}
.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--brand);
  font-size: .95rem;
  margin-bottom: 10px;
}
.hero-name {
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--ink);
  font-size: clamp(2.4rem, 11vw, 8.5rem);
  line-height: .98;
  letter-spacing: -.02em;
}
.hero-roles {
  margin-top: 18px;
  color: var(--brand);
  font-weight: 500;
  font-size: clamp(1rem, 2.1vw, 1.20rem);
}
.hero-status {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.status-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .22);
  animation: statusPulse 2.6s var(--ease) infinite;
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 163, 74, .22); }
  70%      { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); }
}

/* ---------- Sections ---------- */
.section { position: relative; padding: 84px 0; }
/* alternating backgrounds: About(bg) - Projects(alt) - Experience(bg) - Testimonials(alt) - Contact(bg) */
#projects { background: var(--bg-alt); }
.section-testimonials { background: var(--bg-alt); }

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 44px;
}
.section-head h2 {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 1.35rem;
  color: var(--brand);
  position: relative;
  padding-bottom: 12px;
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 46px; height: 3px;
  background: var(--brand);
  border-radius: 3px;
}
.section-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand);
  flex-shrink: 0;
}
.section-icon svg { width: 22px; height: 22px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 60px;
  align-items: start;
}
.about-photo { position: relative; width: 320px; }
.photo-frame {
  position: relative;
  z-index: 2;
  width: 300px; height: 300px;
  margin: 10px auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame img.is-missing { display: none; }
.photo-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.photo-fallback svg { width: 46px; height: 46px; }
.photo-frame img.is-missing + .photo-fallback { display: flex; }

.photo-accent {
  position: absolute;
  z-index: 1;
  width: 190px; height: 190px;
  left: -6px; bottom: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  opacity: .9;
}
.dot-grid-photo { right: -6px; top: 0; opacity: .6; }

.about-body h3 {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.about-body p + p { margin-top: 14px; }

.skills { margin-top: 30px; }
.skills-group + .skills-group { margin-top: 28px; }
.skills-group-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand);
  margin-bottom: 18px;
}
.skills-list {
  columns: 3;
  column-gap: 28px;
}
.skills-list li {
  break-inside: avoid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.skills-list li::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 11px;
  margin-top: 3px;
  border: solid var(--brand);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@media (max-width: 960px) {
  .skills-list { columns: 2; }
}
@media (max-width: 620px) {
  .skills-list { columns: 1; }
}

/* ---------- Experience (timeline) ---------- */
.timeline {
  position: relative;
  list-style: none;
  padding-left: 36px;
  max-width: 820px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding-bottom: 44px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 10px;
}
.tl-head h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.tl-meta { font-size: .86rem; color: var(--body); }
.tl-roles {
  list-style: none;
  margin-bottom: 14px;
}
.tl-roles li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 3px 0;
}
.tl-role { font-weight: 600; color: var(--ink-soft); }
.tl-dates {
  color: var(--brand);
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
}
.tl-summary {
  font-size: .92rem;
  color: var(--body);
  line-height: 1.62;
}
.tl-education {
  margin-top: 6px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 820px;
}
.tl-education h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand);
  margin-bottom: 12px;
}
.tl-education p { font-size: .92rem; color: var(--ink-soft); }
.tl-education p + p { margin-top: 6px; }
.tl-education strong { color: var(--ink); font-weight: 600; }
.tl-muted { color: var(--body); }

@media (max-width: 560px) {
  .tl-roles li { justify-content: flex-start; }
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
/* Snappy button-style hover; beats the .reveal 0.6s transition once revealed */
.project-grid .project-card {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), opacity .5s var(--ease);
}
.project-grid .project-card.reveal:not(.is-visible) {
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
/* higher specificity than `.reveal.is-visible { transform: none }` so the lift wins */
.project-grid .project-card:hover,
.project-grid .project-card:has(.case-link:focus-visible) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-grid .project-card:active {
  transform: translateY(0) scale(.988);
}
/* keyboard focus only — no persistent ring after a mouse click */
.project-grid .project-card:has(.case-link:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.project-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.project-card-head h3 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}
.project-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  color: #fff;
  flex-shrink: 0;
}
.project-icon svg { width: 20px; height: 20px; }
.project-card[data-accent="violet"] .project-icon { background: var(--accent-violet); }
.project-card[data-accent="orange"] .project-icon { background: var(--accent-orange); }
.project-card[data-accent="green"]  .project-icon { background: var(--accent-green); }
.project-card[data-accent="red"]    .project-icon { background: var(--accent-red); }
.project-card[data-accent="teal"]   .project-icon { background: var(--accent-teal); }
.project-card[data-accent="pink"]   .project-icon { background: var(--accent-pink); }

.project-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1920 / 912;
  background: var(--thumb-bg);
  margin-bottom: 16px;
}
.project-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* screenshots fade in once decoded instead of popping (JS adds .is-loaded) */
.js .project-thumb img {
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.js .project-thumb img.is-loaded { opacity: 1; }
.thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.project-thumb.is-missing img { display: none; }
.project-thumb.is-missing .thumb-fallback { display: flex; }

.project-card p {
  font-size: .9rem;
  color: var(--body);
  flex: 1;
}
.project-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.project-result-label {
  display: block;
  margin-bottom: 3px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-link {
  margin-top: 16px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .18s var(--ease), color .18s var(--ease);
}
.case-link:hover { gap: 12px; color: var(--brand-dark); }
.project-card:hover .case-link { gap: 12px; color: var(--brand-dark); }
.case-link:focus-visible { outline: none; }
/* Stretch the case-study link to cover the whole card */
.case-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

/* Résumé download inside the Experience section */
.tl-resume {
  margin: 34px 0 6px;
}

/* ---------- Testimonials ---------- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.quote-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.quote-mark {
  font-family: var(--font-head);
  font-size: 2.6rem;
  line-height: .6;
  color: var(--brand);
  opacity: .3;
}
.quote-card blockquote {
  flex: 1;
  margin-top: 12px;
}
.quote-card blockquote p {
  font-size: .92rem;
  line-height: 1.62;
  color: var(--body);
}
.quote-card figcaption {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.quote-name {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: .98rem;
}
.quote-title { font-size: .84rem; color: var(--ink-soft); }
.quote-rel { font-size: .8rem; color: var(--brand); font-weight: 600; }

@media (max-width: 900px) {
  .quote-grid { grid-template-columns: 1fr; max-width: 620px; }
}

/* ---------- Contact ---------- */
.section-contact { background: var(--bg); overflow: hidden; }
.section-contact .container { position: relative; z-index: 1; }
.contact-intro {
  margin-top: -20px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.contact-loc {
  display: block;
  margin-top: 8px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--brand);
}
.contact-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--brand);
}
.contact-resume svg { width: 16px; height: 16px; }
/* transform-based slide (smoother than animating flex `gap`); scoped so it
   beats the .reveal class transition that JS adds to this link */
.section-contact .contact-resume {
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.section-contact .contact-resume.reveal:not(.is-visible) {
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.section-contact .contact-resume:hover {
  transform: translateX(4px);
  color: var(--brand-dark);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.contact-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), opacity .5s var(--ease);
}
/* snappy button-style transition; beats the .reveal 0.6s once scrolled in */
.contact-grid .contact-item {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), opacity .5s var(--ease);
}
/* keep the gentle slide only for the scroll-in entrance */
.contact-grid .contact-item.reveal:not(.is-visible) {
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
/* same raised hover as the site buttons; beats `.reveal.is-visible { transform: none }` */
.contact-grid .contact-item:hover,
.contact-grid .contact-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.contact-grid .contact-item:active {
  transform: translateY(0) scale(.988);
}
.contact-icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  margin-bottom: 10px;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-label {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}
.contact-value { color: var(--body); font-size: .92rem; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer .logo-text { color: #fff; }
.site-footer .footer-inner p { font-size: .85rem; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Core Skills chips — same idea, smaller offset, staggered per item */
.chip-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.chip-reveal.is-visible { opacity: 1; transform: none; }

/* ---------- On-load intro (header + hero) ---------- */
/* Hidden from first paint only when JS is active, so nothing gets stuck. */
.js .site-header {
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .55s var(--ease), transform .55s var(--ease),
              box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.js .site-header.intro-in {
  opacity: 1;
  transform: none;
}
/* Case-study pages: the header is already familiar from the main page — show it immediately, no slide-in */
body:has(.cs-main) .site-header {
  opacity: 1;
  transform: none;
}
.js .hero .eyebrow,
.js .hero .hero-name,
.js .hero .hero-roles,
.js .hero .hero-status {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .hero .eyebrow.intro-in,
.js .hero .hero-name.intro-in,
.js .hero .hero-roles.intro-in,
.js .hero .hero-status.intro-in {
  opacity: 1;
  transform: none;
}
/* the hero's blue shapes fade up with the intro rather than just appearing */
.js .hero .hero-bg,
.js .cs-hero .hero-bg {
  opacity: 0;
  transition: opacity .8s var(--ease);
}
.js .hero .hero-bg.intro-in,
.js .cs-hero .hero-bg.intro-in { opacity: 1; }
/* About section — staggered in just after the hero */
.js #about .section-head,
.js .about-photo,
.js .about-body {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.js #about .section-head.intro-in,
.js .about-photo.intro-in,
.js .about-body.intro-in {
  opacity: 1;
  transform: none;
}

/* Repeat visits to the main page within the same session: the intro already
   played once, so show the header/hero/about immediately, no re-animation */
html.intro-done .site-header,
html.intro-done .hero .eyebrow,
html.intro-done .hero .hero-name,
html.intro-done .hero .hero-roles,
html.intro-done .hero .hero-status,
html.intro-done .hero .hero-bg,
html.intro-done #about .section-head,
html.intro-done .about-photo,
html.intro-done .about-body {
  opacity: 1;
  transform: none;
}

/* Case-study hero — same on-load intro as the main hero */
.js .cs-hero .cs-back,
.js .cs-hero .cs-eyebrow,
.js .cs-hero h1,
.js .cs-hero .cs-lede,
.js .cs-hero .cs-meta,
.js .cs-hero .cs-cta {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .cs-hero .cs-back.intro-in,
.js .cs-hero .cs-eyebrow.intro-in,
.js .cs-hero h1.intro-in,
.js .cs-hero .cs-lede.intro-in,
.js .cs-hero .cs-meta.intro-in,
.js .cs-hero .cs-cta.intro-in {
  opacity: 1;
  transform: none;
}
/* Once the hero intro is done, the back link uses a snappy transform slide on
   hover (specificity here beats the .intro-in transform reset above);
   it points back, so it nudges left */
.js .cs-hero .cs-back.intro-in {
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.js .cs-hero .cs-back:hover {
  transform: translateX(-4px);
  color: var(--brand-dark);
}
/* Restore the CTA button's hover lift past the .intro-in transform reset */
.js .cs-hero .cs-cta.intro-in {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.js .cs-hero .cs-cta:hover { transform: translateY(-2px); }
.js .cs-hero .cs-cta:active { transform: translateY(0) scale(.97); }

/* ---------- In-page PDF viewer ---------- */
body.pdf-open { overflow: hidden; }

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 32px);
  background: rgba(20, 20, 58, .55);
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease),
              -webkit-backdrop-filter .22s var(--ease),
              backdrop-filter .22s var(--ease),
              visibility 0s linear .22s;
}
.pdf-modal.is-open {
  opacity: 1;
  visibility: visible;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: opacity .22s var(--ease),
              -webkit-backdrop-filter .22s var(--ease),
              backdrop-filter .22s var(--ease);
}
.pdf-modal__panel {
  width: min(1320px, 100%);
  height: min(92vh, 100%);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* starts as a point at the bottom, then grows + rises into place (reverses on close) */
  transform-origin: center center;
  transform: translateY(100%) scale(0);
  transition: transform .26s cubic-bezier(.4, 0, 1, 1);
}
.pdf-modal.is-open .pdf-modal__panel {
  transform: none;
  transition: transform .46s cubic-bezier(.32, .72, 0, 1);
}

.pdf-modal__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.pdf-modal__title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-modal__tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdf-modal__link {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.pdf-modal__link:hover { background: var(--brand-50); color: var(--brand-dark); }
.pdf-modal__close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.pdf-modal__close:hover { background: var(--hover-bg); color: var(--ink); }
.pdf-modal__close svg { width: 20px; height: 20px; }

.pdf-modal__stage {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--surface-2);
}
.pdf-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 640px) {
  .pdf-modal { padding: 0; }
  .pdf-modal__panel { width: 100%; height: 100%; border-radius: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 260px 1fr; gap: 40px; }
  .about-photo { width: 260px; }
  .photo-frame { width: 240px; height: 240px; }
}

/* Header collapses to the hamburger menu earlier than the page layout does, so
   the desktop nav never gets cramped enough to wrap the "Kenny Haas" logo. */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .header-social { margin-left: auto; }
  .main-nav {
    position: absolute;
    top: 74px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 24px 16px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .main-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; }
  .main-nav a:last-child { border-bottom: none; }
  .main-nav a::after { display: none; }
}

@media (max-width: 780px) {
  .section { padding: 60px 0; }
  .hero { padding: 64px 0 78px; }

  .about-grid { grid-template-columns: 1fr; gap: 36px; justify-items: center; text-align: left; }
  .about-photo { margin-bottom: 6px; }
  .about-body { width: 100%; }

  .project-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .container { padding-inline: 18px; }
  .logo-text { font-size: 1.02rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .chip-reveal,
  .cs-reveal { opacity: 1; transform: none; transition: none; }
  .js .site-header,
  .js .hero .hero-bg,
  .js .cs-hero .hero-bg,
  .js .hero .eyebrow,
  .js .hero .hero-name,
  .js .hero .hero-roles,
  .js .hero .hero-status,
  .js #about .section-head,
  .js .about-photo,
  .js .about-body,
  .js .cs-hero .cs-back,
  .js .cs-hero .cs-eyebrow,
  .js .cs-hero h1,
  .js .cs-hero .cs-lede,
  .js .cs-hero .cs-meta,
  .js .cs-hero .cs-cta,
  .js .project-thumb img { opacity: 1; transform: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* =========================================================
   Case study pages  (/work/*.html)
   ========================================================= */
.cs-main { display: block; }

.cs-hero {
  position: relative;
  padding: 56px 0 44px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.cs-hero .container { position: relative; z-index: 1; }
/* geometric decoration echoing the main hero, top-right; scoped a touch smaller */
.cs-hero .hero-deco {
  width: min(42vw, 460px);
  top: -70px;
  right: -50px;
}
@media (max-width: 780px) {
  .cs-hero .hero-deco { width: min(64vw, 320px); top: -40px; right: -34px; }
  /* the dot grid sits right under the back link at phone width — drop it, the rings carry the decoration */
  .cs-hero .dot-grid-hero { display: none; }
}
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 24px;
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.cs-back:hover { transform: translateX(-4px); color: var(--brand-dark); }
.cs-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.cs-hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 2.85rem);
  line-height: 1.1;
  color: var(--ink);
  max-width: 22ch;
}
.cs-lede {
  margin-top: 16px;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 58ch;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 36px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cs-meta > div {
  background: var(--surface);
  padding: 18px 20px;
}
.cs-meta dt {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 7px;
}
.cs-meta dd { font-size: .89rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 720px) {
  .cs-meta { grid-template-columns: 1fr; }
}

.cs-cta { margin-top: 28px; }
.cs-cta svg { width: 15px; height: 15px; }

.cs-end-cta {
  text-align: center;
  padding: 12px 0 40px;
}
.cs-end-cta p {
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.cs-end-cta .cs-cta { margin-top: 0; }

.cs-body { max-width: 780px; margin-inline: auto; }

.cs-section { padding: 44px 0; }
.cs-section + .cs-section { border-top: 1px solid var(--line); }
.cs-section h2 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand);
  margin-bottom: 18px;
}
.cs-section > p { color: var(--body); font-size: .98rem; line-height: 1.7; }
.cs-section > p + p { margin-top: 14px; }

.cs-tech {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cs-tech div {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
}
.cs-tech h3 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.cs-tech p { font-size: .87rem; line-height: 1.6; color: var(--body); }
@media (max-width: 600px) { .cs-tech { grid-template-columns: 1fr; } }

.cs-figure { margin: 26px 0 28px; }
.cs-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
/* small / low-res screenshots: keep them compact and centered, never upscaled */
.cs-img--sm {
  max-width: 480px;
  margin-inline: auto;
}
.cs-img--md {
  max-width: 660px;
  margin-inline: auto;
}
/* when a real image is present, hide the placeholder box... */
.cs-figure:has(.cs-img) .cs-shot { display: none; }
/* ...unless the image failed to load */
.cs-figure.cs-img-missing .cs-img { display: none; }
.cs-figure.cs-img-missing .cs-shot { display: flex; }
.cs-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  aspect-ratio: 16 / 9;
  padding: 24px;
  text-align: center;
  background: var(--thumb-bg);
  border: 1px dashed var(--brand-light);
  border-radius: var(--radius-sm);
}
.cs-shot svg { width: 30px; height: 30px; color: var(--brand-light); }
.cs-shot span { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.cs-shot small {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-figure figcaption {
  margin-top: 11px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--body);
  text-align: center;
}

.cs-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 26px;
  margin-bottom: 18px;
}
.cs-flow .cs-step {
  position: relative;
  flex: 1 1 110px;
  padding: 14px 12px;
  text-align: center;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-flow .cs-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: -19px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-weight: 700;
}
@media (max-width: 600px) {
  .cs-flow { flex-direction: column; gap: 26px; }
  /* stacked: let each step shrink to its content instead of the 110px flex-basis */
  .cs-flow .cs-step { flex: 0 0 auto; }
  .cs-flow .cs-step:not(:last-child)::after {
    content: "\2193";
    right: 50%;
    top: auto;
    bottom: -20px;
    transform: translateX(50%);
  }
}

.cs-impact { margin-top: 4px; }
.cs-impact li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: .96rem;
  line-height: 1.62;
  color: var(--body);
}
.cs-impact li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid var(--brand);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Inline citation-style links within case-study body copy */
.cs-section a:not(.btn) {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: var(--brand-light);
  text-underline-offset: 2px;
  transition: color .18s var(--ease);
}
.cs-section a:not(.btn):hover { color: var(--brand-dark); }

.cs-quote {
  border-left: 3px solid var(--brand);
  padding: 4px 0 4px 22px;
}
.cs-quote p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.cs-pager {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 28px 0;
}
.cs-pager .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.cs-pager a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.cs-pager a:hover { transform: translateX(4px); color: var(--brand-dark); }
/* the "All projects" link points back, so it nudges left */
.cs-pager a:first-child:hover { transform: translateX(-4px); }

.cs-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.cs-reveal.is-visible { opacity: 1; transform: none; }
