/* =========================================================
   site.css — components for the tabbed profile layout.
   Uses tokens from brand-theme.css; grid comes from Bootstrap.
   ========================================================= */

:root {
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --radius: 14px;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--sd-ink); color: #fff; padding: .5rem .9rem; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* ---------- First fold: profile + tabs ----------
   Every vertical measure is tied to viewport height so the
   profile and tab row stay inside the first screen on laptops,
   desktops and tablets (portrait + landscape). */
.fold {
  padding-top: clamp(18px, 5vh, 64px);
  padding-bottom: clamp(14px, 2.6vh, 28px);
}

.profile-eyebrow {
  font-size: clamp(.68rem, 1.35vh, .82rem);
  letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
  color: var(--sd-clay); margin-bottom: clamp(4px, .8vh, 10px);
}
.profile-name {
  font-weight: 400; line-height: 1;
  font-size: clamp(2.2rem, min(6.6vw, 10.5vh), 6rem);
  letter-spacing: -.02em; margin-bottom: clamp(8px, 1.8vh, 20px);
}
.profile-name em { font-style: italic; color: var(--sd-forest); }
.profile-intro {
  font-size: clamp(.95rem, 2.05vh, 1.15rem); line-height: 1.5;
  color: var(--sd-ink-soft); max-width: 36em; margin-bottom: clamp(10px, 2.2vh, 24px);
}
.profile-intro strong { color: var(--sd-ink); font-weight: 600; }

.btn-pill {
  border-radius: 999px; padding: clamp(.4rem, 1vh, .6rem) 1.6rem;
  font-weight: 500; letter-spacing: .01em;
  transition: background-color .35s var(--ease-soft), color .35s var(--ease-soft), border-color .35s var(--ease-soft), transform .35s var(--ease-soft);
}
.btn-pill:hover { transform: translateY(-2px); }
.btn-pill svg { transition: transform .35s var(--ease-soft); }
.btn-pill:hover svg { transform: translateX(3px); }

.profile-photo {
  height: clamp(150px, 36vh, 340px);
  aspect-ratio: 248 / 262; max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden; margin-left: auto; position: relative;
  box-shadow: 0 18px 40px -22px rgba(29, 38, 32, .45);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

/* ---------- Tabs ---------- */
.tab-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 18px);
  margin-top: clamp(16px, 3.6vh, 40px);
  list-style: none; padding: 0;
}
.tab-card {
  position: relative; display: block; width: 100%;
  height: clamp(118px, 30vh, 270px);
  border: 0; padding: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--sd-ink); cursor: pointer; text-align: center;
  isolation: isolate;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.tab-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.001);
  filter: grayscale(0) saturate(1.05);
  transition: transform .9s var(--ease-out), filter .7s var(--ease-soft);
  z-index: -2;
}
.tab-card::after { /* bottom gradient for legibility, as in layout */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35) 62%, rgba(0,0,0,.82) 100%);
  transition: opacity .5s var(--ease-soft);
}
.tab-title {
  position: absolute; left: 0; right: 0; bottom: clamp(10px, 2.2vh, 22px);
  padding: 0 .75rem; color: #fff; line-height: 1.2;
  font-family: var(--sd-font-body); font-weight: 500;
  font-size: clamp(.85rem, min(1.25vw, 2.1vh), 1.12rem);
  letter-spacing: .01em; text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.tab-title::after { /* active indicator */
  content: ""; display: block; height: 2px; width: 0; margin: .5rem auto 0;
  background: var(--sd-clay); border-radius: 2px;
  transition: width .5s var(--ease-out);
}

/* hover: gentle zoom */
.tab-card:hover img, .tab-card:focus-visible img { transform: scale(1.08); }
.tab-card:hover { box-shadow: 0 16px 34px -18px rgba(29, 38, 32, .55); }
.tab-card:focus-visible { outline: 3px solid var(--sd-clay); outline-offset: 3px; }

/* once a tab is chosen: others go black & white */
.tab-row.has-active .tab-card:not([aria-selected="true"]) img { filter: grayscale(1) contrast(.95) brightness(.92); }
.tab-row.has-active .tab-card:not([aria-selected="true"]):hover img { filter: grayscale(.6) brightness(.97); }
.tab-card[aria-selected="true"] { box-shadow: 0 0 0 3px var(--sd-paper), 0 0 0 5px var(--sd-clay), 0 18px 36px -18px rgba(29,38,32,.6); }
.tab-card[aria-selected="true"] .tab-title::after { width: 36px; }

/* ---------- Panel area ---------- */
.panel-wrap {
  position: relative; background: var(--sd-surface);
  border: 1px solid var(--sd-line); border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 52px);
  margin-bottom: clamp(32px, 6vh, 72px);
  transition: height .55s var(--ease-out);
  overflow: hidden; scroll-margin-top: 16px;
}
.panel-hint { text-align: center; color: var(--sd-ink-soft); padding: clamp(4px, 1vh, 12px) 0; margin: 0; }
.panel-hint span { display: inline-block; animation: nudge 2.4s var(--ease-soft) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.tab-pane-x { display: none; }
.tab-pane-x.is-active { display: block; animation: paneIn .65s var(--ease-out) both; }
.tab-pane-x.is-leaving { display: block; animation: paneOut .25s var(--ease-soft) both; }
@keyframes paneIn  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes paneOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
.tab-pane-x.is-active .stagger > * { animation: paneIn .7s var(--ease-out) both; }
.tab-pane-x.is-active .stagger > *:nth-child(2) { animation-delay: .07s; }
.tab-pane-x.is-active .stagger > *:nth-child(3) { animation-delay: .14s; }
.tab-pane-x.is-active .stagger > *:nth-child(4) { animation-delay: .21s; }
.tab-pane-x.is-active .stagger > *:nth-child(n+5) { animation-delay: .28s; }

.pane-eyebrow { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--sd-clay); margin-bottom: .5rem; }
.pane-title { font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 400; line-height: 1.12; letter-spacing: -.01em; margin-bottom: 1rem; }
.pane-quote { border-left: 3px solid var(--sd-clay); padding: .2rem 0 .2rem 1rem; margin: 0 0 1.5rem; font-family: var(--sd-font-display); font-style: italic; font-size: 1.08rem; color: var(--sd-ink-soft); }
.pane-quote cite { display: block; font-style: normal; font-family: var(--sd-font-body); font-size: .85rem; margin-top: .3rem; }
.pane-sub { font-size: 1.3rem; font-weight: 500; margin: 2rem 0 1rem; }
.panel-wrap p { line-height: 1.7; }

