/* ===== tokens ===== */
:root{
    --bg-rgb: 63, 56, 52; /* rgb for #3f3834 ; if you switch --bg, update this too */
   --bg: #5c524b;      /* softer, tan-brown base */
  --text: #e8e6e3;    /* off-white text for good contrast */
  --muted: #ada79f;   /* secondary text */
   --bg: #5c524b;    /* slightly darker border tone */
  --accent: #e0312a;  /* red; swap to #3aa7ff for electric blue */

  --sans: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space: clamp(16px, 2.2vw, 28px);
  --radius: 16px;
  --max: 1200px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--sans); line-height:1.45;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
a{color:inherit; text-decoration:none}
.wrap{max-width:var(--max); margin:0 auto; padding:0 4vw}

/* ===== header with connected tab group ===== */
.site-header{
  position: sticky; top:0; z-index:10;
  background: rgba(var(--bg-rgb), 0.90);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line);
}
.nav{height:64px; display:flex; align-items:center; justify-content:flex-end}
.tabs{display:flex; align-items:center}

/* Connected group (About / Engineering / Art) */
.tab-group{
  display:inline-flex;
  border:1px solid var(--line);
  border-radius:999px;
  overflow:hidden;
  background: rgba(255,255,255,0.06);
}
.tab-group .tab{
  padding:.55rem 1rem;
  border:0;             /* borders handled by group */
  border-right:1px solid var(--line);
  background: transparent;
  font-size:.95rem; letter-spacing:.02em;
  transition: color .15s ease, background .15s ease;
}
.tab-group .tab:last-child{ border-right:0; }
.tab-group .tab:hover{ color:var(--accent); background: rgba(255,255,255,0.06); }

/* Separated Contact pill */
.tab-cta{
  margin-left: .9rem;
  display:inline-block;
  padding:.55rem 1rem;
  border:1px solid var(--line);
  border-radius:999px;
  background: rgba(255,255,255,0.10);
  font-size:.95rem; letter-spacing:.02em;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .2s ease;
}
.tab-cta:hover{ border-color:var(--accent); color:var(--accent); background: rgba(255,255,255,0.12); transform:translateY(-1px); }

/* ===== hero (full image + centered name) ===== */
.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
  border-bottom: 1px solid var(--line);
  max-width: 1200px;       /* keeps it from full bleed */
  margin: 0 auto;          /* centers it */
  padding: 0 4vw;          /* optional: side breathing room */
}
.hero-media{
  position:absolute; inset:0; z-index:-2;
  background:url("../assets/hero.jpg") center/cover no-repeat;
  filter: contrast(110%) saturate(105%);
}
/* Same-hue overlay (uses --bg-rgb) for K2000-style emphasis */
.hero-scrim{
  position:absolute; inset:0; z-index:-1;
  background:
    /* soft center lift around the name */
    radial-gradient(900px 420px at 50% 55%, rgba(var(--bg-rgb), 0.10), rgba(0,0,0,0) 42%),
    /* vertical brown wash for contrast */
    linear-gradient(to bottom, rgba(var(--bg-rgb), 0.52) 0%, rgba(var(--bg-rgb), 0.68) 60%, rgba(var(--bg-rgb), 0.82) 100%),
    /* faint edge vignette */
    radial-gradient(1600px 900px at 50% 50%, rgba(0,0,0,0.25), transparent 60%);
}
.hero-content{position:relative}
.hero-content h1{
  margin:0 0 .4em; font-weight:700; letter-spacing:.06em;
  font-size: clamp(40px, 8vw, 96px);
  /* no text-shadow/glow */
}
.tag{
  margin:0; color:var(--muted);
  font-family:var(--mono); font-size: clamp(12px, 1.6vw, 16px);
  letter-spacing:.06em;
}

/* ===== sections ===== */
.section{padding: calc(var(--space)*3.5) 0}
h2{margin:0 0 .6em; font-size: clamp(20px, 3vw, 28px); letter-spacing:.02em}
.muted{color:var(--muted)}

/* ===== footer ===== */
.site-footer{border-top:1px solid var(--line); color:var(--muted); text-align:center; padding:calc(var(--space)*2) 0}

/* ===== contact section ===== */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.2rem;
}

.contact-list p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
}

