:root {
  --sky-blue: #1cacce;
  --blue-grey: #3f4d61;
  --steel-teal: #5e7e82;
  --mariner-blue: #385b9c;
  --studio-purple: #6f459b;
  --gem-turquoise: #48c2c5;
  --violet-magenta: #a44b9c;
  --grandis-yellow: #ffcd66;

  --ink: #1b2430;
  --body-text: #4a5568;
  --bg-light: #f6f9fa;
  --bg-white: #ffffff;
  --border: #e3e9ec;
  --card-bg: #ffffff;
  --footer-bg: #12181f;

  --font-main: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1180px;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(31, 55, 71, 0.08);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #eef2f6;
  --body-text: #b7c2cc;
  --bg-light: #141a21;
  --bg-white: #0e1318;
  --border: #262f3a;
  --card-bg: #171f28;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { transition: background-color 0.2s ease, color 0.2s ease; }

/* ---------- Accessibility: skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--sky-blue);
  color: #fff;
  padding: 12px 20px;
  font-family: var(--font-main);
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--body-text);
  background: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-main);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue-grey);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}
.site-header .logo img { height: 40px; width: auto; }
.header-right { display: flex; align-items: center; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block;
  position: relative;
  padding: 28px 14px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: var(--font-main);
  white-space: nowrap;
}
.main-nav > ul > li:hover > a,
.main-nav > ul > li > a.active { color: var(--sky-blue); }
.main-nav > ul > li:hover > a > .nav-caret,
.main-nav > ul > li.dropdown-open > a > .nav-caret { transform: rotate(225deg); }

.main-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  min-width: 300px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 0;
  list-style: none;
  margin: 0;
}
.main-nav > ul > li:hover > .dropdown,
.main-nav .dropdown li.has-children:hover > .dropdown,
.main-nav > ul > li.dropdown-open > .dropdown,
.main-nav .dropdown li.has-children.dropdown-open > .dropdown { display: block; }
.main-nav .dropdown li a {
  display: block;
  position: relative;
  padding: 10px 20px;
  color: var(--ink);
  font-size: 0.88rem;
}
.main-nav .dropdown li a:hover { background: var(--bg-light); color: var(--sky-blue); }
.main-nav .dropdown li.has-children { position: relative; }
.main-nav .dropdown .dropdown { left: 100%; top: 0; }

/* Chevron indicating a nav item has a submenu. Top-level: inline, points
   down. Nested (desktop flyout): points right, since its submenu opens
   sideways rather than downward. Positioned absolutely (rather than via
   flexbox on the <li>) so it never becomes a layout sibling of the
   dropdown itself — that dropdown must stay a normal block box so it can
   switch between an absolutely-positioned desktop flyout and a static,
   full-width mobile accordion panel. */
.nav-caret {
  display: inline-block;
  position: absolute;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.75;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.main-nav > ul > li > a > .nav-caret {
  color: #fff;
  right: 6px;
  top: 50%;
  margin-top: -5px;
}
.main-nav .dropdown li.has-children > a > .nav-caret {
  right: 16px;
  top: 50%;
  color: var(--ink);
  transform: translateY(-50%) rotate(-45deg);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Header icons (search / theme toggle) ---------- */
.header-icons { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--sky-blue); color: var(--sky-blue); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .icon-moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: block; }

/* ---------- Search page ---------- */
.search-box { position: relative; max-width: 640px; }
.search-box input[type="search"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
}
.search-box input[type="search"]:focus { outline: 2px solid var(--sky-blue); outline-offset: 2px; }
.search-results { max-width: 760px; margin-top: 32px; }
.search-result-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.search-result-item:first-child { padding-top: 0; }
.search-result-item h3 { margin-bottom: 6px; }
.search-result-item h3 a:hover { color: var(--sky-blue); }
.search-result-item p { margin: 0; font-size: 0.92rem; }
.search-meta { color: var(--body-text); opacity: 0.75; font-size: 0.85rem; margin-top: 20px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--blue-grey) 0%, var(--steel-teal) 100%);
  color: #fff;
  padding: 90px 0 70px;
}
.hero.has-image {
  background-size: cover;
  background-position: center;
}
.hero h1 { color: #fff; }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sky-blue);
  margin-bottom: 12px;
  display: block;
}
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 640px; }

