/* ========================================
   STYLE.CSS — Final Unified Version (2025-10-31)
   ======================================== */

:root {
  --navy:#1E4E7E;
  --mid:#2A6FB0;
  --accent:#3C8DD1;
  --hover:#4EA0E2;
  --bg:#F9FAFB;
  --ink:#111;
}

/* ===== RESET / BASE ===== */
* { box-sizing:border-box; }
html, body { margin:0; padding:0; }
body {
  background:var(--bg);
  color:var(--ink);
  font-family: Calibri, "Segoe UI", -apple-system, system-ui, sans-serif;
  line-height:1.55;
}

.container {
  max-width:1080px;
  margin:0 auto;
  padding:0 1rem;
}

/* ===== HEADER / NAVIGATION ===== */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Desktop/tablet layout:
   Use flex to keep brand left, nav centered, and hamburger right.
*/
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.brand-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0, 0, 0, .25);
}

.brand span {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

/* Center nav links perfectly on desktop */
.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav a {
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  padding: .4rem .6rem;
  border-radius: 8px;
  font-size: .95rem;
}

.nav a:hover {
  background: var(--hover);
}

/* Hamburger stays right-aligned */
.nav-toggle {
  background: none;
  border: none;
  padding: .25rem;
  display: none; /* hidden on desktop */
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
}

/* ===== MOBILE ===== */
@media (max-width: 799px) {
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav {
    display: none;
    position: absolute;
    right: 1rem;
    top: 56px;
    background: var(--navy);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: .5rem .75rem;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
    flex-direction: column;
    align-items: flex-start;
    min-width: 180px;
    transform: none;
    left: auto;
  }

  .nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* Hide Contact link everywhere for now */
.nav a[href="contact.html"] {
  display: none !important;
}

/* ===== GENERIC ELEMENTS ===== */
.section { padding:2rem 0; }

h1,h2,h3,h4 {
  color:var(--navy);
  margin-top:0;
  font-weight:800;
}

.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.6rem .9rem;
  border-radius:10px;
  font-weight:700;
  text-decoration:none;
  border:1px solid #bbb;
  background:#fff;
  color:#111;
  cursor:pointer;
}
.btn-primary {
  background:var(--mid);
  color:#fff;
  border-color:var(--mid);
}
.btn-primary:hover { filter:brightness(.95); }
.btn-secondary {
  background:#fff;
  color:#111;
  border-color:#ddd;
}

.card {
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  padding:1rem;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}

/* ===== HOME HERO ===== */
.hero {
  padding:3rem 0 2rem;
}
.hero-flex {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:2rem;
}
/* widen hero text on desktop so it lines up better with heading */
@media (min-width:800px){
  .hero-subtitle {
    max-width:70ch;
  }
}
.hero-photo {
  width:160px;
  height:160px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}
.hero-title {
  font-size:clamp(1.6rem,2.5vw,2.25rem);
  margin:0 0 .5rem;
  color:var(--navy);
  font-weight:800;
}
.hero-subtitle {
  margin:.25rem 0 1rem;
  color:#333;
  max-width:48ch;
  font-size:1rem;
  line-height:1.45;
  font-weight:500;
}
@media (min-width:800px){
  .hero-subtitle { max-width:70ch; }
}
.hide-avatar .brand-photo { display:none; }

/* ===== CASE STUDIES ===== */
.grid {
  display:grid;
  gap:1rem;
}
@media(min-width:601px){ .grid { grid-template-columns:repeat(2,1fr); } }
@media(min-width:1100px){ .grid { grid-template-columns:repeat(3,1fr); } }

.case-card {
  background:#fff;
  border:1px solid #e5eaf0;
  border-radius:14px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
  padding:1rem 1rem 1.25rem;
  position:relative;
}
.case-card h3 {
  margin:0 0 .4rem;
  font-size:1.05rem;
  line-height:1.4;
  font-weight:800;
  color:var(--navy);
}
.subtitle {
  font-style:italic;
  color:#2A6FB0;
  font-size:0.95rem;
  margin-top:-0.25rem;
  margin-bottom:0.5rem;
  display:block;
  line-height:1.4;
}
.role-badge {
  font-size:.8rem;
  padding:.1rem .5rem;
  border-radius:999px;
  border:1px solid #e4f1fb;
  background:#f3f7fb;
  color:#2A6FB0;
  font-weight:700;
  display:inline-block;
  margin-bottom:.5rem;
}
.tag {
  font-size:.8rem;
  background:#f3f7fb;
  color:#2A6FB0;
  padding:.1rem .45rem;
  border-radius:999px;
  border:1px solid #e4f1fb;
  display:inline-block;
}

/* Smooth accordion for case study panels */
.case-details {
  overflow:hidden;
  max-height:0;
  opacity:0;
  transition:max-height .28s ease, opacity .28s ease;
  margin-top:.75rem;
  border-top:1px dashed #e6ecf3;
  padding-top:0;
  font-size:.9rem;
  line-height:1.45;
  color:#333;
}
.case-details.opening,
.case-details.open {
  opacity:1;
  padding-top:.75rem;
}
.case-details.open {
  max-height:800px;
}
.case-details.closing { opacity:0; }
.case-details h4 {
  margin:.75rem 0 .4rem;
  font-size:.9rem;
  font-weight:700;
  color:var(--navy);
}
.case-details ul { margin:.25rem 0 .75rem 1rem; padding:0; }
.case-details li { margin-bottom:.4rem; }

.toggle-btn {
  display:inline-block;
  margin-top:.75rem;
  color:#2A6FB0;
  font-weight:700;
  cursor:pointer;
  user-select:none;
  font-size:.9rem;
  text-decoration:underline;
}
.toggle-btn:hover { text-decoration:underline; }

.filters {
  position:sticky;
  top:56px;
  background:#F9FAFBCC;
  backdrop-filter:saturate(140%) blur(6px);
  padding:.5rem 0 .75rem;
  border-bottom:1px solid #eee;
  z-index:40;
  margin-bottom:1rem;
}
.filter-row {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  align-items:center;
}
.tab {
  background:#fff;
  border:1px solid #e5eaf0;
  border-radius:999px;
  padding:.35rem .75rem;
  font-weight:700;
  cursor:pointer;
  font-size:.8rem;
  line-height:1.2;
  color:#1E4E7E;
}
.tab[aria-pressed="true"] {
  background:#eef5fd;
  border-color:#cfe6ff;
  color:#1E4E7E;
}

/* ===== TECHNICAL ACCORDION ===== */
.tech-section { margin-bottom:1rem; }
.tech-card {
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
  margin-bottom:.75rem;
  overflow:hidden;
}
.tech-head {
  cursor:pointer;
  padding:1rem 1rem 1rem 1.25rem;
  font-weight:800;
  color:var(--navy);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:1rem;
}
.tech-head .label { display:flex; flex-direction:column; }
.tech-head .label .title { font-weight:800; color:var(--navy); }
.tech-head .label .hint { font-size:.8rem; font-weight:500; color:#2A6FB0; line-height:1.3; }
.tech-toggle-icon { font-size:1rem; font-weight:700; color:var(--mid); }

/* Smooth accordion for technical content */
.tech-content {
  overflow:hidden;
  max-height:0;
  opacity:0;
  transition:max-height .28s ease, opacity .28s ease;
  padding:0 1rem 0 1.25rem;
  border-top:1px dashed #e6ecf3;
  margin-top:.5rem;
  font-size:.9rem;
  line-height:1.5;
  color:#333;
}
.tech-card.open .tech-content {
  opacity:1;
  max-height:600px;
  padding-bottom:1rem;
}
.tech-card.open::after {
  content:'';
  display:block;
  height:3px;
  background:linear-gradient(90deg,#1E4E7E,#3C8DD1);
  border-radius:0 0 8px 8px;
  margin-top:.5rem;
}
@media(min-width:800px){
  .tech-columns {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:1rem;
  }
}

/* ===== CONTACT PAGE ===== */
.page { padding:2rem 0; }
.contact-card {
  background:#fff;
  border-radius:16px;
  padding:2rem 2rem 2rem;
  box-shadow:0 4px 16px rgba(0, 0, 0, 0.06);
  max-width:700px;
  margin:0 auto;
  border:1px solid #e5eaf0;
}
.contact-head h1 {
  font-size:1.6rem;
  font-weight:800;
  color:var(--navy);
  margin:0 0 .5rem;
}
.contact-head .lede {
  color:#444;
  font-size:1rem;
  margin:0 0 1.5rem;
  line-height:1.4;
  font-weight:500;
}
.kf-form .field {
  display:flex;
  flex-direction:column;
  margin-bottom:1rem;
  max-width:100%;
}
.kf-form label {
  font-weight:600;
  margin-bottom:6px;
  color:#1f3a60;
  font-size:.9rem;
}
.kf-form input[type="text"],
.kf-form input[type="email"],
.kf-form textarea {
  width:100%;
  padding:12px 14px;
  border-radius:8px;
  border:1px solid #ccd2da;
  background-color:#fafbfc;
  font-size:16px;
  line-height:1.4;
  transition:all 0.2s ease;
  font-family: Calibri, "Segoe UI", -apple-system, system-ui, sans-serif;
}
.kf-form textarea { min-height:160px; resize:vertical; }
.kf-form input:focus,
.kf-form textarea:focus {
  outline:none;
  border-color:#2A6FB0;
  box-shadow:0 0 0 3px rgba(42,111,176,0.2);
  background-color:#fff;
}
.kf-form .hp { display:none !important; visibility:hidden !important; }
.kf-form .actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.75rem;
  margin-top:1rem;
}
.kf-form .actions .btn-primary {
  border:none;
  border-radius:8px;
  padding:12px 20px;
  font-size:1rem;
  cursor:pointer;
  transition:background-color 0.2s ease, box-shadow 0.2s ease;
  background-color:#2A6FB0;
  box-shadow:0 3px 6px rgba(42,111,176,0.25);
  color:#fff;
}
.kf-form .actions .btn-primary:hover {
  background-color:#1e5788;
  box-shadow:0 3px 6px rgba(42,111,176,0.35);
}
.form-status { font-size:.9rem; color:#444; font-weight:500; }

/* ===== THANK-YOU PAGE ===== */
.thankyou-page { background:var(--bg); }
.thankyou-wrapper {
  min-height:70vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem 1rem;
}
.thankyou-card {
  text-align:center;
  background:#fff;
  padding:2.5rem 3rem;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(0,0,0,0.08);
  max-width:500px;
  margin:0 auto;
  border:1px solid #e5eaf0;
}
.icon-circle {
  width:80px;
  height:80px;
  margin:0 auto;
  background-color:#eaf3fa;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.thankyou-card h2 {
  color:#1f3a60;
  font-size:1.8rem;
  margin:1rem 0 .5rem;
  font-weight:800;
}
.thankyou-card p {
  color:#555;
  font-size:1.05rem;
  margin:1rem 0 1.5rem;
  line-height:1.5;
  font-weight:500;
}
.thankyou-card .btn-primary {
  text-decoration:none;
  border:none;
  border-radius:8px;
  padding:12px 24px;
  font-size:1rem;
  cursor:pointer;
  transition:background-color 0.2s ease;
  background-color:#2A6FB0;
  color:#fff;
  font-weight:600;
}
.thankyou-card .btn-primary:hover { background-color:#1f5b8f; }

/* ===== FOOTER ===== */
.site-footer {
  background:#fff;
  border-top:1px solid #e0e4ea;
  padding:1.2rem 0;
  font-size:.95rem;
  color:#444;
  text-align:center;
  margin-top:3rem;
}
.footer-links {
  display:flex;
  gap:.5rem;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  line-height:1.4;
  margin-bottom:.5rem;
}
.footer-links a {
  color:#2A6FB0;
  text-decoration:none;
  font-weight:600;
}
.footer-links a:hover { text-decoration:underline; }
.footer-url {
  color:#444;
  font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:.9rem;
}
.sep { color:#bbb; padding:0 .4rem; }
.footer-copy {
  color:#666;
  font-size:.8rem;
  font-weight:500;
}
/* ===== REFERENCES PAGE ===== */

/* Hide Contact link (temporary) */
.nav a[href="contact.html"] {
  display: none !important;
}

/* The whole "era" group wrapper */
.ref-group {
  background: transparent;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  overflow: hidden;
}

/* Clickable group header (like tech-head style but lighter) */
.ref-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 1rem 1.25rem;
  background: #fff;
  cursor: pointer;
  border-bottom: 1px solid #e5eaf0;
}

.ref-headline-title {
  margin: 0;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  font-size: 1rem;
}

.ref-headline-hint {
  margin: 0.25rem 0 0;
  font-size: .8rem;
  font-weight: 500;
  color: #2A6FB0;
  line-height: 1.3;
}

.ref-toggle-icon {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mid);
  line-height: 1;
  user-select: none;
}

/* Collapsible panel */
.ref-panel {
  background: #F9FAFB;
  padding: 1rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height .28s ease,
    opacity .28s ease,
    padding-top .28s ease,
    padding-bottom .28s ease;
}

/* When group is open */
.ref-group.open .ref-panel {
  max-height: 2000px;                /* large enough for all refs */
  opacity: 1;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* This is the grid that lays out all the individual ref cards */
.ref-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;        /* mobile default: single column */
}

@media (min-width: 700px) {
  .ref-grid {
    grid-template-columns: 1fr 1fr;  /* desktop/tablet: two columns */
  }
}

/* Each reference "card" */
.ref-card {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  padding: 1rem 1rem 1.25rem;
  line-height: 1.45;
  font-size: 0.95rem;
  color: #111;
}

/* Top row of the card: avatar + name/title/org */
.ref-card-top {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .75rem;
}

/* Circular avatar next to the text */
.ref-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 2px solid #fff;
}

/* Name/role block next to avatar */
.ref-meta h3 {
  margin: 0 0 .25rem;
  color: var(--navy);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
}

.ref-meta .title {
  font-weight: 600;
  color: #000;
  font-size: .9rem;
  line-height: 1.4;
}
.ref-meta .org {
  font-size: .9rem;
  line-height: 1.4;
  color: #444;
}

.ref-body p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
}

.ref-body a {
  color: #2A6FB0;
  font-weight: 600;
  text-decoration: underline;
}

/* ===== UTILITIES ===== */
.embed {
  width:100%;
  height:80vh;
  border:1px solid #eee;
  border-radius:10px;
  background:#fff;
}

.clicky {
  cursor:pointer;
}
/* ===== TECH INTRO PARAGRAPH WIDTH / SPACING ===== */
.tech-intro {
  color:#333;
  line-height:1.5;
  font-size:1rem;
  max-width:100%;
  margin:0 0 1.5rem;
}
@media (min-width:800px){
  .tech-intro {
    max-width:100%;
    /* let it span the same width as the grid so it breathes */
  }
}

/* ===== TECH GRID (4 tiles total) ===== */
.tech-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
}

/* two columns at desktop/tablet widths */
@media (min-width:800px){
  .tech-grid {
    grid-template-columns:1fr 1fr;
  }
}

/* each .tech-card still styled elsewhere, we’re just handling layout here */

/* subtle helper text under tool lists */
.subtle {
  color:#555;
  font-weight:500;
}
/* Home page only: hide the small header photo next to your name */
body.hide-avatar .brand-photo { 
  display: none !important;
}
/* Force circular, fixed-size hero photo */
.hero-photo {
  width: 160px !important;
  height: 160px !important;
  aspect-ratio: 1/1;
  border-radius: 9999px !important;
  object-fit: cover;
  max-width: none !important;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Slightly smaller on mobile */
@media (max-width: 799px) {
  .hero-photo {
    width: 136px !important;
    height: 136px !important;
  }
}