.contact-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* tighter top padding for subnav area */
.section-tight { padding-top: calc(var(--space)*1.5); padding-bottom: calc(var(--space)*1.5); }

/* art subnav alignment */
.art-subnav { display:flex; justify-content:flex-start; }

.grid-ceramics {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(5px, 1vw, 5px);
  margin-top: 60px;
  margin-bottom: 80px;
  padding: 0 4vw; /* adds left/right breathing room */
}

.grid-ceramics figure {
  margin: 0;
}

.grid-ceramics img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #1b1b1b;
}

@media (min-width: 820px){
  .grid-ceramics {
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.6vw, 16px);
    padding: 0 4vw; /* or 0 3vw if you want it even tighter */
  }
}


/* comfortable reading width */
.section .about-lead{ max-width: 70ch; }

#ceramics {
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 80px;
  padding-bottom: 100px;
}

/* secret CHASE link vibe */
.chase-teaser{
  margin-top: .6rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.chase-teaser a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease, opacity .2s ease, transform .2s ease;
  opacity: .85;
}
.chase-teaser a:hover{
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
}

/* CHASE grid: mixed media (images + short looping vids) */
.grid-chase{
  display:grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 3.5vw, 40px);
  margin-top: 28px;
  padding-bottom: 20px;
}
.grid-chase img,
.grid-chase video{
  width: 100%; height: auto; display:block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0f0f0f;
}

/* 2-cols on wider screens */
@media (min-width: 900px){
  .grid-chase{ grid-template-columns: 1fr 1fr; }
}


/* ===== CHASE theme (grays) ===== */
.theme-chase {
  background-color: rgb(94, 100, 106);
  --bg: rgb(94, 100, 106);
  --bg-rgb: 94, 100, 106;
  --text: #e6e6e6;
  --muted: #a9a9a9;
  --line: #4c5055;
}

.chase-hero{
  padding: clamp(48px, 10vw, 96px) 0 clamp(32px, 8vw, 64px);
  background: var(--bg);   /* exact solid */
  border: none;            /* no lines */
}
.wrap-narrow{ max-width: 980px; margin: 0 auto; padding: 0 24px; }

.video-frame {
  position: relative;
  overflow: hidden;
  background: rgb(94, 100, 106);
  border: none;
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 102%; /* trims any bottom line */
  object-fit: cover;
  object-position: center top;
  background: rgb(94, 100, 106);
}

/* subtle tint to match page gray exactly */
.video-frame::before{
  content:"";
  position:absolute;
  inset:0;
    background: var(--bg);
  opacity: 0.04;        /* 4% tint; adjust 0.02–0.07 if needed */
  pointer-events:none;
}

.theme-chase .section,
.theme-chase .site-footer,
/* Header = same solid color as page, no translucency */
.site-header{
  position: sticky; 
  top: 0; 
  z-index: 10;
  background: var(--bg);          /* was rgba(var(--bg-rgb), .90) */
  border-bottom: 1px solid var(--line);  /* keep if you want a hairline */
  backdrop-filter: none;          /* remove blur tint */
}

/* Scope background reset to the CHASE page only */
.theme-chase,
.theme-chase .chase-hero,
.theme-chase .section {
  background: var(--bg) !important;  /* uses the per-page --bg (gray on CHASE) */
  box-shadow: none !important;
  border: none !important;
}

/* spacing under the video to let it "unveil" */
.chase-blurb { 
  padding-top: clamp(24px, 6vw, 56px);
  padding-bottom: clamp(12px, 3vw, 28px);
}

/* centered, blended text */
.chase-blurb p{
  margin: 0 auto;
  max-width: 70ch;
  text-align: center;
  color: color-mix(in srgb, var(--text) 75%, var(--bg) 25%); /* blended with background */
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* grid: three across (desktop), clean & industrial */
.chase-grid { padding-top: clamp(24px, 4vw, 40px); }
.chase-grid .cg{
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2.6vw, 22px);
}

/* 2 columns on tablets */
@media (min-width: 720px){
  .chase-grid .cg{ grid-template-columns: repeat(2, 1fr); }
}

/* 3 columns on desktop */
@media (min-width: 1040px){
  .chase-grid .cg{ grid-template-columns: repeat(3, 1fr); }
}

