/* ===========================================================
   KEYSTONE ENERGY SERVICES — Design System
   =========================================================== */

:root {
  --navy: #182241;
  --navy-light: #263457;
  --slate: #536C7C;
  --slate-light: #7c94a2;
  --cream: #FFF5D9;
  --cream-soft: #FFFBF0;
  --amber: #C97A2B;
  --amber-dark: #A75F1C;
  --white: #ffffff;
  --ink: #182241;
  --ink-soft: #4a5468;
  --border: #e3ddc8;
  --success: #2e7d4f;
  --danger: #b3372c;

  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-logo: 'Archivo Black', 'Arial Black', sans-serif;
  --brand-blue: #4EA6D8;

  --container: 1200px;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(24,34,65,0.08);
  --shadow-md: 0 8px 24px rgba(24,34,65,0.10);
  --shadow-lg: 0 20px 48px rgba(24,34,65,0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.4rem; letter-spacing: 0.01em; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--slate); text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }
@media (max-width: 768px) { section { padding: 56px 0; } }

.section-cream { background: var(--cream); }
.section-navy { background: var(--navy); color: var(--cream); }
.section-navy h2, .section-navy h3, .section-navy h4 { color: var(--white); }
.section-navy p { color: #c7cede; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--amber);
  display: inline-block;
}

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 15px 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--white); }
.btn-primary:hover { background: var(--amber-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: currentColor; color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.6); color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  color: var(--navy);
  font-family: var(--font-display);
}
.brand-text { line-height: 1; }
.brand-text .k1 {
  display: block;
  font-family: var(--font-logo);
  font-size: 2.5rem;
  color: var(--brand-blue);
  letter-spacing: -0.01em;
}
.brand-text .k2 {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-top: 1px;
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--navy);
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.main-nav a:hover { color: var(--amber); }
.main-nav a.active { color: var(--amber); }
.header-cta { display: flex; align-items: center; gap: 14px; margin-left: 12px; }
.header-phone { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 0.92rem; white-space: nowrap; }
.header-phone svg { flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); display: block; transition: all 0.2s; }