.stat { border-top: 2px solid var(--sd-forest); padding-top: .75rem; height: 100%; }
.stat b { display: block; font-family: var(--sd-font-display); font-weight: 500; font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--sd-forest); line-height: 1.1; }
.stat span { color: var(--sd-ink-soft); font-size: .92rem; }

.item-card { height: 100%; padding: 1.25rem 1.35rem; border: 1px solid var(--sd-line); border-radius: 12px; background: var(--sd-paper);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .45s var(--ease-out); }
.item-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -22px rgba(29,38,32,.5); border-color: rgba(var(--sd-forest-rgb), .35); }
.item-card .meta { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sd-clay); font-weight: 600; margin-bottom: .4rem; }
.item-card h4 { font-size: 1.15rem; font-weight: 500; line-height: 1.3; margin-bottom: .55rem; }
.item-card p { font-size: .95rem; color: var(--sd-ink-soft); margin-bottom: .6rem; }
.item-card ul { padding-left: 1.1rem; font-size: .93rem; color: var(--sd-ink-soft); margin-bottom: 0; }
.link-arrow { font-weight: 600; text-decoration: none; font-size: .92rem; }
.link-arrow::after { content: " →"; display: inline-block; transition: transform .35s var(--ease-soft); }
.link-arrow:hover::after { transform: translateX(4px); }

.media { border-radius: 12px; overflow: hidden; background: var(--sd-line); aspect-ratio: 4 / 3; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s var(--ease-out); }
.media:hover img { transform: scale(1.05); }
.media.tall { aspect-ratio: 4 / 5; }

.pill-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.pill-list li { border: 1px solid var(--sd-line); border-radius: 999px; padding: .35rem .9rem; font-size: .9rem; background: var(--sd-paper); }

.site-foot { color: var(--sd-ink-soft); font-size: .88rem; padding-bottom: 2rem; }

/* ---------- Page-load reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: paneIn .9s var(--ease-out) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .25s; } .d4 { animation-delay: .35s; }
.tab-row > li { opacity: 0; animation: paneIn .8s var(--ease-out) forwards; }
.tab-row > li:nth-child(1) { animation-delay: .35s; } .tab-row > li:nth-child(2) { animation-delay: .42s; }
.tab-row > li:nth-child(3) { animation-delay: .49s; } .tab-row > li:nth-child(4) { animation-delay: .56s; }
.tab-row > li:nth-child(5) { animation-delay: .63s; }

/* ---------- Tablet portrait: keep 5 across, compact copy ---------- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .profile-intro { font-size: clamp(.92rem, 1.7vh, 1.05rem); }
  .tab-title { font-size: .86rem; }
}

/* ---------- Phones: tabs become a swipeable row ---------- */
@media (max-width: 767.98px) {
  .profile-photo { height: auto; width: 42vw; max-width: 200px; margin: 0 0 1rem; }
  .tab-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-left: -12px; margin-right: -12px; padding: 4px 12px 10px; scrollbar-width: none; }
  .tab-row::-webkit-scrollbar { display: none; }
  .tab-row > li { flex: 0 0 42%; scroll-snap-align: start; }
  .tab-card { height: 150px; }
  .tab-title { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
