/* Variant E — Bento Gallery */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Mono:ital,wght@0,400;1,400&display=swap');

:root {
  --bg: #F0F0EE;
  --card: #FFFFFF;
  --card-dark: #0F0F0F;
  --text: #111111;
  --text-light: #FFFFFF;
  --muted: #6B7280;
  --accent: #2563EB;
  --accent-bg: #EEF2FF;
  --border: #E5E7EB;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 12px;
  --gap: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ─── SITE HEADER ─── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  padding: 0;
  background: rgba(240,240,238,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 24px;
  width: 100%;
}
.site-header .logo { font-weight: 700; font-size: 0.95rem; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a { font-size: 0.8rem; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.site-header nav a:hover { color: var(--accent); }
.site-header nav a.active { color: var(--text); }

/* ─── BENTO GRID ─── */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc((min(100vw, 1400px) - 2 * 24px - 3 * 16px) / 4);
  gap: 16px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* card base */
.card {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--border);
}
.card-dark  { background: var(--card-dark); color: var(--text-light); border: none; }
.card-accent { background: var(--accent); color: #fff; border: none; }

/* ─── CARD TYPES ─── */
.name-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.name-role {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 0.75rem;
}
.name-card h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.contact-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.contact-card .ctag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.68);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}
.contact-card h3 {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
}
.contact-links { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
}
.contact-links a:hover { color: #fff; }

/* ─── OVERFLOW CARD (experience, bio) ─── */
.overflow-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.overflow-card .card-inner {
  flex: 1;
  overflow: hidden;
  padding: 1.5rem 1.5rem 0;
  position: relative;
}
.overflow-card .card-inner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4rem;
  background: linear-gradient(to top, #fff 0%, transparent 100%);
  pointer-events: none;
}
.overflow-card.card-dark .card-inner::after {
  background: linear-gradient(to top, var(--card-dark) 0%, transparent 100%);
}
.overflow-readmore {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.75rem 1.5rem;
  text-align: left;
  flex-shrink: 0;
}
.overflow-readmore:hover { text-decoration: underline; }

.card-section-label {
  font-size: clamp(0.72rem, 1.2vw, 0.875rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.875rem;
}
.exp-list { display: flex; flex-direction: column; gap: 0.875rem; }
.exp-entry { display: flex; flex-direction: column; gap: 0.1rem; }
.exp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.exp-co { font-size: clamp(0.875rem, 1.5vw, 1rem); font-weight: 600; }
.exp-yr { font-family: var(--font-mono); font-size: clamp(0.65rem, 1.1vw, 0.75rem); color: var(--muted); white-space: nowrap; }
.exp-role { font-size: clamp(0.72rem, 1.2vw, 0.875rem); color: var(--muted); }
.exp-detail-list {
  padding: 0.4rem 0 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}
.exp-detail-list li { margin-bottom: 0.2rem; }
#card-experience .exp-detail-list { display: none; }

/* Bio text inside overflow-card */
#card-bio .card-inner { padding: 1.5rem; }
#card-bio .card-inner.no-overflow::after { display: none; }
#card-bio p { font-size: clamp(0.875rem, 1.5vw, 1rem); color: var(--muted); line-height: 1.65; margin-bottom: 0.6rem; }
#card-bio p:last-child { margin-bottom: 0; }

/* ─── PROJECT CARDS (hover overlay) ─── */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: #000;
  border: none;
}
.project-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.35s ease;
  display: block;
}
.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: rgba(0,0,0,0);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}
.project-card:hover img,
.project-card.overlay-active img {
  filter: brightness(0.35);
}
.project-card:hover .project-overlay,
.project-card.overlay-active .project-overlay {
  opacity: 1;
  background: rgba(0,0,0,0.5);
}
.po-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  display: block;
}
.po-title {
  font-size: clamp(0.9rem, 1.5vw, 1.25rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.4rem;
}
.po-metric {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.po-cta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  display: block;
}

/* ─── PREVIEW CARDS (calendar, filters) ─── */
.preview-card {
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
}
.preview-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.preview-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pl-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.08em;
}
.pl-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.preview-card:hover { opacity: 0.9; }
.preview-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37,99,235,0.75);
  backdrop-filter: blur(4px);
}
.lightbox-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: calc(100% - 48px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.lightbox-content { display: flex; flex-direction: column; gap: 1rem; }
.lightbox-content img { width: 100%; border-radius: 8px; display: block; }
.lightbox-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.lightbox-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.lightbox-close {
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  transition: color 0.2s;
}
.lightbox-close:hover { color: var(--text); }
.lightbox-text { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.lightbox-text p { margin-bottom: 0.75rem; }
.lightbox-text p:last-child { margin-bottom: 0; }
.lightbox-text h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.75rem; }
.lightbox-text .exp-entry { margin-bottom: 1rem; }

/* ─── CASE STUDY LAYOUT ─── */
.cs-hero-card { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 21/9; max-width: 1400px; margin: 1.5rem auto; min-height: 300px; }
.cs-hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
.cs-hero-card-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, transparent 100%); }
.cs-hero-card-overlay .cse { font-family: var(--font-mono); font-size: 0.65rem; color: rgba(255,255,255,0.85); letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.cs-hero-card-overlay h1 { font-size: clamp(2rem, 5vw, 4.5rem); font-weight: 800; color: #fff; line-height: 1.0; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.cs-hero-card-overlay .csh-metric { font-size: clamp(1.2rem, 2.5vw, 2rem); font-weight: 800; color: var(--accent); }
.cs-present-btn {
  display: inline-flex; align-items: center;
  margin-top: 1.25rem;
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px; padding: 0.4rem 0.875rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cs-present-btn:hover {
  color: #fff; border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
}

/* ─── CS CONTENT BENTO ─── */
.cs-bento { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; gap: 12px; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem 1.5rem; }
.cs-bento .col-3  { grid-column: span 3; }
.cs-bento .col-4  { grid-column: span 4; }
.cs-bento .col-5  { grid-column: span 5; }
.cs-bento .col-6  { grid-column: span 6; }
.cs-bento .col-8  { grid-column: span 8; }
.cs-bento .col-12 { grid-column: span 12; }
.cs-bento .row-2  { grid-row: span 2; }
.cs-bento .row-3  { grid-row: span 3; }
.cs-bento .row-4  { grid-row: span 4; }
.cs-text-card { padding: 2rem; }
.cs-text-card h2 { font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 700; margin-bottom: 0.75rem; }
.cs-text-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.7; margin-bottom: 0.75rem; }
.cs-detail { margin-top: 0.75rem; }
.cs-detail summary { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); cursor: pointer; list-style: none; }
.cs-detail summary::-webkit-details-marker { display: none; }
.cs-detail-body { padding-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.cs-metric-card { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.cs-metric-card .cmn { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -0.03em; }
.cs-metric-card .cml { font-family: var(--font-mono); font-size: 0.65rem; color: rgba(255,255,255,0.62); margin-top: 0.4rem; }
.cs-image-card { border-radius: var(--radius); overflow: hidden; background: #000; }
.cs-image-card img { width: 100%; height: 100%; object-fit: cover; }

/* ─── SECTION LABEL ─── */
.cs-section-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

/* ─── WIREFRAME CARD ─── */
.wireframe-callout {
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 2px dashed var(--accent);
  min-height: 240px; display: flex; flex-direction: column;
  position: relative;
  background-image: radial-gradient(circle, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.wf-inner { padding: 1.75rem; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.wf-tag { font-family: var(--font-mono); font-size: 0.62rem; color: var(--accent); letter-spacing: 0.1em; display: block; margin-bottom: 0.75rem; }
.wf-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.wf-footer { font-family: var(--font-mono); font-size: 0.62rem; color: rgba(37,99,235,0.6); margin-top: 1rem; }

/* ─── WHAT WE'RE MEASURING ─── */
.wm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.wm-item { border-top: 2px solid var(--accent); padding-top: 1rem; }
.wm-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.5rem;
}
.wm-desc { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ─── NEXT PROJECT ─── */
.next-project {
  display: flex; justify-content: flex-end; align-items: center;
  max-width: 1400px; margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}
.next-project a {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); transition: color 0.2s;
}
.next-project a:hover { color: var(--accent); }

/* ─── FOOTER ─── */
footer { background: var(--card-dark); color: #fff; padding: 4rem 0 2.5rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.footer-title { font-size: clamp(2rem, 7vw, 6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.0; margin-bottom: 2.5rem; }
.footer-title span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.78rem; font-weight: 500; color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-links a:hover { color: #fff; }

/* ─── VARIANT SWITCHER ─── */
.variant-switcher {
  display: none;
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 1000; align-items: center; gap: 0.25rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.5rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.variant-switcher.is-visible { display: flex; }
.vs-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-right: 0.5rem; }
.vs-link {
  font-size: 0.72rem; font-weight: 700;
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--muted); transition: all 0.2s;
}
.vs-link:hover { color: var(--accent); background: var(--accent-bg); }
.vs-link.vs-active { background: var(--accent); color: #fff; }
.vs-link.vs-base { width: auto; padding: 0 0.5rem; border-radius: 100px; }

/* ─── RESPONSIVE ─── */

@media (min-width: 800px) {
  #card-name        { grid-column: 1;     grid-row: 1; }
  #card-contact     { grid-column: 2;     grid-row: 1; }
  #card-experience  { grid-column: 3 / 5; grid-row: 1; }
  #card-graduated   { grid-column: 1 / 3; grid-row: 2 / 4; }
  #card-diversion   { grid-column: 3;     grid-row: 2; }
  #card-calendar    { grid-column: 4;     grid-row: 2; }
  #card-bio         { grid-column: 3 / 5; grid-row: 3; }
  #card-star-sitter { grid-column: 1 / 3; grid-row: 4; }
  #card-filters     { grid-column: 3;     grid-row: 4; }
  #card-service     { grid-column: 4;     grid-row: 4; }
}

@media (min-width: 540px) and (max-width: 799px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: calc((min(100vw, 1400px) - 2 * 24px - 16px) / 2);
  }
  #card-name        { grid-column: 1; grid-row: auto; }
  #card-contact     { grid-column: 2; grid-row: auto; }
  #card-experience  { grid-column: 1 / 3; }
  #card-graduated   { grid-column: 1 / 3; grid-row: span 2; }
  #card-diversion   { grid-column: 1; }
  #card-calendar    { grid-column: 2; }
  #card-bio         { grid-column: 1 / 3; }
  #card-star-sitter { grid-column: 1 / 3; }
  #card-filters     { grid-column: 1; }
  #card-service     { grid-column: 2; }
  .wm-grid { grid-template-columns: repeat(2, 1fr); }
  .name-card h1           { font-size: 2.2rem; }
  .contact-card h3        { font-size: 1.5rem; }
  .card-section-label     { font-size: 0.875rem; }
  .exp-co                 { font-size: 1rem; }
  .exp-yr                 { font-size: 0.75rem; }
  .exp-role               { font-size: 0.875rem; }
  #card-bio p             { font-size: 1rem; }
}

@media (max-width: 539px) {
  .site-header-inner { padding: 0.75rem 16px; }
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: calc(100vw - 2 * 16px);
    padding: 16px;
    gap: 16px;
  }
  .bento > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  .wm-grid { grid-template-columns: 1fr; }
  .name-card h1           { font-size: 2.2rem; }
  .contact-card h3        { font-size: 1.5rem; }
  .card-section-label     { font-size: 0.875rem; }
  .exp-co                 { font-size: 1rem; }
  .exp-yr                 { font-size: 0.75rem; }
  .exp-role               { font-size: 0.875rem; }
  #card-bio p             { font-size: 1rem; }
  .contact-links a        { font-size: 0.9rem; }
  .cs-hero-card { aspect-ratio: unset; min-height: 85svh; margin: 0.75rem; }
  .cs-hero-card-overlay { padding: 1.5rem; }
  .lightbox {
    align-items: flex-end;
    justify-content: stretch;
  }
  .lightbox-panel {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 85svh;
    padding: 24px 24px 32px;
  }
  .lightbox-panel::before {
    content: none;
    flex-shrink: 0;
  }
}

@media (min-width: 769px) and (max-width: 960px) {
  .cs-bento { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cs-bento { grid-template-columns: repeat(2, 1fr); }
  .wm-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .cs-bento { grid-template-columns: 1fr; }
  .wm-grid { grid-template-columns: 1fr; }
}
