/* ==========================================================================
   Trespolaris — Design System
   Plain CSS, no build step, no external font/icon dependencies.
   ========================================================================== */

:root {
  /* Brand palette */
  --navy-950: #0a1626;
  --navy-900: #0f2138;
  --navy-800: #15304c;
  --navy-700: #1c4162;
  --navy-600: #275580;
  --amber-400: #e3ac52;
  --amber-500: #d59a3a;
  --amber-600: #b9812a;

  /* Neutrals */
  --white: #ffffff;
  --slate-50: #f6f8fa;
  --slate-100: #edf1f4;
  --slate-200: #dde3e9;
  --slate-300: #c3ccd5;
  --slate-400: #93a0ac;
  --slate-500: #6b7885;
  --slate-600: #4c5866;
  --slate-700: #37424e;
  --slate-800: #232b34;
  --slate-900: #171d24;

  /* Semantic */
  --bg: var(--white);
  --bg-alt: var(--slate-50);
  --text: var(--slate-800);
  --text-muted: var(--slate-500);
  --border: var(--slate-200);
  --brand: var(--navy-900);
  --brand-strong: var(--navy-950);
  --accent: var(--amber-500);
  --accent-strong: var(--amber-600);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;

  /* Layout */
  --container: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 33, 56, 0.06), 0 1px 1px rgba(15, 33, 56, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 33, 56, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 33, 56, 0.16);
  --transition: 180ms ease;
}

/* ---------------------------------- Reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

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

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

/* ------------------------------- Typography -------------------------------- */
h1, h2, h3, h4 { color: var(--brand-strong); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.12; }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.18; }
h3 { font-size: 1.3rem; line-height: 1.3; }
h4 { font-size: 1.05rem; line-height: 1.35; }
.lede { font-size: 1.15rem; color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

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

/* --------------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--navy-950); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-dark { background: var(--brand-strong); color: var(--white); }
.btn-dark:hover { background: var(--navy-800); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.btn-outline-dark { background: transparent; color: var(--brand-strong); border-color: var(--slate-300); }
.btn-outline-dark:hover { border-color: var(--brand-strong); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* ---------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--brand-strong); }
.brand .logo-mark { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 500; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate-600);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand-strong); background: var(--slate-100); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  align-items: center;
  justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand-strong);
  position: relative;
  transition: transform var(--transition);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 76px 0 0 0; background: var(--white); flex-direction: column; align-items: stretch; padding: 12px; gap: 4px; display: none; overflow-y: auto; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 1rem; }
  .nav-toggle { display: flex; }
  .header-actions .btn-dark { display: none; }
}

/* ---------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  background: radial-gradient(1100px 520px at 85% -10%, rgba(213, 154, 58, 0.18), transparent 60%), var(--brand-strong);
  color: var(--white);
  overflow: hidden;
}
.hero .container { padding-top: 96px; padding-bottom: 96px; position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { color: var(--white); }
.hero .lede { color: rgba(255,255,255,0.72); max-width: 46ch; margin-top: 18px; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.14); }
.hero-stats .stat-num { font-size: 1.7rem; font-weight: 800; color: var(--accent); }
.hero-stats .stat-label { font-size: 0.82rem; color: rgba(255,255,255,0.65); margin-top: 4px; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* Page header (non-home hero) */
.page-header {
  background: var(--brand-strong);
  color: var(--white);
  padding: 64px 0 56px;
}
.page-header .eyebrow { color: var(--accent); }
.page-header h1 { color: var(--white); }
.page-header p { color: rgba(255,255,255,0.72); margin-top: 14px; max-width: 60ch; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.55); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--white); }

/* --------------------------------- Cards ---------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--slate-300); }

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
  margin-bottom: 20px;
}
.icon-badge svg { width: 24px; height: 24px; }

.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Services list */
.service-card ul { margin-top: 16px; display: grid; gap: 8px; }
.service-card li { display: flex; gap: 10px; font-size: 0.92rem; color: var(--text-muted); }
.service-card li::before { content: ""; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.kbli-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy-700);
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  margin: 3px 6px 3px 0;
}

