/* ============================================================
   SeriousCivilEngineer.com — Global Stylesheet
   ============================================================ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Mono:wght@400;600&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* ── TOKENS ── */
:root {
  --ink:     #0f1117;
  --paper:   #f5f2eb;
  --steel:   #2b4c7e;
  --amber:   #d4822a;
  --rule:    #c9c3b5;
  --muted:   #6b6558;
  --white:   #ffffff;
  --card:    #fffef9;
  --green:   #2d7a4f;
  --red:     #a83232;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --max-w: 1100px;
  --gutter: 5vw;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── UTILITY ── */
.container   { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.label       { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); margin-bottom: .7rem; display: block; }
.rule-line   { border: none; border-top: 1px solid var(--rule); }
.text-muted  { color: var(--muted); }
.text-paper  { color: var(--paper); }

/* ── BUTTONS ── */
.btn {
  display: inline-block; text-decoration: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  letter-spacing: .03em; padding: .8rem 1.8rem; border-radius: 2px;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-amber  { background: var(--amber);  color: var(--white); }
.btn-amber:hover { background: #bf7020; }
.btn-dark   { background: var(--ink);   color: var(--paper); }
.btn-dark:hover  { background: var(--steel); }
.btn-ghost  { background: transparent; color: var(--muted); border: 1.5px solid var(--rule); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-outline-light { background: transparent; color: var(--paper); border: 1.5px solid rgba(255,255,255,.3); }
.btn-outline-light:hover { border-color: var(--amber); color: var(--amber); }

/* ── NAV ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--ink); height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  border-bottom: 2px solid var(--amber);
  overflow: visible;
}
.nav-brand {
  font-family: var(--font-mono); font-size: .88rem; font-weight: 600;
  color: var(--paper); letter-spacing: .08em; text-decoration: none;
  white-space: nowrap;
}
.nav-brand span { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; overflow: visible; }
.nav-links a {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: #bbb;
  text-decoration: none; transition: color .2s;
}
.nav-links a:hover  { color: var(--paper); }
.nav-links a.active { color: var(--amber); }
.nav-links .btn-nav {
  background: var(--amber); color: var(--white) !important;
  padding: .35rem 1rem; border-radius: 2px;
}
.nav-links .btn-nav:hover { background: #bf7020 !important; }
.nav-links .btn-nav-tools {
  background: transparent; color: var(--amber) !important;
  padding: .35rem 1rem; border-radius: 2px;
  border: 1.5px solid var(--amber);
  font-family: var(--font-mono); font-size: .72rem;
  font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.nav-links .btn-nav-tools:hover { background: var(--amber); color: var(--white) !important; }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.hamburger span { width: 24px; height: 2px; background: var(--paper); display: block; transition: .3s; }

/* ── PAGE WRAPPER ── */
.page-body { padding-top: 60px; }

/* ── HERO ── */
.hero {
  background: var(--ink); padding: 6rem var(--gutter) 5rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; top: -80px; right: -100px;
  width: 600px; height: 600px;
  border: 140px solid rgba(212,130,42,.05); border-radius: 50%;
  pointer-events: none;
}
.hero-tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--amber);
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem;
}
.hero-tag::before { content: ''; width: 30px; height: 1px; background: var(--amber); }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.08; color: var(--paper);
  max-width: 780px; margin-bottom: 1.6rem;
}
.hero h1 em { font-style: italic; color: var(--amber); }
.hero .hero-sub {
  color: #aaa; max-width: 560px; line-height: 1.8;
  font-size: 1.05rem; margin-bottom: 2.4rem;
  font-family: var(--font-body);
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── STATS BAR ── */
.stats-bar {
  background: var(--steel);
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--amber);
}
.stat-cell {
  padding: 1.8rem var(--gutter); text-align: center;
  border-right: 1px solid rgba(255,255,255,.12);
}
.stat-cell:last-child { border-right: none; }
.stat-num { font-family: var(--font-display); font-size: 2.4rem; color: var(--amber); display: block; }
.stat-lbl { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; color: #b8d0f0; text-transform: uppercase; }

/* ── SECTIONS ── */
.section       { padding: 5.5rem var(--gutter); }
.section-light { background: var(--card); }
.section-dark  { background: var(--ink); }
.section-steel { background: var(--steel); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.15; margin-bottom: 1rem;
}
.section-sub { color: var(--muted); max-width: 580px; line-height: 1.75; font-size: .97rem; }

/* ── CARDS ── */
.card {
  background: var(--card); border: 1px solid var(--rule);
  border-top: 3px solid var(--amber); padding: 2rem;
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: 0 14px 48px rgba(0,0,0,.09); transform: translateY(-3px); }
.card-badge {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .25rem .7rem; margin-bottom: 1rem;
  display: inline-block;
}
.badge-live   { background: var(--steel); color: #c8d8f0; }
.badge-soon   { background: #e8e2d6; color: var(--muted); }
.card h3 { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; margin-bottom: .7rem; }
.card p  { color: var(--muted); font-size: .9rem; line-height: 1.75; margin-bottom: 1.4rem; }
.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.price { font-family: var(--font-display); font-size: 1.6rem; color: var(--steel); }
.price-range { font-size: .75rem; color: var(--muted); font-family: var(--font-body); }

/* ── FEATURE GRID ── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.8rem; margin-top: 2.4rem; }
.feature { padding: 1.8rem; border-left: 3px solid var(--amber); background: var(--card); }
.feature .icon { font-size: 1.8rem; margin-bottom: .8rem; }
.feature h4 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: .5rem; }
.feature p  { color: var(--muted); font-size: .88rem; line-height: 1.7; }

/* ── CHECKLIST ── */
.checklist { list-style: none; }
.checklist li {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .9rem; color: var(--muted); padding: .3rem 0; line-height: 1.6;
}
.checklist li::before { content: '✓'; color: var(--amber); font-weight: 700; flex-shrink: 0; margin-top: .05rem; }

/* ── BLOG CARDS ── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.post-card { background: var(--card); border: 1px solid var(--rule); overflow: hidden; transition: box-shadow .2s; text-decoration: none; color: inherit; display: block; }
.post-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.08); }
.post-thumb { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.post-body  { padding: 1.4rem; }
.post-tag   { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: .5rem; display: block; }
.post-card h4 { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.3; margin-bottom: .5rem; }
.post-card p  { color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* ── FORMS ── */
.form-row { margin-bottom: 1.2rem; }
.form-row label { display: block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .4rem; color: var(--muted); }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%; padding: .8rem 1rem;
  background: var(--white); border: 1.5px solid var(--rule);
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  border-radius: 2px; outline: none; transition: border-color .2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--steel); }
.form-row textarea { resize: vertical; min-height: 110px; }

/* ── EMAIL STRIP ── */
.email-strip { background: var(--ink); padding: 4rem var(--gutter); }
.email-strip-inner { max-width: 560px; margin: 0 auto; text-align: center; }
.email-strip h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.4rem); color: var(--paper); margin-bottom: .8rem; }
.email-strip p  { color: #aaa; line-height: 1.75; margin-bottom: 1.8rem; }
.email-row { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.email-row input {
  flex: 1; min-width: 220px; padding: .8rem 1.2rem;
  background: #1e2330; border: 1.5px solid #3a3e4a;
  color: var(--paper); font-family: var(--font-body); font-size: .9rem;
  border-radius: 2px; outline: none;
}
.email-row input::placeholder { color: #666; }

/* ── FE TOOL specific ── */
.tool-bar-row { margin-bottom: 1rem; }
.tool-bar-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; }
.tool-bar-label-row label { font-size: .9rem; font-weight: 600; font-family: var(--font-body); }
.tool-bar-label-row .q-count { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.score-input {
  width: 72px; padding: .45rem .6rem; text-align: center;
  border: 1.5px solid var(--rule); background: var(--white);
  font-family: var(--font-mono); font-size: 1rem; font-weight: 600;
  border-radius: 2px; outline: none; transition: border-color .2s;
}
.score-input:focus { border-color: var(--steel); }
.bar-track {
  height: 10px; background: #e8e2d4; border-radius: 5px;
  overflow: hidden; position: relative; margin-top: .3rem;
}
.bar-fill { height: 100%; border-radius: 5px; transition: width .25s, background .25s; }
.bar-marker {
  position: absolute; top: -3px; bottom: -3px; width: 3px;
  background: var(--ink); opacity: .2; border-radius: 1px;
  pointer-events: none;
}
.section-divider {
  font-family: var(--font-mono); font-size: .65rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--amber);
  border-top: 1px solid var(--rule); padding-top: 1.2rem;
  margin: 1.6rem 0 .8rem;
}

/* Result panel */
.result-panel { background: var(--ink); color: var(--paper); padding: 2rem; border-left: 4px solid var(--amber); }
.result-panel.empty { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.result-empty { text-align: center; color: #444; }
.result-empty .icon { font-size: 2.2rem; margin-bottom: .6rem; }
.result-empty p { font-size: .88rem; line-height: 1.6; }
.result-verdict { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .4rem; }
.verdict-fail { color: #e07070; }
.result-summary { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; margin-bottom: 1.2rem; }
.priority-list { list-style: none; }
.priority-item { display: flex; align-items: flex-start; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: .88rem; line-height: 1.5; }
.priority-item:last-child { border-bottom: none; }
.p-badge { flex-shrink: 0; padding: .2rem .45rem; font-family: var(--font-mono); font-size: .6rem; font-weight: 600; letter-spacing: .06em; border-radius: 2px; width: 62px; text-align: center; }
.badge-critical { background: #5a1a1a; color: #e07070; }
.badge-focus    { background: #3d2e00; color: #d4a020; }
.badge-solid    { background: #0e3020; color: #5cb88a; }
.retake-box { margin-top: 1.2rem; padding: 1rem; background: rgba(255,255,255,.05); border-left: 3px solid var(--amber); }
.retake-box .lbl { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: .5rem; display: block; }
.retake-box p { font-size: .86rem; color: #ccc; line-height: 1.75; }
.cta-capture { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 1.2rem; margin-top: 1.4rem; }
.cta-capture p { font-size: .84rem; color: #bbb; line-height: 1.6; margin-bottom: .8rem; }
.cta-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.cta-email { flex: 1; min-width: 160px; padding: .5rem .8rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: var(--paper); font-family: var(--font-body); font-size: .88rem; border-radius: 2px; outline: none; }
.cta-email::placeholder { color: #666; }
.cta-btn { background: var(--amber); color: var(--white); border: none; padding: .5rem 1.1rem; font-size: .84rem; font-weight: 600; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.cta-btn:hover { background: #bf7020; }
.disclaimer { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); padding: 1rem 1.2rem; margin-top: 1.2rem; }
.disclaimer p { font-size: .74rem; color: #666; line-height: 1.6; }
.loading-bar { display: none; height: 3px; background: linear-gradient(90deg, var(--amber), var(--steel), var(--amber)); background-size: 200%; animation: shimmer 1.4s infinite; border-radius: 2px; margin-top: .8rem; }
@keyframes shimmer { 0%{background-position:200%} 100%{background-position:-200%} }

/* ── FOOTER ── */
.site-footer { background: var(--ink); border-top: 2px solid var(--amber); padding: 3.5rem var(--gutter) 2rem; color: #777; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 2.4rem; padding-bottom: 2.4rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-brand-col .nav-brand { display: block; margin-bottom: .7rem; font-size: .9rem; }
.footer-brand-col p { font-size: .84rem; line-height: 1.65; max-width: 240px; }
.footer-col h5 { font-family: var(--font-mono); font-size: .63rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin-bottom: .9rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { font-size: .85rem; color: #777; text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .74rem; }

/* ── PAGE HEADER (inner pages) ── */
.page-header { background: var(--ink); padding: 5rem var(--gutter) 4rem; border-bottom: 2px solid var(--amber); }
.page-header .label { margin-bottom: .6rem; }
.page-header h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4rem); color: var(--paper); line-height: 1.1; max-width: 760px; margin-bottom: 1rem; }
.page-header p  { color: #aaa; max-width: 580px; line-height: 1.8; font-size: 1rem; }

/* ── ABOUT PAGE ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-creds { background: var(--ink); color: var(--paper); padding: 2.4rem; border-left: 4px solid var(--amber); }
.about-creds h3 { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin-bottom: 1.2rem; }
.cred-row { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; font-size: .9rem; line-height: 1.5; }
.cred-row span:first-child { color: var(--amber); flex-shrink: 0; }

/* ── CONTACT PAGE ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; max-width: 900px; }

/* ── PRODUCT DETAIL ── */
.product-detail { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--amber); padding: 2.8rem; margin-bottom: 2rem; }
.product-detail-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem; }
.product-price-block .price { font-family: var(--font-display); font-size: 2.2rem; color: var(--steel); }
.product-price-block .format { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .07em; color: var(--muted); margin-top: .2rem; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.fade-up { animation: fadeUp .55s ease both; }
.fade-up:nth-child(2){animation-delay:.1s}
.fade-up:nth-child(3){animation-delay:.2s}
.fade-up:nth-child(4){animation-delay:.3s}

/* ── MOBILE ── */
@media(max-width:900px) {
  .footer-grid  { grid-template-columns: 1fr 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.4rem; }
}
@media(max-width:768px) {
  .nav-links  { display: none; flex-direction: column; position: fixed; top: 60px; left: 0; right: 0; background: var(--ink); padding: 1.6rem var(--gutter); gap: 1.2rem; border-bottom: 2px solid var(--amber); z-index: 199; }
  .nav-links.open { display: flex; }
  .hamburger  { display: flex; }
  .hero       { padding: 4rem var(--gutter) 3rem; }
  .stats-bar  { grid-template-columns: 1fr; }
  .stat-cell  { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); }
  .stat-cell:last-child { border-bottom: none; }
  .section    { padding: 4rem var(--gutter); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; }
  .product-detail-top { flex-direction: column; }
}
@media(max-width:520px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; }
}

/* ── NAV DROPDOWN ── */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: #bbb;
  padding: 0; transition: color .2s;
}
.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn { color: var(--amber); }
.nav-dropdown-menu {
  display: none;
  position: absolute; top: 60px; left: 0;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,.1); border-top: 2px solid var(--amber);
  min-width: 240px; list-style: none; z-index: 9999;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  padding: 0; margin: 0;
}
/* CSS-driven hover - works with no JS */
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
/* JS-driven toggle */
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu li { display: block; }
.nav-dropdown-menu li a {
  display: block; padding: .65rem 1.2rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em;
  text-transform: uppercase; color: #bbb; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.05); transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-dropdown-menu li a:hover { color: var(--paper); background: rgba(255,255,255,.04); }
.nav-dropdown-all a { color: var(--amber) !important; }
.nav-dropdown-all a:hover { color: var(--paper) !important; }