/* images: sharp edges, subtle line, no glow */
.chase-grid img{
  display:block;
  width:100%;
  height:auto;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  filter: contrast(102%) saturate(102%);
}

/* red micro-labels */
.accent-label{
  color: var(--accent);
  font-family: var(--mono);
  letter-spacing: .08em;
  font-size: .9rem;
  text-transform: uppercase;
  opacity: .9;
}


/* give the hero some breathing room before the blurb already done; 
   now also add some space before the grid label */
.section-tight { padding-top: clamp(10px, 1.8vw, 16px); padding-bottom: clamp(10px, 1.8vw, 16px); }

/* inline video (same visual width as grid; no stretching) */
.chase-video { 
  padding-top: clamp(22px, 4vw, 36px);
}
.video-frame--inline{
  /* same container rules as hero frame, but we let the video size by its aspect */
  border: none;
  border-radius: 0;
  background: var(--bg);
}
.video-frame--inline video{
  width: 100%;
  height: auto;         /* keep native aspect, no stretch */
  object-fit: contain;  /* safety */
  background: var(--bg);
}

.video-frame--inline{ position: relative; }

.play-btn{
  position:absolute; right:10px; bottom:10px;
  padding:.35rem .5rem; line-height:1;
  font-family: var(--mono); font-size:.95rem;
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border:1px solid var(--line); border-radius:8px;
  cursor:pointer; opacity:0; pointer-events:none;
  transition: opacity .15s ease, transform .15s ease, color .15s ease, border-color .15s ease;
}
.play-btn.show{ opacity:.9; pointer-events:auto; }
.play-btn:hover{ transform:translateY(-1px); color:var(--accent); border-color:var(--accent); }

/* Blended micro copy (same tone as other CHASE text) */
.chase-note{
  margin: .35rem 0 0;
  max-width: 70ch;
  color: color-mix(in srgb, var(--text) 78%, var(--bg) 22%);
  line-height: 1.6;
  letter-spacing: .01em;
}

/* Zero-gap vertical stack of images */
.stack { padding-top: 8px; padding-bottom: 8px; }
.stack-tight{ line-height: 0; }          /* kill inline gaps */
.stack-tight img{
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
}

/* Camera photo fills wrap width, sharp edges */
.edge-to-edge{
  display:block; width:50%; height:auto; border:0;  margin-left: auto; margin-right: auto;border-radius:0; background:var(--bg);
}

/* Optional: slightly tighter label spacing here */
.section-tight { padding-top: clamp(8px, 1.4vw, 14px); padding-bottom: clamp(8px, 1.4vw, 14px); }


/* Resume section (clean, inline style) */
.resume-section {
  
  padding-top: 8px;
  padding-bottom: 12px;
}


.resume-blurb {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.95rem;
  max-width: 70ch;
}

.resume-inline {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.resume-inline:hover {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* ===== Engineering Projects layout ===== */
.project-block {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  margin-bottom: clamp(60px, 8vw, 120px);
}

/* Gallery for first project */
.project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2vw, 20px);
  margin-top: 1.5rem;
}

.project-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* On larger screens, show 3 images side by side */
@media (min-width: 880px) {
  .project-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Split layout: 1 large image left, 2 stacked right */
.project-gallery-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2vw, 20px);
  margin-top: 1.5rem;
}

/* left (large) image */
.gallery-left img,
.gallery-right img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* On desktop, show 1 large + 2 stacked */
@media (min-width: 880px) {
  .project-gallery-split {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .gallery-right {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.2vw, 16px);
  }

  .gallery-left img {
    height: 100%;
    object-fit: cover;
  }
}

.project-text {
  max-width: 60ch;
  text-align: left;
}

.project-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Two-column layout for larger screens */
@media (min-width: 880px) {
  .project-block {
    grid-template-columns: 1fr 1fr;
  }

  .project-text {
    text-align: left;
  }
}

/* ===== Engineering (TDA fixture) wide wrapper + gallery grid ===== */


/* ===== Stacked gallery layout ===== */
.proj-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.5vw, 18px);
  margin-top: 1.5rem;
}