.hero.sm { padding: 60px 0; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-light); }
.section-head { max-width: 700px; margin: 0 auto 40px; text-align: center; }
.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sky-blue);
}

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 24px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.photo-gallery-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card-image {
  width: calc(100% + 56px);
  height: 180px;
  object-fit: cover;
  object-position: center;
  margin: -28px -28px 20px;
}
.card-image.portrait {
  height: 320px;
  object-position: top center;
}
.card-image.logo {
  width: 100%;
  height: 110px;
  object-fit: contain;
  object-position: center;
  margin: 0 0 20px;
  padding: 12px;
  box-sizing: border-box;
  background: #fff;
  border-radius: var(--radius);
}
.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sky-blue);
  background: rgba(28,172,206,0.1);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}

a.card-link { display: block; }
a.card-link .card { height: 100%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 13px 28px;
  border-radius: 100px;
  background: var(--sky-blue);
  color: #fff;
  border: 2px solid var(--sky-blue);
  cursor: pointer;
}
.btn:hover { background: #178aa5; border-color: #178aa5; }
.btn.outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn.outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn.dark { background: var(--blue-grey); border-color: var(--blue-grey); }

/* ---------- Stats ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 40px; }
.stat .num { font-family: var(--font-main); font-size: 2.4rem; font-weight: 700; color: var(--sky-blue); }
.stat .label { color: inherit; opacity: 0.75; font-size: 0.9rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 14px; }
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: var(--sky-blue); }

/* ---------- Timeline (Milestones) ---------- */
.timeline { border-left: 3px solid var(--sky-blue); padding-left: 28px; margin-top: 20px; }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sky-blue);
}
.timeline-item .year { font-family: var(--font-main); font-weight: 700; color: var(--ink); font-size: 1.1rem; }

/* ---------- Forms ---------- */
.contact-form { max-width: 640px; }
.contact-form .field { margin-bottom: 20px; }
.contact-form label { display: block; font-family: var(--font-main); font-weight: 600; font-size: 0.85rem; color: var(--ink); margin-bottom: 6px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--sky-blue); outline-offset: 2px; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form button[type="submit"] { border: 2px solid var(--sky-blue); cursor: pointer; }
.form-note { font-size: 0.85rem; color: var(--body-text); opacity: 0.75; margin-top: 12px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-main); color: var(--ink); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Post / article ---------- */
.post-meta { color: var(--steel-teal); font-size: 0.85rem; margin-bottom: 8px; }
.post-body { max-width: 760px; margin: 0 auto; }
.post-body img { border-radius: var(--radius); margin: 24px 0; }

/* ---------- Standalone feature image (product screenshots, portfolio shots) ---------- */
.feature-image-wrap { text-align: center; padding: 0 24px 48px; }
.feature-image {
  max-width: 720px;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.feature-image.wide { max-width: 900px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,0.7); padding: 60px 0 24px; }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 16px; }
.site-footer a:hover { color: var(--sky-blue); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; font-size: 0.9rem; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.social-links { display: flex; gap: 14px; }
.social-links a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.social-links a:hover { border-color: var(--sky-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: var(--blue-grey);
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; padding: 12px 0; }
  .main-nav > ul > li > a { padding: 14px 24px; }
  .main-nav .dropdown { position: static; display: none !important; box-shadow: none; border-radius: 0; background: rgba(0,0,0,0.15); }
  .main-nav > ul > li.nav-open > .dropdown,
  .main-nav .dropdown li.has-children.nav-open > .dropdown { display: block !important; }
  .main-nav .dropdown li a { color: #fff; }
  .main-nav .dropdown li a:hover { background: rgba(255,255,255,0.08); color: var(--sky-blue); }
  .main-nav .dropdown .dropdown { left: 0; }
  /* On mobile every submenu is a tap-to-expand accordion (no flyouts), so
     nested carets point down like top-level ones, and flip when open. */
  .main-nav .dropdown li.has-children > a > .nav-caret { color: #fff; transform: translateY(-50%) rotate(45deg); }
  .main-nav > ul > li.nav-open > a > .nav-caret { transform: rotate(225deg); }
  .main-nav .dropdown li.has-children.nav-open > a > .nav-caret { transform: translateY(-50%) rotate(225deg); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid.photo-gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .photo-gallery-img { height: 130px; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { gap: 24px; }
}
