/* ============================================================
   site.css — corbet.app custom design system
   Replaces creative.min.css + bootstrap.min.js CSS + fontello
   ============================================================ */

/* ── 1. Design Tokens ──────────────────────────────────────── */
:root {
  --color-dark:      #343a40;
  --color-primary:   #1A73E8;
  --color-primary-d: #0F5ABB;
  --color-gold:      #d4af37;
  --color-text:      #000000;
  --color-muted:     #5f6b77;
  --color-border:    rgba(0,0,0,0.1);
  --color-bg:        #ffffff;
  --color-bg-alt:    #f8f9fa;
  --font-sans: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Merriweather, Georgia, "Times New Roman", serif;
  --nav-height: 64px;
  --section-pad: clamp(2.5rem, 5vw, 5rem);
  --content-max: 1100px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.22s var(--ease-out);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text:   #e9ecef;
    --color-muted:  #adb5bd;
    --color-border: rgba(255,255,255,0.1);
    --color-bg:     #1a1d20;
    --color-bg-alt: #212529;
    --color-dark:   #212529;
  }
  .navbar { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .portfolio-box-caption { background: rgba(26,115,232,0.88) !important; }
  h2, h3, h4, h5 { color: #e9ecef; }
  a { color: #6ab0ff; }
  a:hover { color: #90c8ff; }
}

/* ── 2. Reset & Base ───────────────────────────────────────── */
*, ::after, ::before { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }

/* Sticky-footer: body is full-height flex column */
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-tap-highlight-color: transparent;
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* main grows to fill space, pushing footer to bottom */
main {
  flex: 1 0 auto;
  width: 100%;
  display: block;
}

img { max-width: 100%; height: auto; vertical-align: middle; border-style: none; display: block; }
svg { overflow: hidden; vertical-align: middle; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-d); text-decoration: underline; }
h2, h3, h4, h5 { font-family: var(--font-sans); font-weight: 700; line-height: 1.2; color: var(--color-dark); margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.75rem, 4vw, 3.5rem); text-transform: capitalize; }
h3 { font-size: clamp(1.15rem, 2.5vw, 2rem); text-transform: capitalize; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
ul { margin-bottom: 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.3rem; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 0; }
figure { margin: 1rem 0; }

/* ── 3. Skip Link ──────────────────────────────────────────── */
.skip-link {
  position: fixed; top: -40px; left: 0;
  background: #fff; color: #000;
  padding: 8px 12px; z-index: 9999;
  font-weight: 700; text-decoration: none;
  transition: top 0.2s; border: 1px solid #990000;
}
.skip-link:focus { top: 80px; outline: 2px solid var(--color-primary); background: #ffc; }

/* ── 4. Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); background: var(--color-dark);
  display: flex; align-items: center; flex-wrap: nowrap;
  padding: 0 1.25rem; z-index: 1000; gap: 0;
}

/* Global .container-fluid: just full width, no flex */
.container-fluid { width: 100%; }

/* Navbar .container-fluid: desktop — auto width so brand only takes natural space */
.navbar .container-fluid {
  display: flex; align-items: center; justify-content: space-between;
  flex: 0 0 auto;   /* don't grow, don't shrink, natural content width */
  width: auto;       /* override the global width:100% */
  height: var(--nav-height); padding: 0 1rem;
}

.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  color: #fff !important; font-weight: 600; font-size: 1.1rem;
  text-decoration: none; white-space: nowrap;
}
.navbar-brand:hover { color: var(--color-gold) !important; text-decoration: none; }
.navbar-brand img { border-radius: 50%; }

.navbar-toggler {
  display: none; background: none;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 4px;
  padding: 11px 12px; cursor: pointer; color: rgba(255,255,255,0.8);
  line-height: 1; margin-left: 0.75rem; flex-shrink: 0;
}
.navbar-toggler:hover { border-color: rgba(255,255,255,0.6); }
.navbar-toggler-icon { display: block; width: 22px; height: 2px; background: #fff; position: relative; }
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: ''; display: block; width: 22px; height: 2px;
  background: #fff; position: absolute; left: 0;
  transition: transform var(--transition), top var(--transition);
}
.navbar-toggler-icon::before { top: -7px; }
.navbar-toggler-icon::after  { top:  7px; }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon { background: transparent; }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before { top: 0; transform: rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after  { top: 0; transform: rotate(-45deg); }

.navbar-collapse { display: flex; align-items: center; flex: 1; overflow: visible; }
.collapse { overflow: hidden; }
/* Override .collapse on desktop navbar — must come after .collapse rule */
.navbar-collapse.collapse { overflow: visible; }

.navbar-nav { display: flex; align-items: center; flex-direction: row; list-style: none; margin: 0; padding: 0; gap: 0; }
.navbar-nav.ms-auto { margin-left: auto; }
.nav-item { list-style: none; }
.nav-link {
  display: block; padding: 0.5rem 0.65rem;
  color: rgba(255,255,255,0.85); font-size: 0.88rem; font-weight: 500;
  text-decoration: none; transition: color var(--transition); white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--color-gold); text-decoration: none; }
.nav-link.active { font-weight: 700; }

.navbar .icons {
  display: flex; align-items: center; flex-direction: row;
  gap: 0; padding: 0 0.25rem; list-style: none;
}
.navbar .icons a {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: var(--nav-height);
  color: rgba(255,255,255,0.8); transition: color var(--transition); text-decoration: none;
}
.navbar .icons a:hover { color: var(--color-gold); }

@media (max-width: 991px) {
  .navbar { flex-wrap: wrap; height: auto; min-height: var(--nav-height); align-items: flex-start; padding: 0; }
  .navbar .container-fluid { flex: 0 0 100%; width: 100%; height: var(--nav-height); padding: 0 1rem; justify-content: space-between; }
  .navbar-toggler { display: flex; align-items: center; justify-content: center; }
  .navbar-collapse {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--color-dark); max-height: 0; overflow: hidden;
    flex-direction: column; align-items: stretch;
    transition: max-height 0.35s var(--ease-out);
    border-top: 1px solid rgba(255,255,255,0.08); flex: none; width: 100%;
  }
  /* Re-apply overflow:hidden on mobile for the animation — overrides desktop rule */
  .navbar-collapse.collapse { overflow: hidden; }
  .navbar-collapse.show { max-height: 600px; }
  .navbar-nav { flex-direction: column; align-items: stretch; width: 100%; padding: 0.5rem 0 0.25rem; margin: 0; }
  .navbar-nav.ms-auto { margin-left: 0; }
  .nav-link { padding: 0.75rem 1.5rem; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .navbar .icons { flex-direction: row; justify-content: flex-start; padding: 0.65rem 1.1rem 1rem; gap: 4px; border-bottom: none; }
  .navbar .icons a { width: 36px; height: 36px; }
}

/* Bootstrap navbar variant no-ops */
.navbar-expand-lg, .navbar-light, .bg-light {}

/* ── 5. Page Layout ────────────────────────────────────────── */
.page-wrapper { width: 100%; display: block; }

.resume-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-pad) 1.5rem;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 992px) { .resume-section { padding: var(--section-pad) 3rem; } }

