
  :root{
    --bg: #15110E;
    --bg-panel: #1C1712;
    --bg-panel-2: #221C15;
    --rule: #333A5C;
    --rule-soft: #232840;
    --text: #FAF6EC;
    --text-muted: #D6CDBB;
    --text-faint: #B0A48D;

    --accent: #B23A2E;
    --accent-bright: #E0725F;
    --bg-about: #2E2838;

    --sev-critical: #E2453C;
    --sev-high: #DE8A3C;
    --sev-medium: #C9A227;
    --sev-low: #7A8FA6;

    --radius: 3px;
    --maxw: 1020px;
  }

  *{ box-sizing: border-box; }
  html{ scroll-behavior: smooth; scroll-padding-top: 76px; background: #15110E; -webkit-overflow-scrolling: touch; }
  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
    *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  }

  /* SCROLL REVEAL — starts 35px lower and invisible, animates to its normal spot and full
     opacity over 0.6s as it enters the viewport. Plays once (JS never removes .in once set).
     Reduced motion: skip outright, content is never hidden in the first place. */
  .reveal{
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal.in{ opacity: 1; transform: translateY(0); }
  @media (prefers-reduced-motion: reduce){
    .reveal{ opacity: 1; transform: none; transition: none; }
  }

  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Fredoka', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  ::selection{ background: var(--accent); color: #15110E; }
  a{ color: inherit; }
  a:focus-visible, button:focus-visible{ outline: 2px solid var(--accent-bright); outline-offset: 3px; }
  h1,h2,h3,h4{ font-family: 'Cinzel Decorative', serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
  .mono{ font-family: 'IBM Plex Mono', monospace; }
  p{ margin: 0 0 12px; }

  .eyebrow{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-faint); display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  }
  .eyebrow::before{ content:""; width: 22px; height: 1px; background: var(--text-faint); display: inline-block; }

  .wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

  /* NAV — fixed, overlays the hero banner, solidifies on scroll */
  header.nav{
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    background: linear-gradient(to bottom, rgba(10,8,6,0.65), transparent);
    border-bottom: 1px solid transparent;
    transition: background 0.3s cubic-bezier(0.25,0.1,0.25,1), border-color 0.3s cubic-bezier(0.25,0.1,0.25,1), backdrop-filter 0.3s cubic-bezier(0.25,0.1,0.25,1);
  }
  header.nav.scrolled{
    background: rgba(21,17,14,0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule-soft);
  }
  header.nav.scrolled .nav-name{ color: var(--text); }
  header.nav.scrolled .nav-links a{ color: var(--text-muted); }
  header.nav.scrolled .nav-links a:hover{ color: var(--text); }
  header.nav.scrolled .nav-social{ color: var(--text) !important; border-color: var(--rule); }
  .nav-inner{ max-width: var(--maxw); margin: 0 auto; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; }
  .nav-name{ font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 1.05rem; text-decoration: none; color: #fff; }
  .nav-links{ display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
  .nav-links a{ text-decoration: none; color: rgba(237,230,217,0.82); transition: color 0.25s cubic-bezier(0.25,0.1,0.25,1); display: flex; align-items: center; gap: 7px; }
  .nav-links a:hover{ color: #fff; }
  .nav-links svg{ width: 13px; height: 13px; opacity: 0.85; flex-shrink: 0; }
  .nav-actions{ display: flex; align-items: center; gap: 10px; }
  .nav-social{
    color: #fff !important; border: 1px solid rgba(255,255,255,0.25); padding: 7px 14px; border-radius: 20px;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; text-decoration: none; letter-spacing: 0.04em;
    line-height: 1;
    display: flex; align-items: center; gap: 7px; text-transform: uppercase;
    background: none; cursor: pointer;
    transition: border-color 0.25s cubic-bezier(0.25,0.1,0.25,1), color 0.25s cubic-bezier(0.25,0.1,0.25,1);
  }
  .nav-social:hover{ border-color: var(--accent-bright); color: var(--accent-bright) !important; }
  .nav-social svg{ width: 12px; height: 12px; }
  @media (max-width: 780px){ .nav-links span.label{ display:none; } .nav-links{ gap: 18px; } }
  @media (max-width: 560px){ .nav-actions span{ display:none; } }

  /* HERO BANNER — full-bleed image placeholder, nav overlays this */
  .hero-banner{
    position: relative;
    width: 100%;
    height: 66vh;
    min-height: 420px;
    max-height: 640px;
    overflow: hidden;
  }
  .hero-banner-media{
    position: absolute; inset: 0;
    background-image: url('images/banner.gif');
    background-size: cover;
    background-position: center;
    background-color: #120F0C;
  }
  .hero-banner-scrim{
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(10,8,6,0.15) 0%, rgba(10,8,6,0.05) 40%, rgba(21,17,14,0.85) 92%, var(--bg) 100%);
  }

  /* ABOUT PANEL — solid contrasting block directly under the hero */
  .about-panel{
    background: var(--bg-about);
    border-bottom: 1px solid var(--rule-soft);
    padding: 68px 0 76px;
    scroll-margin-top: 76px;
  }
  .about-grid{ display: grid; grid-template-columns: 1fr 220px; gap: 40px; align-items: start; }
  @media (max-width: 700px){ .about-grid{ grid-template-columns: 1fr; } }
  .about-photo{
    aspect-ratio: 1/1; width: 100%; border-radius: var(--radius);
    border: 2px solid rgba(240,238,232,0.3);
    background: rgba(5,4,10,0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    color: rgba(240,238,232,0.55);
    overflow: hidden;
  }
  .about-photo svg{ width: 44px; height: 44px; opacity: 0.7; }
  .about-photo span{ font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; padding: 0 16px; }
  .about-photo img{ width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; display: block; }

  .tools-label{ font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: rgba(240,238,232,0.9); font-weight: 500; margin-top: 26px; }
  .tool-logos{ display: flex; flex-wrap: wrap; gap: 22px; margin-top: 12px; }
  .tool-badge{ display: flex; flex-direction: column; align-items: center; gap: 6px; color: rgba(240,238,232,0.75); }
  .tool-badge svg{ width: 30px; height: 30px; }
  .tool-badge img{ width: 30px; height: 30px; object-fit: contain; display: block; }
  .tool-badge span{ font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; letter-spacing: 0.03em; }

  .about-panel .eyebrow{ color: rgba(240,238,232,0.6); }
  .about-panel .eyebrow::before{ background: rgba(240,238,232,0.6); }
  .about-panel h2{ font-size: clamp(2.1rem, 5vw, 3.1rem); color: var(--text); margin-bottom: 22px; }
  .about-panel p{ max-width: 62ch; font-size: 1.04rem; color: var(--text-muted); }
  .about-panel-meta{ margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 24px; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: rgba(240,238,232,0.62); }
  .about-panel-meta b{ color: rgba(240,238,232,0.9); font-weight: 500; }

  /* WORK GRID */
  section{ padding: 64px 0; border-bottom: 1px solid var(--rule-soft); scroll-margin-top: 76px; }
  section:last-of-type{ border-bottom: none; }

  /* WORK ROWS — zigzag image/text layout */
  .section-head{ margin-bottom: 8px; }
  .section-head h2{ font-size: clamp(1.3rem, 2.6vw, 1.6rem); }

  .work-rows{ display: flex; flex-direction: column; }

  .row-project{ border-top: 1px solid var(--rule-soft); }
  .row-project:last-child{ border-bottom: 1px solid var(--rule-soft); }

  .row-toggle{
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 52px;
    padding: 52px 0;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.25,0.1,0.25,1);
  }
  .row-toggle:hover{ background: rgba(255,255,255,0.04); }
  .row-project--reverse .row-toggle{ flex-direction: row-reverse; }

  .row-media{
    flex: 0 0 320px;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(214,205,187,0.45);
    border-radius: var(--radius);
    background: var(--bg-panel-2);
    display: flex; align-items: center; justify-content: center;
    padding: 8px;
    overflow: hidden;
    transition: border-color 0.3s cubic-bezier(0.25,0.1,0.25,1), box-shadow 0.3s cubic-bezier(0.25,0.1,0.25,1);
  }
  .row-toggle:hover .row-media{ border-color: var(--tile-accent, var(--rule)); box-shadow: 0 0 0 1px var(--tile-accent, var(--rule)); }
  .row-media img{ width: 100%; height: 100%; object-fit: cover; object-position: center; }
  .row-media.placeholder{ flex-direction: column; gap: 10px; color: var(--text-faint); }
  .row-media.placeholder svg{ width: 34px; height: 34px; opacity: 0.6; }
  .row-media.placeholder span{ font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; }

  /* all three project images share one aspect ratio for visual consistency —
     7:5 was chosen because it minimizes the worst-case crop needed across all
     three source images (~15-17% each) rather than cropping one much harder
     than the others */
  .row-media:not(.placeholder){ aspect-ratio: 7 / 5; }

  .row-text{ flex: 1; min-width: 0; }
  .row-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .tag{
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem; letter-spacing: 0.03em;
    padding: 4px 9px; border-radius: 20px;
    border: 1px solid var(--rule);
    color: var(--tile-accent, var(--text-muted));
    background: color-mix(in srgb, var(--tile-accent, var(--rule)) 10%, transparent);
  }
  .row-text h3{ font-size: 1.5rem; margin-bottom: 10px; color: var(--text); }
  .row-blurb{ color: var(--text-muted); font-size: 0.96rem; max-width: 46ch; margin-bottom: 16px; }
  .row-contrib{ list-style: none; margin: 0 0 20px; padding: 0; font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 0.82rem; color: var(--text-muted); max-width: 46ch; letter-spacing: 0.01em; }
  .row-contrib li{ padding: 6px 0; border-top: 1px solid var(--rule-soft); }
  .row-contrib li:first-child{ border-top: none; }
  .row-contrib li::before{ content: "— "; color: var(--tile-accent, var(--text-faint)); }

  .row-cta{
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem;
    color: var(--tile-accent, var(--accent-bright));
  }
  .row-cta .arrow{ transition: transform 0.35s cubic-bezier(0.25,0.1,0.25,1); }
  .row-toggle[aria-expanded="true"] .row-cta .arrow{ transform: rotate(90deg); }
  .row-toggle:hover .row-cta{ text-decoration: underline; }

  @media (max-width: 820px){
    .row-toggle, .row-project--reverse .row-toggle{ flex-direction: column; align-items: stretch; gap: 24px; padding: 36px 0; }
    .row-media{ flex-basis: auto; width: 100%; }
  }

  .row--shadow{ --tile-accent: #B3A5E8; }
  .row--monster{ --tile-accent: #FF9080; }
  .row--psych{ --tile-accent: #E8CB5C; }

  /* project page content column (reused from the old expand-panel body) */
  .detail-body{ padding: 4px 0 52px; max-width: 68ch; }
  .detail-body h4{ font-family: 'IBM Plex Mono', monospace; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin: 26px 0 10px; }
  .detail-body h4:first-child{ margin-top: 0; }
  .detail-body p.muted{ color: var(--text-muted); }

  .video-embed{ position: relative; display: block; width: 100%; max-width: 640px; padding-top: 36%; background: #000; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 6px 0 10px; }
  .video-embed iframe{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  .video-embed img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s cubic-bezier(0.25,0.1,0.25,1), filter 0.35s cubic-bezier(0.25,0.1,0.25,1); filter: brightness(0.82); }
  .video-embed:hover img{ transform: scale(1.03); filter: brightness(0.68); }
  .video-embed .play-badge{
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(10,8,6,0.6); border: 1px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s cubic-bezier(0.25,0.1,0.25,1), transform 0.3s cubic-bezier(0.25,0.1,0.25,1), border-color 0.3s cubic-bezier(0.25,0.1,0.25,1);
  }
  .video-embed:hover .play-badge{ background: var(--tile-accent, var(--accent)); border-color: transparent; transform: translate(-50%,-50%) scale(1.08); }
  .video-embed .play-badge svg{ width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
  .video-caption{ text-decoration: none; font-family: 'IBM Plex Mono', monospace; font-size: 0.74rem; color: var(--text-faint); margin: 0 0 24px; display: flex; align-items: center; gap: 6px; }
  .video-caption:hover{ color: var(--tile-accent, var(--accent-bright)); }

  .triage{ border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 6px 0; }
  .triage-row{ display: grid; grid-template-columns: 100px 1fr; border-bottom: 1px solid var(--rule-soft); background: var(--bg-panel); }
  .triage-row:last-child{ border-bottom: none; }
  .triage-sev{ padding: 14px 12px; font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: flex-start; gap: 7px; border-right: 1px solid var(--rule-soft); }
  .triage-sev .dot{ width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
  .triage-body{ padding: 14px 16px; }
  .triage-body .finding{ font-weight: 600; margin-bottom: 5px; font-size: 0.94rem; }
  .triage-body .fix{ color: var(--text-muted); font-size: 0.87rem; margin: 0; }
  .triage-body .fix strong{ color: var(--text); font-weight: 500; }
  .sev-critical .dot{ background: var(--sev-critical); } .sev-critical{ color: var(--sev-critical); }
  .sev-medium .dot{ background: var(--sev-medium); } .sev-medium{ color: var(--sev-medium); }
  .sev-low .dot{ background: var(--sev-low); } .sev-low{ color: var(--sev-low); }

  .data-table{ width: 100%; border-collapse: collapse; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; margin: 6px 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
  .data-table th, .data-table td{ padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule-soft); }
  .data-table th{ background: var(--bg-panel); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; font-size: 0.68rem; }
  .data-table td{ background: var(--bg-panel-2); color: var(--text-muted); }
  .data-table tr:last-child td{ border-bottom: none; }

  .pivot-box{ border-left: 2px solid var(--tile-accent, var(--accent)); padding: 2px 0 2px 16px; margin: 6px 0 18px; color: var(--text-muted); font-size: 0.92rem; }
  .pivot-box .before{ display: block; text-decoration: line-through; color: var(--text-faint); }
  .pivot-box .after{ display: block; color: var(--text); margin-top: 4px; }

  .ethics-note{ border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 18px; background: var(--bg-panel); font-size: 0.88rem; color: var(--text-muted); margin: 6px 0 20px; }
  .ethics-note strong{ color: var(--text); }

  .log-entry{ border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-panel); padding: 18px 20px; margin-bottom: 10px; }
  .log-entry .log-date{ font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--tile-accent, var(--accent-bright)); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
  .log-entry .log-date .pill{ background: color-mix(in srgb, var(--tile-accent, var(--accent)) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tile-accent, var(--accent)) 45%, transparent); padding: 2px 8px; border-radius: 20px; font-size: 0.64rem; }
  .log-entry p{ font-size: 0.92rem; }
  .log-next{ border: 1px dashed var(--rule); border-radius: var(--radius); padding: 14px 18px; color: var(--text-faint); font-family: 'IBM Plex Mono', monospace; font-size: 0.76rem; }

  /* ABOUT */
  .about-body{ max-width: 62ch; color: var(--text-muted); }
  .about-body strong{ color: var(--text); font-weight: 500; }
  .focus-row{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

  /* ACHIEVEMENTS & INDUSTRY COLLABORATIONS */
  .achieve-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
  @media (max-width: 700px){ .achieve-grid{ grid-template-columns: 1fr; } }
  .achieve-card{ border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-panel); padding: 26px 28px; }
  .achieve-kind{ font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-bright); margin-bottom: 10px; }
  .achieve-card h3{ font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--text); margin-bottom: 8px; }
  .achieve-card p{ font-size: 0.92rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

  /* CONTACT */
  .contact-inner{ display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
  .contact-inner h2{ font-size: clamp(1.5rem, 3vw, 2rem); max-width: 18ch; }
  .contact-links{ display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
  .contact-links a{ font-family: 'IBM Plex Mono', monospace; font-size: 0.88rem; text-decoration: none; color: var(--text-muted); border-bottom: 1px solid transparent; transition: color 0.25s cubic-bezier(0.25,0.1,0.25,1), border-color 0.25s cubic-bezier(0.25,0.1,0.25,1); }
  .contact-links a:hover{ color: var(--accent-bright); border-color: var(--accent-bright); }

  footer{ padding: 26px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--text-faint); }

/* ============ PROJECT PAGE (standalone case study pages) ============ */
.project-page-header{ padding: 140px 0 0; }
.back-link{
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem;
  color: var(--text-faint); text-decoration: none; margin-bottom: 32px;
  transition: color 0.25s cubic-bezier(0.25,0.1,0.25,1), transform 0.25s cubic-bezier(0.25,0.1,0.25,1);
  transform-origin: left center;
}
.back-link:hover{ color: var(--tile-accent, var(--text)); transform: scale(1.06); }
.back-link .arrow-back{ transition: transform 0.3s cubic-bezier(0.25,0.1,0.25,1); }
.back-link:hover .arrow-back{ transform: translateX(-3px); }

.project-hero-media{
  width: 100%; aspect-ratio: 21 / 9; max-height: 480px;
  border: 2px solid rgba(214,205,187,0.45); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-panel-2);
  margin-bottom: 36px;
}
.project-hero-media img{ width: 100%; height: 100%; object-fit: contain; }
/* Each logo image is narrower than the 21:9 border, so object-fit:contain letterboxes
   left/right. Filling the container with the logo's own background color (sampled from
   its edges) instead of the generic panel color makes the letterbox blend in rather than
   reading as empty space -- the border itself and the image are untouched. */
.row--monster .project-hero-media{ background: #000000; }
.row--shadow .project-hero-media{ background: #000000; }
.row--psych .project-hero-media{ background: #5C5446; }

.project-title-row{
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 44px; padding-bottom: 36px; border-bottom: 1px solid var(--rule-soft);
}
.project-title-row h1{ font-size: clamp(1.9rem, 4vw, 2.6rem); }
.project-title-row .row-tags{ margin: 14px 0 0; }

.project-content{ padding-bottom: 80px; }

/* prev/next footer navigation between the three project pages */
.project-pager{
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-top: 1px solid var(--rule-soft); padding: 44px 0 0; margin-top: 20px;
}
.pager-link{
  display: flex; flex-direction: column; gap: 8px; padding: 20px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none; transition: border-color 0.3s cubic-bezier(0.25,0.1,0.25,1), background 0.3s cubic-bezier(0.25,0.1,0.25,1), transform 0.3s cubic-bezier(0.25,0.1,0.25,1);
}
.pager-link:hover{ border-color: var(--tile-accent, var(--accent-bright)); background: rgba(255,255,255,0.04); transform: scale(1.03); }
.pager-link:hover .pager-title{ color: var(--tile-accent, var(--accent-bright)); }
.pager-link.next{ text-align: right; align-items: flex-end; }
.pager-label{ font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.pager-title{ font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 1.05rem; color: var(--text); transition: color 0.3s cubic-bezier(0.25,0.1,0.25,1); }
@media (max-width: 640px){ .project-pager{ grid-template-columns: 1fr; } }

/* ============ PAGE TRANSITIONS ============ */
/* Native cross-document View Transitions: the browser itself snapshots the
   outgoing and incoming page and cross-fades them, with no gap, because it
   happens inside the engine rather than being faked with JS timers and
   opacity classes (which can't smooth over the actual document swap -- that
   was the "pause then snap" problem). Supported in Chrome/Edge 126+; browsers
   without support just navigate normally with no animation, which is a safe
   fallback rather than a broken one. */
@view-transition{
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root){
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce){
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*){
    animation: none !important;
  }
}

/* ============ PROJECT ATTACHMENT MODAL ============ */
.attachment-btn{
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--text); background: var(--bg-panel);
  border: 2px solid var(--tile-accent, var(--rule)); border-radius: 20px;
  padding: 10px 18px; cursor: pointer; flex-shrink: 0;
  transition: background 0.3s cubic-bezier(0.25,0.1,0.25,1), transform 0.3s cubic-bezier(0.25,0.1,0.25,1);
}
.attachment-btn:hover{ background: var(--tile-accent, var(--rule)); color: #15110E; transform: scale(1.04); }
.attachment-btn svg{ width: 16px; height: 16px; }
.attachment-btn .count{
  font-size: 0.68rem; background: rgba(255,255,255,0.12); border-radius: 20px; padding: 2px 8px;
}
.attachment-btn:hover .count{ background: rgba(21,17,14,0.25); }

.attachment-modal{
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 24px;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
}
.attachment-modal.open{ opacity: 1; pointer-events: auto; }
.attachment-modal-backdrop{
  position: fixed; inset: 0; background: rgba(10,8,6,0.82); backdrop-filter: blur(4px);
}
.attachment-modal-panel{
  position: relative; width: 100%; max-width: 880px;
  background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 36px;
}
.attachment-modal-head{ display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.attachment-modal-head h3{ font-size: 1.3rem; }
.attachment-modal-close{
  background: none; border: 1px solid var(--rule); color: var(--text-faint); border-radius: 20px;
  padding: 6px 14px; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; cursor: pointer; flex-shrink: 0;
}
.attachment-modal-close:hover{ color: var(--text); border-color: var(--text-faint); }

.attachment-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px){ .attachment-grid{ grid-template-columns: 1fr; } }
.attachment-card{
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--bg-panel-2);
  /* Flow-up entrance, staggered per card, played each time the modal opens (the modal
     itself sits at opacity:0 until .open is added, so there's always an already-painted
     "closed" frame beforehand for this to transition from). border-color is listed last
     and always kept at 0s delay (see the nth-child rules below) so the hover highlight
     reacts instantly instead of inheriting the entrance stagger. */
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.1s ease;
  transition-delay: 0s, 0s, 0s;
}
.attachment-modal.open .attachment-card{ opacity: 1; transform: translateY(0); }
/* Hovering the image itself highlights the whole card's border in the project's theme color,
   matching the same hover treatment as the project rows on the homepage. Toggled via a JS
   class (see main.js) rather than a :has() selector -- :has() measurably adds ~70ms of style
   recalc latency on this page, which read as a sluggish hover; a direct class toggle is instant. */
.attachment-card.hover-active{ border-color: var(--tile-accent, var(--rule)); }
.attachment-card:nth-child(1){ transition-delay: 0.08s, 0.08s, 0s; }
.attachment-card:nth-child(2){ transition-delay: 0.16s, 0.16s, 0s; }
.attachment-card:nth-child(3){ transition-delay: 0.24s, 0.24s, 0s; }
.attachment-card:nth-child(4){ transition-delay: 0.32s, 0.32s, 0s; }
.attachment-card:nth-child(5){ transition-delay: 0.4s, 0.4s, 0s; }
.attachment-card:nth-child(6){ transition-delay: 0.48s, 0.48s, 0s; }
.attachment-card:nth-child(n+7){ transition-delay: 0.56s, 0.56s, 0s; }
/* Shadow Requiem has 5 attachment cards -- center the odd one out on its own row
   instead of leaving it stranded in the left column. */
#attach-shadow .attachment-grid > .attachment-card:nth-child(5):last-child{
  grid-column: 1 / -1;
  width: calc(50% - 11px);
  margin: 0 auto;
}
@media (max-width: 640px){
  #attach-shadow .attachment-grid > .attachment-card:nth-child(5):last-child{ width: 100%; }
}
.attachment-media{
  width: 100%; aspect-ratio: 4/3; background: rgba(0,0,0,0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-faint);
  position: relative; overflow: hidden;
}
.attachment-media img, .attachment-media video{ width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-media svg{ width: 30px; height: 30px; opacity: 0.6; }
.attachment-media span{ font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; padding: 0 12px; }
.attachment-media[role="button"]{ cursor: zoom-in; }
.attachment-media[role="button"]:focus-visible{ outline: 2px solid var(--accent-bright); outline-offset: -2px; }
.attachment-media[role="button"] img{ transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.attachment-media[role="button"]:hover img, .attachment-media[role="button"]:focus-visible img{ transform: scale(1.08); }

.attachment-caption{ padding: 14px 16px; }
.attachment-caption .a-title{ font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 0.92rem; color: var(--text); margin-bottom: 4px; }
.attachment-caption .a-desc{ font-family: 'Quicksand', sans-serif; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ============ RESUME PREVIEW MODAL ============ */
.resume-modal-panel{ max-width: 760px; }
.resume-frame{
  width: 100%; height: 72vh; border: 1px solid var(--rule); border-radius: var(--radius);
  background: #fff; margin-bottom: 20px; display: block;
}
.resume-modal-actions{ display: flex; justify-content: flex-end; }
.resume-download{
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--tile-accent, var(--accent)); color: #15110E;
  padding: 10px 20px; border-radius: 20px; text-decoration: none;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  transition: transform 0.25s cubic-bezier(0.25,0.1,0.25,1), opacity 0.25s cubic-bezier(0.25,0.1,0.25,1);
}
.resume-download:hover{ transform: scale(1.04); opacity: 0.88; }
.resume-download svg{ width: 14px; height: 14px; }
@media (max-width: 640px){ .resume-frame{ height: 56vh; } }

/* ============ IMAGE LIGHTBOX — full-size view of a clicked attachment image ============ */
.img-lightbox{
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px;
  opacity: 0; pointer-events: none;
}
.img-lightbox.open{ opacity: 1; pointer-events: auto; }
.img-lightbox-backdrop{ position: fixed; inset: 0; background: rgba(10,8,6,0.92); backdrop-filter: blur(6px); }
.img-lightbox-inner{
  position: relative; max-width: min(94vw, 1400px); max-height: 90vh;
}
.img-lightbox-inner img{
  display: block; max-width: 100%; max-height: 90vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.img-lightbox-close{
  position: absolute; top: -16px; right: -16px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-panel); border: 1px solid var(--rule); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-family: 'IBM Plex Mono', monospace; font-size: 1.1rem; line-height: 1;
}
.img-lightbox-close:hover{ color: var(--accent-bright); border-color: var(--text-faint); }
@media (max-width: 640px){ .img-lightbox-close{ top: -46px; right: 0; } }
