/* ===========================================================
   Neil Mascarenhas, Portfolio
   Dark navy / cyan cybersecurity theme, evolved from the
   original Google Sites design with a cleaner, more
   professional layout.
   =========================================================== */

:root {
  --bg: #07080a;
  --bg-alt: #0d0f13;
  --card: #111317;
  --card-border: #262930;
  --text: #ffffff;
  --text-muted: #bcc3cb;
  --accent: #3f8fc9;
  --accent-strong: #6fb3e0;
  --gold: #e0b667;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  --radius: 14px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Scroll-reveal: elements fade + rise into place as they enter the viewport */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

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

/* ---------- Nav ---------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 11, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav .brand span { color: var(--accent); }

.nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover, .nav a.active { color: var(--accent); }

.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav ul {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--card-border);
  }
  .nav ul.open { display: flex; }
  .nav ul li { border-top: 1px solid var(--card-border); }
  .nav ul li a { display: block; padding: 16px 24px; }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.1rem;
    cursor: pointer;
  }
}

/* ---------- Hero / Page-hero / Banner ----------
   All three share one architecture: a ::before layer paints the photo
   (driven by the --hero-img custom property set inline per section), and
   a ::after layer paints a light gradient/scrim so the photo stays
   visible while text stays readable. Tune the overlay once here and it
   applies everywhere. */

.hero, .page-hero, .banner {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
}

.hero::before, .page-hero::before, .banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: var(--hero-pos, center);
  background-repeat: no-repeat;
  z-index: 0;
}

.hero::after, .page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,10,13, var(--hero-overlay-top, 0.28)) 0%, rgba(8,10,13, var(--hero-overlay, 0.58)) 68%, var(--bg) 100%);
  z-index: 1;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8,10,13,0.42);
  z-index: 1;
}

.hero .wrap, .page-hero .wrap, .banner .wrap {
  position: relative;
  z-index: 2;
}

.hero {
  min-height: 66vh;
  display: flex;
  align-items: center;
}

.hero::before { background-attachment: fixed; }

@media (max-width: 900px) {
  /* fixed backgrounds are jittery on mobile Safari/Chrome — fall back to scroll */
  .hero::before { background-attachment: scroll; }
}

.hero .wrap { padding-top: 80px; padding-bottom: 60px; }

.hero h1, .hero .tagline, .hero .eyebrow,
.page-hero h1, .page-hero p, .page-hero .eyebrow,
.banner blockquote, .banner cite {
  text-shadow: 0 2px 18px rgba(0,0,0,0.8);
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 28px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06111f;
}
.btn-primary:hover { background: var(--accent-strong); color: #06111f; }

.btn-outline {
  border-color: var(--card-border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.social-row { display: flex; gap: 14px; margin-top: 26px; }
.social-row a {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); }
.social-row svg { width: 18px; height: 18px; }

/* ---------- Page hero (secondary pages) ---------- */

.page-hero { padding: 100px 0 64px; }

/* ---------- Quote / image banner ---------- */

.banner {
  padding: 90px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
}
.banner blockquote {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.banner cite {
  display: block;
  margin-top: 18px;
  font-style: normal;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Photo duo (two side-by-side images with captions) ---------- */

.photo-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.photo-duo figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.photo-duo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.photo-duo figure:hover img { transform: scale(1.04); }
.photo-duo figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--card);
}

@media (max-width: 640px) {
  .photo-duo { grid-template-columns: 1fr; }
}

/* ---------- Interest card thumbnails ---------- */

.card.has-thumb { padding: 0; overflow: hidden; }
.card.has-thumb .thumb {
  height: 140px;
  background-size: cover;
  background-position: center;
}
.card.has-thumb .card-body { padding: 22px 26px; }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }

.section-heading { margin-bottom: 36px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 10px; }
.section-heading p { color: var(--text-muted); max-width: 620px; margin: 0; }

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card .icon { font-size: 1.6rem; margin-bottom: 12px; display: block; }
.card h3 { margin: 0 0 10px; font-size: 1.08rem; }
.card p, .card ul { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
.card ul { padding-left: 18px; }
.card ul li { margin-bottom: 6px; }

/* ---------- Timeline (work history) ---------- */
/* Sidebar intro + two-column entry list, echoing the original layout */

.timeline-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--card-border);
}