/* ------------------------------- Alt sections ------------------------------ */
.section-alt { background: var(--bg-alt); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 40px 0; }
.stat-strip .stat-num { font-size: 2rem; font-weight: 800; color: var(--brand-strong); }
.stat-strip .stat-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
@media (max-width: 768px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }

.timeline { border-left: 2px solid var(--border); padding-left: 28px; display: grid; gap: 28px; }
.timeline .item { position: relative; }
.timeline .item::before { content: ""; position: absolute; left: -33px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* -------------------------------- Portfolio -------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--slate-400); color: var(--text); }
.filter-btn.active { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--white); }

.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 980px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .portfolio-grid { grid-template-columns: 1fr; } }

.portfolio-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
  transition: box-shadow var(--transition), transform var(--transition);
}
.portfolio-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.portfolio-card .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--slate-100); }
.portfolio-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.portfolio-card:hover .thumb img { transform: scale(1.05); }
.portfolio-card .body { padding: 20px; }
.portfolio-card .cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.portfolio-card h3 { margin-top: 8px; font-size: 1.08rem; }
.portfolio-card .meta { margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Portfolio detail */
.detail-hero { position: relative; }
.detail-hero .thumb { aspect-ratio: 21/9; overflow: hidden; border-radius: var(--radius-lg); background: var(--slate-100); }
.detail-hero .thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 32px; padding: 24px; background: var(--bg-alt); border-radius: var(--radius-lg); }
.detail-meta .label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.detail-meta .value { font-weight: 700; color: var(--brand-strong); margin-top: 4px; }
@media (max-width: 768px) { .detail-meta { grid-template-columns: repeat(2, 1fr); } }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.gallery button { border: none; padding: 0; background: none; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4/3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.gallery button:hover img { transform: scale(1.04); }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

.lightbox {
  position: fixed; inset: 0; background: rgba(10, 22, 38, 0.92);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 82vh; border-radius: var(--radius-md); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.1); color: var(--white);
  border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* --------------------------------- Forms ----------------------------------- */
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--slate-700); }
.field input, .field textarea, .field select {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(39, 85, 128, 0.15);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 14px; }
.form-status { display: none; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.92rem; margin-bottom: 20px; }
.form-status.success { display: block; background: #eaf6ee; color: #1f7a3d; border: 1px solid #cdeada; }
.form-status.error { display: block; background: #fdecec; color: #b3261e; border: 1px solid #f6c9c6; }

.contact-info-card { background: var(--brand-strong); color: var(--white); border-radius: var(--radius-lg); padding: 36px; }
.contact-info-card h3 { color: var(--white); }
.contact-info-row { display: flex; gap: 14px; margin-top: 22px; align-items: flex-start; }
.contact-info-row .icon-badge { background: rgba(255,255,255,0.1); color: var(--accent); margin-bottom: 0; flex-shrink: 0; }
.contact-info-row .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }
.contact-info-row .value { font-weight: 600; margin-top: 2px; }

/* --------------------------------- CTA band --------------------------------- */
.cta-band {
  background: var(--brand-strong);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--white); margin-bottom: 8px; }
.cta-band p { color: rgba(255,255,255,0.7); }

/* ---------------------------------- Footer ---------------------------------- */
.site-footer { background: var(--slate-900); color: var(--slate-300); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer .brand { color: var(--white); }
.site-footer .brand small { color: var(--slate-400); }
.footer-desc { margin-top: 16px; color: var(--slate-400); font-size: 0.92rem; max-width: 34ch; }
.footer-col h4 { color: var(--white); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 18px; }
.footer-col ul { display: grid; gap: 11px; }
.footer-col a { font-size: 0.92rem; color: var(--slate-300); transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-kbli { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.footer-kbli span { font-size: 0.72rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--slate-300); padding: 3px 9px; border-radius: 999px; }
.footer-bottom { margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--slate-500); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* --------------------------------- Utilities --------------------------------- */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--slate-100); color: var(--slate-600); font-size: 0.82rem; font-weight: 600; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 560ms ease, transform 560ms ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand-strong); color: var(--white); padding: 10px 16px; z-index: 2000; }
.skip-link:focus { left: 12px; top: 12px; }
