:root{
  --bg:#0b0c10; --panel:#111318; --text:#e6e6e6; --muted:#a7a7a7; --accent:#59d; --max:1100px;
}
*{box-sizing:border-box} html,body{margin:0}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);line-height:1.6}

.nav{max-width:var(--max);margin:0 auto;display:flex;justify-content:space-between;align-items:center;padding:1rem}
.brand{font-weight:800;text-decoration:none;color:var(--text);letter-spacing:.3px}
.links a{color:var(--muted);text-decoration:none;margin-left:1rem}
.links a:hover{color:var(--text)}
:root { --page-pad: clamp(1rem, 4vw, 3rem); }
.grid{
  display: grid;
  /* gutter | content | gutter */
  grid-template-columns:
    minmax(var(--page-pad), 1fr)
    minmax(0, var(--max))
    minmax(var(--page-pad), 1fr);
  column-gap: clamp(1rem, 3vw, 2rem);
}

/* place every direct child in the middle "content" column */
.grid > *{ grid-column: 2; }

.hero{
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70vh;

  max-width: var(--max);
  margin: 2rem auto 3rem;
  padding: 3rem 1rem;

  display: grid;
  /* gutters | subtwo | portrait | gutter, so row-1 can center over both */
  grid-template-columns: minmax(0,1fr) auto auto minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;

  /* smaller distance between subtwo and image */
  column-gap: clamp(.5rem, 2vw, 1.1rem);
  text-align: center;
}

/* Center stack (title + sub + CTAs) spanning both middle columns */
.hero .text{
  grid-column: 2 / span 2;     /* centered above subtwo+image */
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero h1{ font-size: clamp(2rem, 6vw, 4rem); line-height: 1.1; margin: .25em 0; }
.sub{ color: var(--muted); max-width: 60ch; margin: 0 0 .9rem; }

/* place the centered text in the middle column, row 1 */

.hero .cta{
  grid-column: 2;
  grid-row: 1;
}
/* NEW: subtwo goes below the sub, left column */
.subtwo{
  color: var(--muted);
  grid-column: 2;              /* left of the image */
  grid-row: 2;
  text-align: right;
  margin: 0;                   /* keep it tight to reduce gap */
  max-width: 36ch;
  justify-self: end;
}
.hero-portrait{
  grid-column: 3;              /* right cell */
  grid-row: 2;
  width: clamp(120px, 18vw, 220px);
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.7);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  pointer-events: none;
}
/* CTA row */
.ctas{
  display: flex;
  gap: clamp(.9rem, 1.4vw, 1.25rem);   /* a bit more space */
  justify-content: center;
  flex-wrap: wrap;
  margin-top: .75rem;
}

/* Base button */
.cta{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cta:hover{ transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.35) }

/* Variants */
.cta.outline{
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
.cta.ghost{
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: none;
}

/* Optional: equal widths */
.ctas .cta{ min-width: 9rem; text-align:center }


.posts-grid{max-width:var(--max);margin:0 auto;display:grid;gap:1.25rem;padding:0 1rem 3rem;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));}
.card{background:var(--panel);border-radius:16px;overflow:hidden;transition:transform .2s ease, box-shadow .2s ease}
.card:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.3)}
.card img{width:100%;height:180px;object-fit:cover;display:block}
.card-body{padding:1rem}
.card h2{font-size:1.15rem;margin:.2rem 0 .5rem}
.card p{color:var(--muted);margin:0 0 .75rem}
.meta{font-size:.85rem;color:var(--muted)}