.timeline-intro h2 { font-size: 1.6rem; margin: 0 0 16px; color: var(--accent); }
.timeline-intro p { color: var(--text-muted); margin: 0 0 14px; font-size: 0.95rem; }

.timeline-grid {
  column-count: 2;
  column-gap: 40px;
}

.timeline-item {
  break-inside: avoid;
  margin-bottom: 34px;
}
.timeline-item .period {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 6px;
}
.timeline-item h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--text); }
.timeline-item .role-meta {
  display: block;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.timeline-item p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.timeline-item ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.timeline-item ul li { margin-bottom: 6px; }
.timeline-item ul li:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .timeline-layout { grid-template-columns: 1fr; gap: 24px; }
  .timeline-grid { column-count: 1; }
}

/* ---------- Projects ---------- */

.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.project-card h3 { margin: 0 0 12px; font-size: 1.15rem; }
.project-card ul { color: var(--text-muted); padding-left: 20px; margin: 0 0 14px; }
.project-card ul li { margin-bottom: 8px; }
.project-card p { color: var(--text-muted); margin: 0 0 16px; font-size: 0.96rem; }

.project-card.has-thumb {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card.has-thumb .project-thumb {
  height: 220px;
  background-size: cover;
  background-position: center;
}
.project-card.has-thumb .project-body { padding: 26px 28px; }

@media (min-width: 760px) {
  .project-card.has-thumb {
    flex-direction: row;
  }
  .project-card.has-thumb .project-thumb {
    width: 300px;
    height: auto;
    flex-shrink: 0;
  }
  .project-card.has-thumb .project-body {
    padding: 28px 30px;
  }
}
.link-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.pill-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: left;
}
.contact-card .icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.contact-card .value { font-size: 1.05rem; font-weight: 600; color: var(--text); display: inline-block; }
.contact-card a.value { color: var(--accent-strong); }

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 0 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer .wrap { display: flex; flex-direction: column; gap: 18px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.sources { font-size: 0.78rem; line-height: 1.7; color: #6f8296; }
.sources summary { cursor: pointer; color: var(--text-muted); margin-bottom: 8px; }

/* ---------- Credential badges, tags, icon thumbs (v6) ---------- */

.badge-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0 0 26px;
}
.badge-row li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(7, 8, 10, 0.55);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.project-icon { display: block; font-size: 1.6rem; margin-bottom: 10px; }

.tag-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 !important;
  margin: 0 !important;
}
.tag-row li {
  margin: 0 !important;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.card.has-thumb .thumb.thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  background: radial-gradient(circle at 30% 20%, rgba(111, 179, 224, 0.35), transparent 60%),
              linear-gradient(135deg, #0f2233 0%, #0b1119 100%);
}

/* ---------- Language switcher + CJK fonts (v7) ---------- */

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 14px;
  font-size: 0.85rem;
}
.lang-switch a { color: var(--text-muted); }
.lang-switch a:hover { color: var(--accent-strong); }
.lang-switch a[aria-current="true"] { color: var(--accent-strong); font-weight: 700; }

:lang(ja) body, body:lang(ja) {
  font-family: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
}
:lang(ko) body, body:lang(ko) {
  font-family: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ko) p, :lang(ko) li, :lang(ko) .tagline { word-break: keep-all; overflow-wrap: anywhere; }
