/* ==========================================================================
   ELEMENT 13 — SHARED STYLES
   Derived from the official Style Guide. Single source of truth.
   ========================================================================== */

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

:root {
  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --text-primary: #102A43;
  --text-secondary: #627D98;
  --border: #D9E2EC;
  --accent: #186FAF;
  --accent-light: #84C5F4;
  --warm: #E8E6E1;
  --font: 'Libre Franklin', sans-serif;
  --max-width: 1440px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  height: 64px;
}

.nav-logo {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.nav-logo span {
  color: var(--accent);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 7px;
  transition: background 0.2s;
}

.nav-cta:hover { background: #115a90; }

.nav-toggle { display: none; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 7px;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.08), 0 4px 8px rgba(24, 111, 175, 0.18);
}
.btn-primary:hover {
  background: #115a90;
  box-shadow: 0 2px 4px rgba(16, 42, 67, 0.1), 0 8px 16px rgba(24, 111, 175, 0.22);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

.btn-light {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
}
.btn-light:hover { background: #fff; color: var(--accent); }

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

/* ── TYPOGRAPHY UTILITIES ── */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.eyebrow-light {
  color: var(--accent-light);
}
.eyebrow-light::before { background: var(--accent-light); }

h1, h2, h3, h4 { font-weight: 300; letter-spacing: 0.01em; line-height: 1.15; color: var(--text-primary); }
h1 { font-size: clamp(36px, 5vw, 64px); }
h2 { font-size: clamp(28px, 3.5vw, 44px); font-weight: 400; }
h3 { font-size: 22px; font-weight: 500; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }

.lede {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 56ch;
  line-height: 1.6;
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── SECTIONS ── */
.section {
  padding: 120px 56px;
  border-bottom: 1px solid var(--border);
}

.section-narrow { max-width: 1200px; margin: 0 auto; }

.section-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  margin-bottom: 72px;
}

.section-header-stack > * + * { margin-top: 20px; }

/* ── GRID HELPERS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ── CARDS — Refactoring UI: shadows over borders, accent colors, depth ── */
.card {
  background: var(--surface);
  padding: 44px 40px 40px;
  position: relative;
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(16, 42, 67, 0.04),
    0 4px 12px rgba(16, 42, 67, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

/* Accent top border — a Refactoring UI-recommended technique */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(16, 42, 67, 0.06),
    0 12px 28px rgba(16, 42, 67, 0.08);
}

.card .card-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 28px;
  display: block;
}

/* Icon container — softer color (icon de-emphasis, per book) */
.card-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(24, 111, 175, 0.06);
  border-radius: 8px;
}
.card-icon svg { width: 32px; height: 32px; }

.card h3 { margin-bottom: 14px; }
.card p { font-size: 15px; color: var(--text-secondary); line-height: 1.65; }

.card ul {
  list-style: none;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.card ul li {
  font-size: 14px;
  color: var(--text-primary);
  padding: 9px 0 9px 26px;
  position: relative;
  font-weight: 400;
}

/* Checkmark bullet using SVG (Refactoring UI: replace bullets with icons) */
.card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8L7 12L13 4' stroke='%23186FAF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* ── FOOTER ── */
.footer {
  background: var(--text-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 80px 56px 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto 64px;
}

.footer-brand .logo-line {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}
.footer-brand .logo-line span { color: var(--accent-light); font-weight: 500; }
.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
  max-width: 36ch;
}

.footer h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}

.footer ul { list-style: none; }
.footer ul li { padding: 6px 0; }
.footer ul a {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}
.footer ul a:hover { color: var(--accent-light); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 24px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 2px rgba(16, 42, 67, 0.04);
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(16, 42, 67, 0.04), 0 0 0 3px rgba(24, 111, 175, 0.12);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.8s ease-out backwards; }

/* ── ELEVATION UTILITIES (Refactoring UI: shadow system) ── */
.elev-1 { box-shadow: 0 1px 2px rgba(16, 42, 67, 0.04), 0 4px 8px rgba(16, 42, 67, 0.04); }
.elev-2 { box-shadow: 0 2px 4px rgba(16, 42, 67, 0.06), 0 12px 24px rgba(16, 42, 67, 0.08); }
.elev-3 { box-shadow: 0 4px 8px rgba(16, 42, 67, 0.08), 0 24px 48px rgba(16, 42, 67, 0.12); }

/* ── INLINE ICON SVG (de-emphasized icon, per book) ── */
.icon-sm { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.icon-md { width: 24px; height: 24px; flex-shrink: 0; color: var(--accent); }
.icon-lg { width: 32px; height: 32px; flex-shrink: 0; color: var(--accent); }

/* ── BACKGROUND DECORATIONS (Refactoring UI: decorate your backgrounds) ── */
/* Grid pattern — for technical / spec sections */
.bg-grid-pattern {
  background-image:
    linear-gradient(to right, rgba(16, 42, 67, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 42, 67, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-grid-pattern-soft {
  background-image:
    linear-gradient(to right, rgba(16, 42, 67, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 42, 67, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* Dot pattern — for process / flow / step-based sections */
.bg-dot-pattern {
  background-image: radial-gradient(circle at 1px 1px, rgba(16, 42, 67, 0.14) 1px, transparent 0);
  background-size: 24px 24px;
}
.bg-dot-pattern-soft {
  background-image: radial-gradient(circle at 1px 1px, rgba(16, 42, 67, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
}

/* Dark variants — for use on the navy/dark sections */
.bg-dot-pattern-light {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.10) 1px, transparent 0);
  background-size: 28px 28px;
}
.bg-grid-pattern-light {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .nav { padding: 0 32px; }
  .section { padding: 80px 32px; }
  .section-header { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer { padding: 64px 32px 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 48px; }
}

@media (max-width: 720px) {
  .nav { padding: 0 20px; height: 56px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px; height: 32px;
  }
  .nav-toggle span {
    width: 20px;
    height: 1.5px;
    background: var(--text-primary);
    display: block;
    transition: transform 0.2s;
  }
  .nav.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: #fff;
    padding: 24px 20px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav.menu-open .nav-cta { display: inline-flex; margin: 8px 20px 24px; align-self: flex-start; }
  .section { padding: 64px 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 20px; }
  .footer { padding: 48px 20px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