.about{max-width:var(--max);margin:0 auto 4rem;padding:0 1rem}
.site-footer{border-top:1px solid #1c1f27;padding:1.5rem;text-align:center;color:var(--muted)}


/* ---- Centered tab card ---- */
:root{
  --banner-h: 64px;            /* banner height when shrunk */
}



/* Shrunk banner keeps your behavior; hide extras */
.hero.is-shrink{
  height: var(--banner-h);
  min-height: var(--banner-h);
  padding: 0 .75rem;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; gap: .75rem;
}
.hero.is-shrink .sub,
.hero.is-shrink .subtwo,
.hero.is-shrink .ctas,
.hero.is-shrink .hero-portrait{ display:none }
.hero.is-shrink .hero-title{ font-size: clamp(1.1rem, 2.6vw, 1.6rem); margin:0; line-height:1.1 }





@media (max-width: 720px){
  .hero{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 0;
    row-gap: clamp(1.25rem, 3.5vw, 3rem);
  }
  .hero .text{ grid-column:1; grid-row:1 }
  .subtwo{ grid-column:1; grid-row:2; text-align:center; justify-self:center; margin-top:.5rem }
  .hero-portrait{ grid-column:1; grid-row:3; margin-top:1rem }
}

/* Make this hero behave like a normal block (not sticky) */
.hero-static{
  position: static;          /* turn off sticky */
  top: auto;
  min-height: auto;
}

/* If your JS adds .is-shrink, ignore it for the static hero */
.hero-static.is-shrink{
  height: auto;
  min-height: auto;
  padding: 3rem 1rem;        /* your normal padding */
  display: grid;             /* keep the grid layout */
  box-shadow: none;
  border-radius: 0;
}

/* Un-hide elements that the generic .hero.is-shrink hides */
.hero-static.is-shrink .hero-title{ font-size: clamp(2rem, 6vw, 4rem); }
.hero-static.is-shrink .sub,
.hero-static.is-shrink .subtwo{ display: block; }
.hero-static.is-shrink .ctas{ display: flex; }
.hero-static.is-shrink .hero-portrait{ display: block; }

.tabcard{
  max-width: var(--card-max);
  width: min(var(--card-max), calc(100% - 2rem)); /* keeps margins on small screens */
  margin: 3rem auto;
  background: var(--panel, #111318);
  color: var(--text, #e7e7e7);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
  overflow: hidden;
  position: relative;  /* for stacking above the bg image overlay */
}
.tabcard-tabs{
  display:flex; gap:.25rem; align-items:center; padding:.5rem  .5rem;
  background: rgba(255,255,255,.06);
}
.tabcard .tab{
  appearance:none; background:transparent; border:0;
  padding:1rem 1.25rem; font-weight:700; letter-spacing:.02em;
  cursor:pointer; border-radius:12px; color:inherit; opacity:.75;
}
.tabcard .tab:hover{ opacity:1 }
.tabcard .tab.is-active{
  background:#1a1d24; opacity:1; box-shadow: inset 0 -2px 0 var(--accent, #59d);
}
.tabcard-panel{ padding:3.25rem 3.5rem 3rem }
.tabcard-panel h3{ margin:.25rem 0 .5rem; font-size:1.2rem }
.tabcard-panel ul{ margin:.25rem 0 0 1.25rem }
.tabcard-panel li{ margin:.25rem 0 }
/* Cap every image in the content panel to 80×80, keep aspect ratio */
/* Universal image cap inside content panels */

/* Optional: lighter look for users in light mode */
@media (prefers-color-scheme: light){
  .tabcard{ background:#fff; color:#111; box-shadow:0 18px 40px rgba(0,0,0,.35) }
  .tabcard .tab.is-active{ background:#f2f4f7; box-shadow: inset 0 -2px 0 #222 }
}

/* Full-width band with background image */
.tabcard-wrap{
  position: relative;
  padding: min(10vh, 6rem) 0;       /* space above/below the card */
  isolation: isolate;               /* ensure overlay layers behave */
}

/* Background image layer */
.tabcard-wrap::before{
  content:"";
  position: absolute; inset: 0;
  background: url("assets/img/bg-tabband.jpg") center / cover no-repeat;
  /* Optional parallax-ish effect (less reliable on iOS):
     background-attachment: fixed; */
  z-index: -2;
}

/* Subtle dark overlay for contrast */
.tabcard-wrap::after{
  content:"";
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.45),
    rgba(0,0,0,.45)
  );
  z-index: -1;
}

/* Make sure the card sits above overlays */
.tabcard{ position: relative; z-index: 0; }
:root{
  /* tweak this to the largest width you want each image to occupy */
  --img-max: 320px;        /* e.g. 240px, 320px, 400px */
  --fig-gap: 1rem;         /* space between images */
}


/* Utility: cap image to 40×40 without cropping, keep aspect ratio */
img.fit-20 {
  width: auto;
  height: auto;
  max-width: 60px;
  max-height: 60px;
  display: block;      /* optional: centers with margin:0 auto */
  margin: 0 auto;      /* remove if you don't want centering */
}





/* Your tiny thumbnail size (keeps proportions; no crop) */
img.thumb-20{
      width:auto;
      height:auto;
      max-width:120px;    /* change to 60px/100px as you like */
      max-height:120px;
      display:block;
      margin:0 auto;
    }


.panel figure img{
  width: auto;
  height: auto;
  max-width: var(--img-max);
  max-height: var(--img-max);
  object-fit: contain;   /* keep proportions, no crop */
  display: block;
  margin: 0;             /* don’t auto-center */
}
/* Optional: keep nav visible on scroll */
.nav{
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,12,16,.75);
  backdrop-filter: blur(6px);
}

/* New non-sticky hero that sits under the header */
.page-hero{
  position: relative;
  max-width: var(--max);
  margin: 1.25rem auto 2.5rem;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
  text-align: center;

  /* visual style (change image or remove if you want solid panel) */
  background-image: url("assets/img/hero-alt.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  overflow: hidden;
  isolation: isolate; /* keeps overlay effects inside */
}
.page-hero::before{ /* subtle overlay for readability */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.20), rgba(0,0,0,.45));
  z-index: 0;
}
.page-hero__title{
  position: relative; 
  left: 50px;
  z-index: 1;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.1; margin: 0 0 .5rem;
}
.page-hero__sub{
  position: relative; 
  left: 50px;
  z-index: 1;
  max-width: 70ch; margin: 0 auto 1rem; color: var(--muted);
}
.page-hero .cta{ position: relative; z-index: 1; }

/* Section separator (horizontal line above each section) */
.cv-section{
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.14); /* adjust color for light mode if needed */
}
.cv-section:first-child{ border-top: 0; } /* no line before the very first section */

