/* ============================================
   Magnus Primora Konstrakta — Shared Stylesheet
   Primary  : #fcfcfc
   Secondary: #093b67
   Tertiary : #ffed99
   ============================================ */

:root {
  --primary: #fcfcfc;
  --secondary: #093b67;
  --tertiary: #ffed99;
  --text: #2b2f36;
  --text-light: #6b7280;
  --border: #e8e8e8;
  --surface: #ffffff;
  --alt: #f4f6f8;
  --heading: #093b67;
  --gold-text: #b89b2e;
  --header-bg: rgba(252, 252, 252, 0.95);
  --footer-bg: #06243f;
  --shadow: 0 10px 30px rgba(9, 59, 103, 0.08);
  --radius: 10px;
  --container: 1140px;
}

html[data-theme="dark"] {
  --primary: #0b1420;
  --text: #dbe2e9;
  --text-light: #9babbc;
  --border: #22303f;
  --surface: #121f2e;
  --alt: #0e1928;
  --heading: #eaf0f6;
  --gold-text: #ffed99;
  --header-bg: rgba(11, 20, 32, 0.92);
  --footer-bg: #081019;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', 'Segoe UI', sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.7;
  font-size: 16.5px;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* Generic gold eyebrow label */
.eyebrow {
  color: var(--gold-text);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 64px; width: auto; }

html[data-theme="dark"] .brand img {
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}

.nav { display: flex; gap: 36px; align-items: center; }

.nav a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--heading);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s, color 0.25s;
}

.nav a:hover { border-bottom-color: var(--tertiary); }
.nav a.active { border-bottom-color: var(--gold-text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 26px;
  color: var(--heading);
}

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

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
}

.theme-toggle:hover { background: var(--tertiary); color: #093b67; transform: rotate(15deg); }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  background: var(--secondary);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.45;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 680px;
  padding: 100px 0;
}

.hero-content .eyebrow {
  color: var(--tertiary);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-content h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 22px;
}

.hero-content p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 36px;
  max-width: 540px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.25s;
}

.btn-gold { background: var(--tertiary); color: var(--secondary); }
.btn-gold:hover { background: #fff; }

.btn-outline {
  border: 1.5px solid var(--heading);
  color: var(--heading);
}
.btn-outline:hover { background: var(--heading); color: var(--primary); }

.btn-light-outline {
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  margin-left: 12px;
}
.btn-light-outline:hover { background: #fff; color: var(--secondary); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--alt); transition: background 0.3s; }

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

.section-head .eyebrow {
  color: var(--gold-text);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--heading);
  font-weight: 600;
  line-height: 1.25;
}

.section-head p { margin-top: 14px; color: var(--text-light); }

/* ---------- Services grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 32px;
  transition: transform 0.25s, box-shadow 0.25s, background 0.3s;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.card .icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 22px;
}

.card h3 { color: var(--heading); font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.card p { color: var(--text-light); font-size: 15.5px; }

/* ---------- Works gallery ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.work-item:hover img { transform: scale(1.06); }

.work-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 59, 103, 0.85), transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.35s;
}

.work-item:hover .overlay { opacity: 1; }

.overlay h4 { color: #fff; font-size: 19px; font-weight: 600; }
.overlay span { color: var(--tertiary); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }

.work-item.wide { grid-column: span 2; aspect-ratio: auto; }

/* ---------- Stats strip ---------- */
.stats {
  background: var(--secondary);
  color: #fff;
  padding: 64px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat .num { font-size: 42px; font-weight: 600; color: var(--tertiary); }
.stat .label { font-size: 13.5px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.75); }

/* ---------- Two-column (about) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

.split h2 { font-size: clamp(26px, 3vw, 36px); color: var(--heading); font-weight: 600; margin-bottom: 18px; line-height: 1.3; }
.split p { color: var(--text-light); margin-bottom: 16px; }

.checklist li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 10px;
  color: var(--text);
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--gold-text);
  font-weight: 700;
}

/* ---------- Page banner (inner pages) ---------- */
.page-banner {
  background: var(--secondary);
  color: #fff;
  padding: 88px 0;
  position: relative;
  overflow: hidden;
}

.page-banner::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 40px solid rgba(255, 237, 153, 0.12);
}

.page-banner h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 600; }
.page-banner p { color: rgba(255,255,255,0.75); margin-top: 8px; max-width: 560px; }
.page-banner .crumb { color: var(--tertiary); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--secondary), #0d4f88);
  border-radius: var(--radius);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  flex-wrap: wrap;
}

.cta-band h3 { font-size: 26px; font-weight: 600; }
.cta-band p { color: rgba(255,255,255,0.8); margin-top: 6px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 56px;
}

.contact-info .info-item {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
}

.contact-info .icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.contact-info h4 { color: var(--heading); font-size: 16px; font-weight: 600; }
.contact-info p { color: var(--text-light); font-size: 15px; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  transition: background 0.3s;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 20px;
  background: var(--primary);
  transition: border-color 0.25s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold-text);
}

.contact-form input,
.contact-form textarea { color: var(--text); }

.contact-form button { border: none; cursor: pointer; width: 100%; }

/* ---------- Project detail ---------- */
.project-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 56px;
  transition: background 0.3s;
}

.project-meta h5 {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 4px;
  font-weight: 600;
}

.project-meta p { color: var(--text); font-size: 16px; font-weight: 500; }

.project-desc { max-width: 760px; margin-bottom: 56px; }
.project-desc h2 { color: var(--heading); font-size: clamp(24px, 3vw, 32px); font-weight: 600; margin-bottom: 14px; }
.project-desc p { color: var(--text-light); margin-bottom: 14px; }

.gallery-item { cursor: zoom-in; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 18, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 26px;
  font-size: 36px;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.lightbox .lb-caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,0.75);
  padding: 64px 0 0;
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-grid h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-grid h4::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--tertiary);
  margin-top: 8px;
}

.footer-brand img { height: 56px; background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 16px; }

.footer-links li { margin-bottom: 10px; }
.footer-links a:hover { color: var(--tertiary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
  text-align: center;
  font-size: 13.5px;
  color: rgba(255,255,255,0.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .works-grid { grid-template-columns: repeat(2, 1fr); }
  .project-meta { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .work-item.wide { grid-column: span 1; }
}

@media (max-width: 680px) {
  .container { padding: 0 18px; }

  .header-inner { height: 70px; }
  .brand img { height: 48px; }
  .theme-toggle { width: 36px; height: 36px; font-size: 15px; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 16px 24px; width: 100%; text-align: center; }
  .nav-toggle { display: block; }

  .hero { min-height: 70vh; }
  .hero-content { padding: 72px 0; }
  .hero-content p { font-size: 16.5px; }

  .grid-3, .works-grid { grid-template-columns: 1fr; }
  .project-meta { grid-template-columns: 1fr; gap: 16px; padding: 22px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 26px 20px; }
  .btn { width: 100%; text-align: center; }
  .btn-light-outline { margin-left: 0; margin-top: 12px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }
  .page-banner { padding: 56px 0; }
  .stats { padding: 48px 0; }
  .stat .num { font-size: 34px; }
  .cta-band { padding: 36px 22px; flex-direction: column; align-items: flex-start; text-align: left; }
  .split { gap: 28px; }

  /* Footer: stack into a single column so nothing gets cut off */
  .site-footer { padding: 48px 0 0; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 40px;
  }
  .footer-brand { grid-column: auto; }
  .footer-grid h4 { margin-bottom: 12px; }
  .footer-links li { overflow-wrap: break-word; }
  .footer-bottom { padding: 16px 18px; }
}