.section-wrapper { opacity: 1; transform: none; }
.section-wrapper.animate-on-scroll {
  opacity: 0; transform: translateX(-30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.section-wrapper.animate-on-scroll.visible { opacity: 1; transform: none; }
.animated { opacity: 0; transform: translateX(-30px); }
.animated.visible { opacity: 1; transform: none; transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }

/* ── 6. Hero ───────────────────────────────────────────────── */
#home { text-align: center; padding-top: calc(var(--section-pad) + 1rem); }
#home h2 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.5rem; }
.text-muted { color: var(--color-muted) !important; }

/* img-profile: responsive, centered — overrideable by context */
.img-profile { display: block; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; object-fit: cover; }
.img-profile.rounded-circle { border-radius: 50%; }
#home .img-profile { width: clamp(180px, 25vw, 260px); height: clamp(180px, 25vw, 260px); margin-bottom: 1.5rem; }

.hero-body { max-width: 780px; margin: 0 auto; }
.hero-body p { font-size: clamp(1rem, 1.8vw, 1.2rem); line-height: 1.75; margin-bottom: 1rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.soc-icons { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.soc-icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; background: var(--color-muted); border-radius: 50%; color: #fff;
  text-decoration: none; transition: background var(--transition), transform var(--transition);
}
.soc-icons a:hover { background: var(--color-primary); transform: translateY(-2px); }

/* ── 7. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1.25rem; font-size: 0.95rem; font-weight: 700;
  border: none; border-radius: 5px; cursor: pointer; text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  vertical-align: middle;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-d); color: #fff; }

/* ── 8. Skills ─────────────────────────────────────────────── */
#skills { border-top: 1px solid var(--color-border); }
.skills-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1.5rem; }
@media (max-width: 855px) { .skills-section { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills-section { grid-template-columns: 1fr; } }
.skills-category h3 { font-size: 1.15rem; margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--color-primary); white-space: nowrap; }
.skills-category ul { list-style: none; padding: 0; }
.skills-category li { padding: 0.3rem 0 0.3rem 1.1rem; position: relative; font-size: 0.95rem; border-bottom: 1px solid var(--color-border); }
.skills-category li::before { content: "›"; position: absolute; left: 0; color: var(--color-primary); font-weight: 700; }

/* ── 9. Experience ─────────────────────────────────────────── */
#experience { border-top: 1px solid var(--color-border); }
.resume-item { margin-bottom: 2.5rem; border-left: 3px solid var(--color-primary); padding-left: 1.5rem; position: relative; }
.resume-item::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; background: var(--color-primary); border-radius: 50%; border: 2px solid var(--color-bg); }
.resume-content h3 { font-size: 1.2rem; color: var(--color-dark); margin-bottom: 0.15rem; }
.subheading { font-size: 1rem; font-weight: 500; color: var(--color-muted); }
.subheading a { color: var(--color-muted); }
.subheading a:hover { color: var(--color-primary); }
.resume-date { margin: 0.25rem 0 0.75rem; }
.resume-date .text-primary { color: var(--color-primary) !important; font-size: 0.9rem; font-weight: 600; }
.resume-item .job-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: none; padding: 0; text-align: left; width: 100%; }
.resume-item .job-toggle h3 { margin: 0; }
.job-chevron { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; transition: transform var(--transition); color: var(--color-muted); }
.resume-item.open .job-chevron { transform: rotate(180deg); }
.job-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease-out); }
.job-body-inner { overflow: hidden; }
.resume-item.open .job-body { grid-template-rows: 1fr; }

