/* =============================================
   Mid-State Abstract — Main Stylesheet
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Pulled from new logo (MSABSTRACT_LOGO2) */
  --navy:       #263082;   /* deep indigo — dark diamond face / MID·STATE text */
  --navy-dark:  #161e60;   /* deepest backgrounds */
  --blue:       #5270c4;   /* cornflower — lighter diamond face */
  --blue-soft:  #8090c8;   /* periwinkle — ABSTRACT COMPANY text tone */
  --blue-pale:  #eef0f9;   /* very light blue-lavender for alt sections */
  /* Tertiary warm accent */
  --gold:       #c9a84c;
  --gold-light: #e8c97a;
  /* Neutrals */
  --white:      #ffffff;
  --text:       #1a2245;
  --text-muted: #566080;
  --border:     #cad0ec;
  --shadow:     0 4px 24px rgba(38,48,130,0.10);
}

html { scroll-behavior: smooth; scroll-padding-top: 78px; }

body {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ─── NAVIGATION ─────────────────────────────── */

#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

#navbar.scrolled {
  background: var(--navy-dark);
  border-color: transparent;
  box-shadow: 0 2px 16px rgba(17,25,96,0.28);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* Nav logo: full logo at top, diamond mark on scroll.
   MSABSTRACT.png is tight-cropped (5067×1104) so no overflow trick needed. */
.nav-logo {
  position: relative;
  height: 44px;
  width: 210px;
  flex-shrink: 0;
}

.nav-logo-full {
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  height: 50px;
  width: auto;
  transition: opacity 0.35s ease;
  opacity: 1;
}

.nav-logo-mark {
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  height: 44px;
  width: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#navbar.scrolled .nav-logo-full   { opacity: 0; pointer-events: none; }
#navbar.scrolled .nav-logo-mark   { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 4px;
  transition: color 0.25s, background 0.25s;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a:hover {
  color: var(--blue);
  background: var(--blue-pale);
}

/* When scrolled: light text on dark bg */
#navbar.scrolled .nav-links a {
  color: rgba(255,255,255,0.80);
}
#navbar.scrolled .nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-portal {
  background: var(--navy) !important;
  color: var(--white) !important;
  border-radius: 4px;
  font-weight: 700 !important;
  transition: background 0.2s !important;
}
.nav-portal:hover {
  background: var(--blue) !important;
  color: var(--white) !important;
}
#navbar.scrolled .nav-portal {
  background: var(--gold) !important;
  color: var(--navy-dark) !important;
}
#navbar.scrolled .nav-portal:hover {
  background: var(--gold-light) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
#navbar.scrolled .hamburger span { background: var(--white); }

/* ─── HERO ───────────────────────────────────── */

#home {
  min-height: 100vh;
  background: var(--navy-dark);
  padding-top: 70px;
  position: relative;
  overflow: hidden;
}

#home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(22,30,96,1) 0%, rgba(22,30,96,1) 35%, rgba(22,30,96,0.55) 55%, rgba(22,30,96,0) 72%);
  z-index: 1;
  pointer-events: none;
}

.hero-photo-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 68%;
  height: 100%;
  object-fit: cover;
  object-position: 40% center;
  z-index: 0;
  display: block;
}

.hero-grid {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 70px);
  position: relative;
  z-index: 2;
}


.hero-content {
  position: relative;
  z-index: 1;
  max-width: 55%;
  padding: 130px 0 110px;
}

.hero-eyebrow {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--blue-soft);
  margin-bottom: 40px;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  color: var(--white);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 40px;
}

.hero-content h1 sup {
  font-size: 0.38em;
  font-style: normal;
  vertical-align: super;
  font-weight: 400;
  opacity: 0.75;
}

.hero-rule {
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 32px;
}

.hero-sub {
  font-size: 1.08rem;
  color: rgba(255,255,255,0.65);
  font-weight: 300;
  line-height: 1.78;
  max-width: 580px;
  margin-bottom: 52px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: inline-block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 2px;
  border: 1px solid rgba(107,136,204,0.55);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: inline-block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn-outline:hover {
  border-color: var(--blue-soft);
  background: rgba(107,136,204,0.10);
}


/* ─── SECTION SHARED ─────────────────────────── */

.section { padding: 48px 0 72px; }
.section-alt { background: var(--blue-pale); }

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2::before,
.about-text h2::before {
  content: '◆';
  color: var(--gold);
  margin-right: 0.35em;
  font-size: 0.65em;
  vertical-align: middle;
  position: relative;
  top: -0.1em;
}

.section-header h2::after,
.about-text h2::after {
  content: '◆';
  color: var(--gold);
  margin-left: 0.35em;
  font-size: 0.65em;
  vertical-align: middle;
  position: relative;
  top: -0.1em;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--navy);
  margin-bottom: 16px;
}
.section-header p {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ─── SERVICES ───────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 36px 32px;
  transition: box-shadow 0.25s, transform 0.2s, border-color 0.2s;
}
.service-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--blue-soft);
}

.service-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.service-icon svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: rgba(255,255,255,0.90);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card h3 {
  font-size: 1.12rem;
  color: var(--navy);
  margin-bottom: 10px;
}
.service-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── ABOUT ──────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: stretch;
}

.about-text h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--navy);
  margin-bottom: 20px;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1rem;
}
.about-text p:last-of-type { margin-bottom: 32px; }