/* Table styling + vertical divider */
table.cv{ 
  width:100%;
  border-collapse: separate;   /* don't collapse the borders */
  border-spacing: 0;
}

/* date column */
.cv :is(td,th):first-child{
  white-space: nowrap;
  padding-right: 1rem;
}

/* spacer column = vertical line */
.cv :is(td,th):nth-child(2){
  width: 18px;
  min-width: 18px;             /* stop it collapsing to 0 */
  padding: 0;
  border-left: 2px solid rgba(255,255,255,.14);
}

/* content column */
.cv :is(td,th):nth-child(3){
  padding-left: 1rem;
}


/* === tidy overrides (append at end of the file) === */

/* Make hero use the same side gutters as the page */
.hero{ padding: 3rem var(--page-pad); }

/* Single source of truth for figure rows */
.fig-row{
  display: flex;
  flex-wrap: wrap;
  gap: var(--fig-gap);
  align-items: flex-start;
  justify-content: flex-start; /* left aligned */
}

/* Figure hugs its image, caption left-aligned */
figure.figure-snug{
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Caption never wider than the image */
figure.figure-snug figcaption{
  max-width: var(--img-max);
  margin-top: .4rem;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.4;
  text-align: left;           /* ensure no leftover centering */
  overflow-wrap: anywhere;
}

/* Universal image cap inside content panels */
.panel figure img{
  width: auto;
  height: auto;
  max-width: var(--img-max);
  max-height: var(--img-max);
  object-fit: contain;
  display: block;
  margin: 0;
}