/* Smaller hero image */
.proj-stack .main img {
  width: 70%;       /* adjust smaller/larger if needed */
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Full-width stacked images below */
.proj-stack .sub img {
  width: 90%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* ===== Engineering split layout (natural image sizes) ===== */
.proj-split {
  display: grid;
  grid-template-columns: minmax(220px, 65%) minmax(120px, 35%);
  align-items: start;
  gap: clamp(10px, 1.2vw, 18px);
  margin: clamp(12px, 2vw, 22px) 0 clamp(8px, 1.6vw, 16px);
  padding: 0;
}

/* Left main image */
.proj-split .main img {
  width: 100%;
  height: auto;          /* natural proportions */
  object-fit: contain;   /* prevent cropping */
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Right stacked images */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 10px);
  justify-content: flex-start;
}

.side-stack img {
  width: 100%;
  height: auto;          /* natural scaling */
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Responsive collapse for smaller screens */
@media (max-width: 880px) {
  .proj-split {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .side-stack {
    flex-direction: column;
  }
}

/* ===== Engineering project row (text + images) ===== */
.proj-row{
  display: grid;
  grid-template-columns: minmax(260px, 52%) minmax(260px, 48%); /* text | gallery */
  align-items: start;
  gap: clamp(16px, 2vw, 28px);
  margin: 0;
  padding: 0;
  width: 100%;
}

.proj-text{
  max-width: 46ch; /* nicely readable column */
}

/* two-column gallery: big image + vertical stack */
.proj-split{
  display: grid;
  grid-template-columns: minmax(220px, 65%) minmax(120px, 35%); /* main | stack */
  align-items: start;
  gap: clamp(10px, 1.2vw, 18px);
}

.proj-split img{
  display: block;
  width: 100%;
  height: auto;         /* keep natural aspect; no cropping */
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

.side-stack{
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.9vw, 10px);
}

/* Stack on small screens */
@media (max-width: 900px){
  .proj-row{
    grid-template-columns: 1fr;
  }
  .proj-split{
    grid-template-columns: 1fr;
  }
}

/* ===== GIF on top, 3 images below ===== */
.proj-stack{
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(10px, 1.4vw, 16px);
  align-items: start;
}

/* Large GIF – keep natural aspect, no crop */
.proj-gif{
  display:block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Row of three images */
.three-wide{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1vw, 12px);
}

.three-wide img{
  display:block;
  width:100%;
  height:auto;           /* no cropping */
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1b1b1b;
}

/* Stack on small screens */
@media (max-width: 900px){
  .three-wide{ grid-template-columns: 1fr; }
}

.section { padding: 40px 0; }
.section + .section { margin-top: -20px; }


/* Sub-note under project description — same style as resume note on About page */
.proj-subnote {
  font-family: var(--mono);                /* same font as the resume text */
  font-size: clamp(12px, 0.9vw, 14px);     /* smaller, matches About page */
  color: var(--muted);                     /* NOT red, same muted gray */
  opacity: 0.85;
  margin-top: 0.6rem;
  letter-spacing: 0.2px;
}

.proj-link{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.proj-link:hover,
.proj-link:focus{
  color: var(--text);
  border-color: var(--accent);
}

.media-placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(220px, 32vw, 360px);
  padding: clamp(18px, 4vw, 40px);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.4);
  color: var(--muted);
  text-align: center;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ===== Media viewer overlay ===== */
.media-viewer{
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: clamp(12px, 4vw, 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 80;
}

.media-viewer::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 16, 0.55);
  opacity: 0;
  transition: opacity .2s ease;
}

.media-viewer.is-open{
  opacity: 1;
  pointer-events: auto;
}

.media-viewer.is-open::before{
  opacity: 1;
}

.media-viewer-panel{
  position: relative;
  width: min(520px, 48vw);
  max-height: min(92vh, 820px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
  outline: none;
}

.media-viewer.is-open .media-viewer-panel{
  transform: translateY(0);
  opacity: 1;
}

.media-viewer img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.media-viewer-close{
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(16, 16, 16, 0.65);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.media-viewer-close:hover,
.media-viewer-close:focus{
  background: var(--accent);
  color: #101010;
  border-color: var(--accent);
}

@media (max-width: 900px){
  .media-viewer{
    justify-content: center;
  }
  .media-viewer-panel{
    width: min(90vw, 520px);
  }
}