.about-pillars {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pillar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pillar-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: rgba(62,98,184,0.10);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pillar-icon svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pillar-text strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}
.pillar-text span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.about-visual { position: relative; }

.about-photo-wrap {
  position: relative;
  height: 100%;
  min-height: 480px;
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  display: block;
}

.about-photo-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--gold);
  border-radius: 4px;
  padding: 22px 26px;
  box-shadow: 0 8px 32px rgba(201,168,76,0.30);
  z-index: 2;
}
.about-photo-badge .accent-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1;
}
.about-photo-badge .accent-label {
  font-size: 0.78rem;
  color: var(--navy-dark);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* ─── FEATURE BAND ───────────────────────────── */

.feature-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.feature-band-photo {
  overflow: hidden;
  max-height: 520px;
}

.feature-band-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s ease;
}

.feature-band-photo:hover img {
  transform: scale(1.03);
}

.feature-band-content {
  background: var(--navy);
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}


.feature-band-content blockquote {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-style: italic;
  color: var(--white);
  line-height: 1.35;
  border: none;
  padding: 0;
  margin: 0;
}

.feature-band-content p {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
  margin: 0;
}

/* ─── FAQ ────────────────────────────────────── */

.faq-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
  gap: 16px;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--blue-pale); }
.faq-question[aria-expanded="true"] {
  background: var(--blue-pale);
  border-bottom: 1px solid var(--border);
}

/* Diamond toggle icon instead of chevron */
.faq-diamond {
  flex-shrink: 0;
  width: 12px; height: 12px;
  background: var(--blue);
  border-radius: 2px;
  transform: rotate(45deg);
  transition: background 0.2s, transform 0.3s;
}
.faq-question[aria-expanded="true"] .faq-diamond {
  background: var(--gold);
  transform: rotate(45deg) scale(1.15);
}

.faq-answer {
  display: none;
  padding: 20px 28px 24px;
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.75;
  border-top: 1px solid var(--border);
}
.faq-item.open .faq-answer { display: block; }

/* ─── CONTACT ────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 16px;
}
.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 0.97rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-detail {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.contact-detail-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-detail-icon svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: rgba(255,255,255,0.90);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-detail-text strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 3px;
}
.contact-detail-text a,
.contact-detail-text span {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.5;
}
.contact-detail-text a:hover { color: var(--navy); text-decoration: underline; }

/* ─── OFFICES ────────────────────────────────── */

.offices-grid {
  display: flex;
  justify-content: center;
}

.office-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.office-card strong {
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 4px;
}
.office-card span {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.office-card a {
  font-size: 0.9rem;
  color: var(--blue);
  font-weight: 600;
  margin-top: 6px;
}
.office-card a:hover { color: var(--navy); text-decoration: underline; }

/* ─── MAP (full-bleed horizontal block) ─────── */

.map-block {
  width: 100%;
  height: 400px;
  line-height: 0;
}
.map-block iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.contact-form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.contact-form-card h3 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(62,98,184,0.12);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-submit { width: 100%; margin-top: 6px; }
.form-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

/* ─── DIVIDER ────────────────────────────────── */

.diamond-divider {
  text-align: center;
  padding: 0;
  line-height: 0;
  user-select: none;
}
.diamond-divider span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--border);
  font-size: 0.7rem;
  letter-spacing: 4px;
}
.diamond-divider span::before,
.diamond-divider span::after {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background: var(--border);
}

/* ─── FOOTER ─────────────────────────────────── */

footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.65);
  padding: 60px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo-img {
  display: block;
  height: 40px;
  width: auto;
  margin-bottom: 18px;
}

.footer-brand p {
  font-size: 0.87rem;
  line-height: 1.7;
  max-width: 260px;
}

.footer-col h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--white);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col ul a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--blue-soft); }

/* thin gold rule above footer bottom */
.footer-bottom {
  border-top: 1px solid rgba(201,168,76,0.20);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.80rem;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,0.42); transition: color 0.2s; }
.footer-bottom a:hover { color: var(--blue-soft); }

/* ─── TOAST ──────────────────────────────────── */

#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--navy);
  color: var(--white);
  padding: 16px 24px;
  border-radius: 4px;
  border-left: 3px solid var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(17,25,96,0.28);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(.22,.68,0,1.2), opacity 0.35s;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast svg {
  stroke: var(--gold);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ─────────────────────────────── */

@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { gap: 48px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

@media (max-width: 900px) {
  .container { padding: 0 28px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-photo-wrap { aspect-ratio: 1 / 1; height: auto; min-height: 0; max-width: 320px; margin: 0 auto; }
  .about-photo-badge { bottom: -12px; right: -12px; }
  .feature-band { grid-template-columns: 1fr; }
  .feature-band-photo { max-height: 320px; }
  .feature-band-content { padding: 48px 32px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 680px) {
  .container { padding: 0 20px; }
  .hero-content { max-width: 100%; }
  .hero-photo-bg { width: 100%; opacity: 0.5; object-position: center center; }
  #home::before { background: rgba(22,30,96,0.85); }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--navy-dark);
    padding: 16px 0 24px;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-radius: 0; font-size: 0.9rem; }
  .hamburger { display: flex; }
  .section { padding: 32px 0 48px; }

  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-col-nav, .footer-col-services { display: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .contact-form-card { padding: 28px 20px; }
  .map-block { height: 280px; }
}