:lang(zh-CN) body, body:lang(zh-CN) {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------- Skip link + main landmark (a11y) ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; outline: 2px solid #fff; outline-offset: 2px; }
main:focus { outline: none; }

/* ---------- Theme toggle (v10) ---------- */
.nav { gap: 16px; }
.nav .brand { order: 0; margin-right: auto; }
.nav ul { order: 1; }
.theme-toggle { order: 2; }
.nav-toggle { order: 3; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-icon::before { content: "☀"; }
:root[data-theme="light"] .theme-icon::before { content: "☾"; }
@media (max-width: 720px) { .theme-toggle { margin-left: 0; } }

/* ---------- Light theme (opt-in; dark is the default) ---------- */
:root[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-alt: #e9edf2;
  --card: #ffffff;
  --card-border: #d3dae3;
  --text: #0e1822;
  --text-muted: #45525f;
  --accent: #1d6aa3;
  --accent-strong: #15578a;
  --shadow: 0 10px 28px -16px rgba(20, 40, 60, 0.35);
  color-scheme: light;
}
:root[data-theme="light"] header.site-header { background: rgba(244, 246, 249, 0.88); }
:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] .btn-primary:hover { color: #ffffff; }
/* Photo headers stay dark in both themes so text over images stays readable */
:root[data-theme="light"] .hero,
:root[data-theme="light"] .page-hero,
:root[data-theme="light"] .banner {
  --bg: #07080a;
  --text: #ffffff;
  --text-muted: #d2d9e0;
  --accent: #3f8fc9;
  --accent-strong: #6fb3e0;
  --card-border: #3a3f48;
  color: var(--text);
}
:root[data-theme="light"] .hero .btn-primary,
:root[data-theme="light"] .page-hero .btn-primary { color: #06111f; }
:root[data-theme="light"] .hero .btn-outline,
:root[data-theme="light"] .page-hero .btn-outline { color: #ffffff; }

/* ---------- Security section + flag teaser (v10) ---------- */
.flag-teaser {
  margin: 28px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
}

/* ---------- Résumé page (v10) ---------- */
.resume-contact { color: var(--text-muted); font-size: 1rem; margin: 0; }
.resume-contact a { color: var(--accent-strong); }
.resume-wrap { max-width: 860px; }
.resume-section { margin-bottom: 44px; }
.resume-section > h2 {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.resume-section > p { color: var(--text-muted); font-size: 1.02rem; line-height: 1.7; margin: 0; }
.resume-section > ul:not(.tag-row) { color: var(--text-muted); padding-left: 20px; margin: 0; }
.resume-entry { margin-bottom: 28px; }
.resume-entry:last-child { margin-bottom: 0; }
.resume-entry-head, .resume-entry-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}
.resume-entry-head h3 { margin: 0; font-size: 1.08rem; color: var(--text); }
.resume-loc, .resume-dates { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.resume-title { color: var(--accent-strong); font-weight: 600; font-size: 0.95rem; }
.resume-entry-sub { margin: 4px 0 10px; }
.resume-entry ul { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.65; }
.resume-entry li { margin-bottom: 6px; }

/* ---------- Print: clean black-on-white, résumé-first ---------- */
@media print {
  :root, :root[data-theme="light"] {
    --bg: #ffffff; --bg-alt: #ffffff; --card: #ffffff; --card-border: #cccccc;
    --text: #000000; --text-muted: #222222; --accent: #000000; --accent-strong: #000000;
  }
  body { background: #fff !important; color: #000 !important; font-size: 10.5pt; }
  header.site-header, footer.site-footer, .skip-link, .btn-row, .theme-toggle, .nav-toggle, .banner { display: none !important; }
  .hero::before, .hero::after, .page-hero::before, .page-hero::after { display: none !important; }
  .hero, .page-hero { padding: 0 0 12px !important; min-height: 0 !important; background: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  section, section.alt { padding: 8px 0 !important; background: none !important; }
  .card, .project-card { box-shadow: none !important; break-inside: avoid; }
  .resume-entry { break-inside: avoid; }
  .tag-row li { border-color: #999 !important; background: none !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: none; }
  .thumb, .project-thumb { display: none !important; }
}
button.btn { font: inherit; font-weight: 600; cursor: pointer; }
button.btn-outline { background: transparent; }
@media print { h1, h2, h3, p, .eyebrow { text-shadow: none !important; } }
#security .card { display: flex; flex-direction: column; }
#security .card .link-row { margin-top: auto !important; padding-top: 14px; }

/* ---------- Hobbies (v11) ---------- */
.hobby-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hobby-grid .thumb { height: 190px; }
.hobby-grid .thumb { height: 280px; }
.hobby-grid .card-body p + p { margin-top: 12px; }
.photo-credit { margin-top: 16px !important; font-size: 0.75rem !important; opacity: 0.8; }
.photo-credit a { color: var(--text-muted); text-decoration: underline; }
.hobby-grid .card.has-thumb .thumb { height: 300px; }
@media (max-width: 720px) { .hobby-grid .card.has-thumb .thumb { height: 240px; } }

/* ---------- Interests tabs: numbered, eyebrow-style, sliding accent bar ---------- */
.tabs { display: none; }
.js .tabs {
  position: relative; display: flex; gap: 36px;
  margin: 0 0 40px; padding: 0;
  border-bottom: 1px solid var(--card-border);
}
.tab {
  position: relative; appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 4px 0 16px; font: inherit; color: var(--text-muted);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 0.3s ease;
}
.tab .tab-num {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem; letter-spacing: 0; color: var(--text-muted); opacity: 0.6;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.tab .tab-count {
  font-size: 0.7rem; letter-spacing: 0.02em; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; align-self: center;
  border: 1px solid var(--card-border); color: var(--text-muted);
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"] .tab-num { color: var(--accent); opacity: 1; }
.tab[aria-selected="true"] .tab-count { border-color: rgba(63, 143, 201, 0.5); color: var(--accent-strong); background: rgba(63, 143, 201, 0.10); }
.tab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 4px; border-radius: 4px; }

/* the accent bar slides and resizes to the active tab */
.tab-pill {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--w, 0px);
  transform: translateX(var(--x, 0px));
  background: var(--accent);
  box-shadow: 0 0 12px rgba(63, 143, 201, 0.6);
  border-radius: 2px;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1), width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.tabs.no-anim .tab-pill { transition: none; }
@media (max-width: 480px) { .js .tabs { gap: 22px; } .tab { font-size: 0.78rem; letter-spacing: 0.08em; } .tab .tab-count { display: none; } }

#hobbies { scroll-margin-top: 90px; }
.tab-panel + .tab-panel { margin-top: 64px; }

/* Panels stack in one cell; the active one slides/fades in, the old one drifts out. */
.js .tab-viewport {
  overflow: hidden; margin: 0 -16px; padding: 0 16px;
  transition: height 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.js .tab-track { display: grid; }
.js .tab-panel {
  grid-area: 1 / 1; align-self: start; min-width: 0; margin: 0; padding: 6px 0 20px;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease, visibility 0s 0s;
}
.js .tab-panel[inert] {
  opacity: 0; visibility: hidden; pointer-events: none; filter: blur(6px);
  transform: translateX(calc(var(--out, -1) * 48px)) scale(0.98);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.55, 0, 0.1, 1), filter 0.3s ease, visibility 0s 0.45s;
}
.js .tab-track[data-dir="back"] .tab-panel[inert] { --out: 1; }

/* Cards in the incoming panel cascade in from the direction of travel. */
@keyframes cardIn {
  from { opacity: 0; transform: translateX(calc(var(--in, 1) * 56px)) scale(0.97); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.js .tab-track[data-dir="back"] { --in: -1; }
.js .tab-panel.entering .card,
.js .tab-panel.entering .section-heading {
  animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 60ms);
}

@media (prefers-reduced-motion: reduce) {
    .tab-pill, .js .tab-viewport, .js .tab-panel, .js .tab-panel[inert] { transition: none !important; }
  .js .tab-panel.entering .card, .js .tab-panel.entering .section-heading { animation: none !important; }
}
@media print {
  .tabs { display: none !important; }
  .tab-track { display: block !important; }
  .tab-viewport { height: auto !important; overflow: visible !important; }
  .tab-panel[inert] { opacity: 1 !important; visibility: visible !important; filter: none !important; transform: none !important; }
}