/* ── 10. Portfolio Grid (homepage) ─────────────────────────── */
#portfolio { border-top: 1px solid var(--color-border); }
.row { display: flex; flex-wrap: wrap; margin: 0; }
.no-gutters { margin: 0; }
.no-gutters > [class*="col-"] { padding: 0; }
.col-lg-4, .col-sm-6 { position: relative; width: 100%; padding: 0; }
@media (min-width: 576px) { .col-sm-6 { flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 992px) { .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; } }
.portfolio-box { display: block; position: relative; overflow: hidden; aspect-ratio: 4/3; text-decoration: none; background: #111; }
.portfolio-box img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s var(--ease-out), filter 0.45s var(--ease-out); filter: brightness(0.9); }
.portfolio-box:hover img { transform: scale(1.05); filter: brightness(0.6); }
.portfolio-box-caption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(26,115,232,0.92) 0%, transparent 100%);
  transform: translateY(100%); transition: transform 0.35s var(--ease-out); color: #fff;
}
.portfolio-box:hover .portfolio-box-caption,
.portfolio-box:focus .portfolio-box-caption { transform: translateY(0); }
.project-category { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.75); margin-bottom: 0.35rem; }
.project-name { font-size: 1.1rem; font-weight: 700; color: #fff; }

/* ── 11. Education ─────────────────────────────────────────── */
#education { border-top: 1px solid var(--color-border); }

/* ── 12. Footer — flex-shrink:0 completes sticky footer ────── */
.footer { background: var(--color-dark); color: #fff; padding: 1.5rem 1rem; text-align: center; flex-shrink: 0; width: 100%; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin-bottom: 0.75rem; }
.footer-nav a { color: rgba(255,255,255,0.8); display: inline-block; padding: 8px 14px; font-size: 0.875rem; text-decoration: none; transition: color var(--transition); }
.footer-nav a:hover { color: var(--color-gold); }
.footer-icons { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 0.75rem; }
.footer-icons a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); text-decoration: none; transition: background var(--transition), color var(--transition); }
.footer-icons a:hover { background: var(--color-primary); color: #fff; }
.footer p { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin: 0; }

/* ── 13. Back-to-top ───────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px;
  background: var(--color-primary); color: #fff; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
  z-index: 900; box-shadow: 0 2px 12px rgba(26,115,232,0.35);
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: var(--color-primary-d); transform: translateY(-3px); }

/* ── 14. Case Study / Portfolio pages ─────────────────────── */
.case-study-header { text-align: center; margin-bottom: 2rem; }
.case-study-header img { max-width: 280px; margin: 0 auto 1.5rem; }
.case-section { margin-top: 3rem; }
.case-section h3 { color: var(--color-dark); margin-bottom: 0.75rem; }
.figure { margin: 1.5rem 0; }
.figure-caption { font-size: 0.85rem; color: var(--color-muted); margin-top: 0.5rem; text-align: center; }
.img-fluid { max-width: 100%; height: auto; }
.img-thumbnail { padding: 4px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 4px; margin: 4px; }

/* Case study image grids — responsive */
.col-lg-6 { width: 100%; padding: 4px; box-sizing: border-box; }
.col-md-6 { width: 100%; padding: 4px; box-sizing: border-box; }
.col-md-4 { width: 100%; padding: 4px; box-sizing: border-box; }
.col-md-10 { width: 100%; }
.max-width-400 { max-width: 400px; }
@media (min-width: 768px) {
  .col-md-6  { width: 50%; }
  .col-md-4  { width: 33.333%; }
  .col-md-10 { max-width: 83.333%; }
}
@media (min-width: 992px) { .col-lg-6 { width: 50%; } }

/* w-XX wrappers: full-width mobile, constrained desktop */
.w-50, .w-70, .w-80, .w-90 { max-width: 100%; width: 100%; display: block; }
@media (min-width: 768px) {
  .w-50 { max-width: 50%; }
  .w-70 { max-width: 70%; }
  .w-80 { max-width: 80%; }
  .w-90 { max-width: 90%; }
}

/* Figma / iframe embeds */
.figma-embed { width: 100%; margin: 1.5rem 0; display: block; }
.figma-embed iframe { width: 100% !important; height: 500px; min-height: 400px; border: none; display: block; }
@media (min-width: 768px) { .figma-embed iframe { height: 600px; } }

/* ── 15. Bootstrap utility shim ───────────────────────────── */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.flex-md-row { flex-direction: column; }
@media (min-width: 768px) { .flex-md-row { flex-direction: row !important; } }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.ms-auto, .ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.text-center { text-align: center !important; }
.text-white { color: #fff !important; }
.text-white-50 { color: rgba(255,255,255,0.6) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-muted { color: var(--color-muted) !important; }
.text-decoration-none { text-decoration: none !important; }
.text-md-left { text-align: left !important; }
.img-responsive { max-width: 100%; }
.d-one {}
.m-0  { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-5 { margin-top: 2.5rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.p-0  { padding: 0 !important; }
.p-3  { padding: 1rem; }
.pt-5 { padding-top: 2.5rem !important; }
.p-lg-5 {}
@media (min-width: 992px) { .p-lg-5 { padding: 2.5rem !important; } }
.fs-1 { font-size: clamp(1rem, 2.5vw, 1.5rem) !important; }
.fs-2 { font-size: clamp(0.9rem, 2vw, 1.2rem) !important; }
.fs-5 { font-size: 1.1rem !important; }
.lead { font-size: 1.15rem; font-weight: 300; }

/* ── 16. YouTube thumbnail embeds ─────────────────────────── */
.video-embed { margin: 1.5rem 0; max-width: 100%; }
.video-thumb-link { display: block; position: relative; text-decoration: none; border-radius: 6px; overflow: hidden; background: #000; }
.video-thumb-link img { width: 100%; display: block; transition: opacity 0.2s ease; }
.video-thumb-link:hover img { opacity: 0.85; }
.video-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; background: rgba(255,0,0,0.85); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; padding-left: 4px; pointer-events: none; transition: background 0.2s ease;
}
.video-thumb-link:hover .video-play-btn { background: rgba(255,0,0,1); }
.video-embed .figure-caption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--color-muted); text-align: center; }

/* ── 17. Focus & Accessibility ─────────────────────────────── */
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 2px; }

/* ── 18. Print ─────────────────────────────────────────────── */
@media print {
  .navbar, .footer, #back-to-top { display: none !important; }
  body { padding-top: 0 !important; font-size: 12pt; display: block; }
  a { color: inherit; }
  .portfolio-box-caption { transform: none; background: rgba(0,0,0,0.5); }
}