@media (max-width: 980px) {
  .main-nav { position: fixed; top: 84px; left: 0; right: 0; height: calc(100vh - 84px); background: var(--white);
    flex-direction: column; align-items: stretch; padding: 20px 24px; gap: 2px;
    transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { padding: 14px 4px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(120deg, var(--navy) 0%, #1f2c52 55%, var(--navy) 100%);
  color: var(--white);
  overflow: hidden;
  padding: 110px 0 100px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 90px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -10%; top: -20%;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(201,122,43,0.16) 0%, rgba(201,122,43,0) 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero .eyebrow { color: #f0b072; }
.hero .eyebrow::before { background: #f0b072; }
.hero h1 { color: var(--white); margin-bottom: 0.4em; }
.hero p.lead { color: #dde3f0; font-size: 1.2rem; max-width: 620px; }
.hero-actions { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.hero-stats {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,0.14);
  margin-top: 64px; border-radius: var(--radius); overflow: hidden;
}
.hero-stats .stat { background: rgba(255,255,255,0.05); padding: 24px 20px; }
.hero-stats .num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--white); display:block; }
.hero-stats .label { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: #b9c2d6; }
@media (max-width: 768px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

.page-hero {
  background: linear-gradient(120deg, var(--navy), #24325c);
  color: var(--white);
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute; right: -8%; top: -40%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(201,122,43,0.18), transparent 70%);
}
.page-hero .breadcrumb { position: relative; z-index: 2; font-size: 0.85rem; color: #b9c2d6; margin-bottom: 14px; }
.page-hero .breadcrumb a { color: #dfe4ef; }
.page-hero h1 { position: relative; z-index: 2; color: var(--white); margin-bottom: 0.3em; }
.page-hero p { position: relative; z-index: 2; color: #dde3f0; max-width: 640px; font-size: 1.08rem; }

/* ===== Cards / Grids ===== */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border-radius: 10px;
  color: var(--amber); margin-bottom: 18px;
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.card p { margin-bottom: 0; font-size: 0.96rem; }
.card a.card-link { font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.card a.card-link:hover { color: var(--amber); }

.value-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--amber);
}

/* Service list styling (checklist) */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; color: var(--ink); font-weight: 600; }
.check-list li svg { flex-shrink: 0; margin-top: 3px; color: var(--amber); }

/* Split section */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split-sidebar { grid-template-columns: 1fr 340px; align-items: start; }
@media (max-width: 900px) { .split, .split-sidebar { grid-template-columns: 1fr; gap: 40px; } }
.media-block {
  background: var(--navy);
  border-radius: var(--radius);
  min-height: 360px;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.media-block svg { width: 70%; height: 70%; opacity: 0.9; }
.media-block img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Photo banner used to break up long service/safety sections */
.photo-banner { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin: 8px 0 40px; }
.photo-banner img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.photo-banner.video-banner { margin-bottom: 0; }
.photo-banner video { width: 100%; max-height: 480px; object-fit: cover; display: block; background: var(--navy); }
.video-caption {
  background: var(--navy);
  color: #c7cede;
  font-size: 0.85rem;
  margin: 0;
  padding: 12px 18px;
  text-align: center;
}

/* Project / gallery cards with photography */
.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project-card .project-photo { width: 100%; height: 210px; object-fit: cover; display: block; }
.project-card .project-body { padding: 24px 26px; }
.project-card .project-body p { margin-bottom: 0; font-size: 0.96rem; }

/* Anchor service sections */
.service-anchor-nav {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 56px;
}
.service-anchor-nav a {
  background: var(--white); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.service-anchor-nav a:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.service-detail {
  display: grid; grid-template-columns: 90px 1fr; gap: 28px;
  padding: 40px 0; border-top: 1px solid var(--border);
}
.service-detail:first-of-type { border-top: none; }
.service-detail .num { font-family: var(--font-display); font-size: 2.6rem; color: var(--cream); font-weight: 700;
  -webkit-text-stroke: 1.5px var(--amber); color: transparent; }
@media (max-width: 700px) { .service-detail { grid-template-columns: 1fr; gap: 10px; } }

/* CTA band */
.cta-band {
  background: var(--amber);
  color: var(--white);
  text-align: center;
  padding: 64px 0;
}
.cta-band h2 { color: var(--white); margin-bottom: 12px; }
.cta-band p { color: #fff3e6; font-size: 1.1rem; }
.cta-band .btn-navy:hover { background: #0f1730; }

/* Timeline / process steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step .step-num {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy); font-size: 0.85rem; }

/* ===== Forms ===== */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 44px;
  border: 1px solid var(--border);
}
@media (max-width: 600px) { .form-card { padding: 28px 20px; } }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; color: var(--navy); }
.field .req { color: var(--amber); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--cream-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px rgba(83,108,124,0.18);
}
.field small { display: block; color: var(--ink-soft); font-size: 0.8rem; margin-top: 6px; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field .error-msg { display: none; color: var(--danger); font-size: 0.8rem; margin-top: 6px; font-weight: 700; }
.field.error .error-msg { display: block; }

fieldset { border: none; padding: 0; margin: 0 0 28px; }
legend { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy);
  font-size: 1.05rem; font-weight: 700; padding: 0 0 6px; border-bottom: 2px solid var(--cream); width: 100%; margin-bottom: 20px; }

/* File Dropzone */
.dropzone {
  border: 2px dashed var(--slate-light);
  border-radius: var(--radius);
  background: var(--cream-soft);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dragover { border-color: var(--amber); background: #fff2e0; }
.dropzone svg { color: var(--slate); margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 0.85rem; color: var(--ink-soft); }
.dropzone input[type="file"] { display: none; }

.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--cream-soft); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius); font-size: 0.9rem;
}
.file-list .file-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-list .file-info svg { flex-shrink: 0; color: var(--slate); }
.file-list .file-name { font-weight: 700; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .file-size { color: var(--ink-soft); flex-shrink: 0; }
.file-list .file-remove {
  background: none; border: none; cursor: pointer; color: var(--danger); font-size: 1.1rem; line-height: 1; flex-shrink: 0;
}

.form-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--cream); border-radius: var(--radius);
  padding: 16px 18px; font-size: 0.88rem; color: var(--navy); margin-bottom: 24px;
}
.form-note svg { flex-shrink: 0; color: var(--amber); margin-top: 2px; }

.form-status { margin-top: 20px; padding: 14px 18px; border-radius: var(--radius); font-weight: 700; display: none; }
.form-status.show { display: block; }
.form-status.success { background: #e5f4ea; color: var(--success); }
.form-status.error { background: #fbe9e7; color: var(--danger); }

/* Honeypot — off-screen rather than display:none so naive bots still fill it */
.hp-wrap {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0;
}

.turnstile-wrap { margin-bottom: 20px; }
.turnstile-wrap .error-msg { display: none; color: var(--danger); font-size: 0.8rem; margin-top: 6px; font-weight: 700; }
.turnstile-wrap.error .error-msg { display: block; }

.form-success { text-align: center; padding: 12px 0; }
.form-success svg { color: var(--success); margin-bottom: 12px; }
.form-success h2 { margin-bottom: 10px; }
.form-success .ref-label {
  margin: 24px 0 6px; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
}
.form-success .ref-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
  background: var(--cream); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 20px; word-break: break-all;
}
.form-success .btn { margin-top: 8px; }

/* Sidebar (contact/bid pages) */
.contact-info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.contact-info-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-info-list .icon { width: 44px; height: 44px; border-radius: 8px; background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info-list .icon svg { width: 20px; height: 20px; }
.contact-info-list h4 { margin-bottom: 4px; }
.contact-info-list p { margin: 0; font-size: 0.94rem; }

/* Memberships / affiliations logo row */
.memberships-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 36px 48px;
}
.memberships-row .logo-mono {
  height: 38px;
  width: auto;
  opacity: 0.95;
}
.memberships-row .badge-card {
  background: var(--white);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.memberships-row .badge-card img { height: 44px; width: auto; display: block; }
@media (max-width: 700px) {
  .memberships-row { gap: 26px 32px; }
  .memberships-row .logo-mono { height: 30px; }
  .memberships-row .badge-card img { height: 36px; }
}

/* Badges / memberships */
.badge-row { display: flex; flex-wrap: wrap; gap: 14px; }
.badge-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: var(--navy);
}
.badge-pill svg { color: var(--amber); }

/* Footer */
.site-footer { background: var(--navy); color: #c7cede; padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.12); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-size: 0.95rem; letter-spacing: 0.06em; margin-bottom: 18px; }
.site-footer .brand { color: var(--white); margin-bottom: 16px; }
.site-footer .brand-text .k2 { color: #c7cede; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: #c7cede; font-size: 0.94rem; }
.footer-links a:hover { color: var(--amber); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0; font-size: 0.82rem; color: #93a0bd; flex-wrap: wrap; gap: 10px;
}
.footer-bottom a { color: #93a0bd; }

/* Utilities */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.small { font-size: 0.85rem; }
.tag { display: inline-block; background: var(--cream); color: var(--navy); font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 12px; border-radius: 999px; margin-bottom: 10px; }
