/* ==========================================================================
   Cadline Limited — site styles
   Palette: brand red (logo swoosh), graphite, blueprint blue accent
   ========================================================================== */

:root {
  --red: #c0272d;
  --red-dark: #961f24;
  --red-tint: #fdf1f1;
  --ink: #14181d;
  --ink-soft: #2b323b;
  --body: #4a545f;
  --muted: #7c8894;
  --line: #e2e6ea;
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --blueprint: #1b3a5c;

  --wrap: 1160px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 29, .06), 0 2px 8px rgba(20, 24, 29, .05);
  --shadow-md: 0 10px 30px rgba(20, 24, 29, .10);

  --ff-head: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--ff-head);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -.015em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1.1em; }

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

.section { padding: 84px 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: 56px 0; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .8rem;
}

.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.05rem; color: var(--body); margin-bottom: 0; }

.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 13px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn--outline:hover { border-color: var(--red); color: var(--red); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar {
  background: var(--ink);
  color: #c3ccd6;
  font-size: .84rem;
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; min-height: 40px; flex-wrap: wrap;
}
.topbar a { color: #eef2f6; }
.topbar-contact { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar-tag { color: #8c98a5; }

.nav { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 24px; }

.logo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  text-decoration: none !important;
}
.logo:hover { text-decoration: none; }
/* The supplied artwork already carries the "CADLINE LTD." wordmark, so the
   lockup is the logo image plus the tagline — no repeated text. */
.logo-mark { display: block; width: 152px; height: auto; flex: none; }
.logo-sub {
  display: block; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-top: 5px; padding-left: 2px;
}
.site-footer .logo-mark { width: 168px; }
.site-footer .logo-sub { color: #8794a1; }

@media (max-width: 420px) {
  .logo-mark { width: 124px; }
  .logo-sub { font-size: .58rem; letter-spacing: .1em; }
}

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 10px 14px; border-radius: 6px;
  color: var(--ink-soft); font-weight: 500; font-size: .97rem;
  text-decoration: none !important;
}
.nav-links a:hover { background: var(--bg-alt); color: var(--ink); }
.nav-links a.is-active { color: var(--red); font-weight: 600; }
.nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(115deg, #10151b 0%, #1b2a3a 55%, #24384c 100%);
  color: #dfe6ed;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -140px; top: -180px;
  background: radial-gradient(circle, rgba(192,39,45,.35), transparent 65%);
  border-radius: 50%;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-inner { padding: 104px 0 96px; max-width: 760px; }
.hero h1 { color: #fff; }
.hero h1 .accent { color: #ff6a6f; }
.hero p { font-size: 1.18rem; color: #c5cfda; max-width: 620px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.hero-badges {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px;
}
.badge {
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); color: #e6edf4;
}

.page-hero {
  background: linear-gradient(115deg, #10151b 0%, #1b2a3a 100%);
  color: #c9d3de; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 90% at 80% 20%, #000 20%, transparent 72%);
}
.page-hero .wrap { position: relative; z-index: 1; padding-top: 66px; padding-bottom: 66px; }
.page-hero h1 { color: #fff; margin-bottom: .35em; }
.page-hero p { max-width: 640px; margin: 0; color: #b9c5d2; }
.crumbs { font-size: .85rem; color: #8fa0b1; margin-bottom: 14px; }
.crumbs a { color: #cfd9e4; }
.crumbs span { padding: 0 6px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: #fff; padding: 30px 24px; text-align: center; }
.stat-num { font-size: 2.4rem; font-weight: 700; color: var(--ink); line-height: 1; font-family: var(--ff-head); }
.stat-num .plus { color: var(--red); }
.stat-label { font-size: .86rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-top: 8px; font-weight: 600; }

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

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #d4dae0; }
.card h3 { margin-bottom: .5rem; }
.card p { margin-bottom: 0; font-size: .98rem; }
.card ul { margin: .8rem 0 0; padding-left: 1.1rem; font-size: .95rem; }
.card ul li { margin-bottom: .35rem; }

.card-icon {
  width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center;
  background: var(--red-tint); color: var(--red); margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }

.card--link { display: block; color: inherit; text-decoration: none !important; }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px; align-items: center; }
.split-visual {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--blueprint); box-shadow: var(--shadow-md);
}
.split-visual svg { width: 100%; height: auto; display: block; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--red-tint);
  box-shadow: inset 0 0 0 1.5px rgba(192,39,45,.35);
}
.checklist li::after {
  content: ""; position: absolute; left: 5.5px; top: .78em;
  width: 7px; height: 4px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red);
  transform: rotate(-45deg);
}

/* ---------- Project tables ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: all .16s ease; font-family: inherit;
}
.filter-btn:hover { border-color: var(--red); color: var(--red); }
.filter-btn.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.search-input {
  flex: 1 1 260px; max-width: 340px; padding: 11px 14px; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff;
}
.search-input:focus { outline: 2px solid rgba(192,39,45,.35); outline-offset: 1px; border-color: var(--red); }
.result-count { font-size: .9rem; color: var(--muted); }

.table-block { margin-bottom: 52px; }
.table-block h3 {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em;
  padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 0;
}
.table-block h3 .count { font-size: .8rem; color: var(--muted); letter-spacing: .04em; font-weight: 600; text-transform: none; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.projects { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
table.projects th {
  text-align: left; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
table.projects td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.projects tbody tr:hover { background: var(--bg-alt); }
table.projects td:first-child { color: var(--muted); width: 52px; font-variant-numeric: tabular-nums; }
table.projects .client { color: var(--ink); font-weight: 600; }

.pill {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: #e8f5ec; color: #1c7a3e; white-space: nowrap;
}

.empty-state { padding: 40px 0; color: var(--muted); text-align: center; display: none; }

/* ---------- Client logo wall ---------- */
.client-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.client-wall div {
  background: #fff; padding: 22px 18px; font-size: .92rem; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 84px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(100deg, var(--red-dark), var(--red));
  color: #fff; border-radius: var(--radius); padding: 52px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { color: rgba(255,255,255,.9); margin: 0; max-width: 560px; }
.cta-band .btn--primary { background: #fff; color: var(--red-dark); }
.cta-band .btn--primary:hover { background: #f4f4f4; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.info-list li:first-child { padding-top: 0; }
.info-ico {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: var(--red-tint); color: var(--red);
}
.info-ico svg { width: 20px; height: 20px; }
.info-list strong { display: block; color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.info-list span, .info-list a { font-size: 1rem; color: var(--body); }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: .97rem; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(192,39,45,.3); outline-offset: 1px; border-color: var(--red);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-note { font-size: .85rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- Form validation & submission states ---------- */
.req { color: var(--red); }

.error-text { display: none; font-size: .82rem; color: var(--red); margin: 6px 0 0; font-weight: 500; }
.field.has-error .error-text { display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--red); background: #fffafa; }

.form-alert {
  display: none;
  padding: 13px 16px; border-radius: 6px; margin-bottom: 20px;
  font-size: .92rem; line-height: 1.5;
}
.form-alert.is-on { display: block; }
/* focus-visible only: moving focus here programmatically must not paint a red
   ring around a success message */
.form-alert:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.form-alert--error { background: #fdecec; color: #8f1d22; border: 1px solid #f3c9cb; }
.form-alert--ok { background: #e8f5ec; color: #176834; border: 1px solid #bfe3cb; }

.btn[disabled] { opacity: .7; cursor: not-allowed; transform: none; }

.spinner {
  display: none; width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  border-radius: 50%; animation: btnSpin .7s linear infinite;
}
.is-sending .spinner { display: block; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Honeypot: off-screen, never shown to a person, never focusable. */
.hp-field {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { display: block; width: 100%; height: 340px; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #96a3b0; padding: 64px 0 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: .84rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 18px; }
.site-footer a { color: #b3bfca; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-brand p { max-width: 340px; font-size: .95rem; margin-top: 18px; }
.footer-brand svg { height: 30px; width: auto; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .88rem;
}

/* ---------- Reveal on scroll ----------
   Content is visible by default. The hidden state is scoped to .js, which the
   inline script in <head> sets, so no-JS visitors, crawlers and any browser
   where IntersectionObserver never fires still see everything. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 24px 20px; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 13px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-cta { margin: 14px 0 0; }
  .nav-cta .btn { width: 100%; justify-content: center; }
  .site-header .nav { position: relative; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .hero-inner { padding: 72px 0 64px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 28px; }
  .field-row { grid-template-columns: 1fr; }
  .topbar .wrap { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
  .topbar-tag { display: none; }
  .card { padding: 24px 22px; }
  .form-card { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
}
