/*
Theme Name: Qartix
Theme URI: https://qartix.com
Author: Qartix LLC
Description: Custom theme for Qartix LLC — Latin American market-entry and commercial expansion consulting.
Version: 1.0.0
Text Domain: qartix
*/

/* ---------------------------------------------------------------
   Design tokens
--------------------------------------------------------------- */
:root {
  --ink: #12181f;
  --navy: #0e1f33;
  --navy-2: #16324f;
  --paper: #faf8f4;
  --paper-2: #f2ede4;
  --line: #e4ddd0;
  --line-dark: rgba(255,255,255,0.14);
  --muted: #5b6673;
  --muted-on-dark: #aab6c4;
  --accent: #b5652f;
  --accent-2: #d98a4f;
  --white: #ffffff;

  --font-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1200px;
  --radius: 6px;
  --shadow: 0 20px 60px -20px rgba(14,31,51,0.25);
}

/* ---------------------------------------------------------------
   Reset / base
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--white);
  padding: 14px 20px; z-index: 10000; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------
   Layout helpers
--------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--paper2 { background: var(--paper-2); }
.section--white { background: var(--white); }
.grid { display: grid; gap: 32px; }
.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: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.center { text-align: center; }
.max-56 { max-width: 56ch; }
.max-64 { max-width: 64ch; }
.mx-auto { margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; }
.section--navy .eyebrow { color: var(--accent-2); }

h1.display { font-size: clamp(38px, 5.4vw, 68px); }
h2.display { font-size: clamp(30px, 3.6vw, 46px); }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); line-height: 1.55; }
.section--navy .lede { color: var(--muted-on-dark); }

/* ---------------------------------------------------------------
   Buttons
--------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; font-weight: 600; font-size: 15.5px;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost-dark { border-color: rgba(255,255,255,0.35); color: var(--white); }
.btn-ghost-dark:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.btn-ghost-light { border-color: var(--ink); color: var(--ink); }
.btn-ghost-light:hover { background: var(--ink); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---------------------------------------------------------------
   Utility bar
--------------------------------------------------------------- */
.utility-bar { background: var(--navy); color: var(--muted-on-dark); }
.utility-bar__row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 13px; }
.utility-bar a { display: inline-flex; align-items: center; gap: 8px; color: var(--white); font-weight: 500; }
.utility-bar svg { width: 15px; height: 15px; }
@media (max-width: 700px) { .utility-bar { display: none; } }

/* ---------------------------------------------------------------
   Header / nav
--------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,0.94); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 24px; }
.brand { display: flex; align-items: center; }
.brand-mark { height: 38px; width: auto; display: block; }
.brand:hover { opacity: .85; }

.primary-nav ul { display: flex; gap: 30px; align-items: center; }
.primary-nav a { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14.5px; letter-spacing: .01em; position: relative; padding: 4px 0; white-space: nowrap; }
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-cta-wrap { display: flex; align-items: center; gap: 20px; }
.nav-toggle { display: none; }
.primary-nav .btn-mobile-cta { display: none; }

/* Services dropdown */
.menu-item-has-children { position: relative; }
.chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; opacity: .65; }
.menu-item-has-children:hover .chev, .menu-item-has-children:focus-within .chev { transform: rotate(-135deg) translateY(1px); }
.dropdown-panel {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px);
  background: var(--white); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px; margin-top: 14px; width: 360px;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.menu-item-has-children:hover .dropdown-panel,
.menu-item-has-children:focus-within .dropdown-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
.dropdown-panel ul { display: flex; flex-direction: column; gap: 2px; }
.dropdown-panel a {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 7px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: normal;
}
.dropdown-panel a::after { display: none; }
.dropdown-panel a:hover { background: var(--paper-2); }
.dd-icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--navy);
  display: flex; align-items: center; justify-content: center; color: var(--white);
}
.dd-icon svg { width: 17px; height: 17px; }

@media (max-width: 1100px) {
  /* Widened from the general 900px breakpoint: with Home/Contact added to
     the menu, the full desktop nav no longer fits down to 1024px. */
  /* .site-header uses backdrop-filter, which creates a containing block for
     fixed descendants — so this positions relative to the header box, not
     the viewport. top:100%/height:100vh keeps it viewport-filling regardless. */
  .primary-nav { position: fixed; top: 100%; left: 0; right: 0; height: 100vh; background: var(--paper); transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; padding: 24px 28px 40px; }
  .primary-nav a { display: flex; width: 100%; padding: 16px 0; font-size: 20px; border-bottom: 1px solid var(--line); }
  .primary-nav .btn-mobile-cta { display: inline-flex; margin-top: 20px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; background: none; border: none; padding: 10px; cursor: pointer;
  }
  .nav-toggle span { width: 24px; height: 2px; background: var(--ink); display: block; transition: transform .2s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-cta-wrap .btn-primary { display: none; }

  /* Dropdown becomes a static, always-visible sub-list in the mobile flyout */
  .chev { display: none; }
  .dropdown-panel {
    position: static; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    box-shadow: none; border-radius: 0; width: auto; margin: 0 0 8px; padding: 0 0 0 16px;
  }
  .dropdown-panel a { padding: 12px 0; border-bottom: none; font-size: 15.5px; }
  .dd-icon { width: 28px; height: 28px; }
  .dd-icon svg { width: 14px; height: 14px; }
}

/* ---------------------------------------------------------------
   Hero
--------------------------------------------------------------- */
.hero {
  position: relative; color: var(--white); overflow: hidden;
  padding: clamp(90px, 15vw, 160px) 0 clamp(80px, 11vw, 120px);
  background-size: cover; background-position: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(9,20,34,0.92) 0%, rgba(9,20,34,0.82) 30%, rgba(9,20,34,0.42) 62%, rgba(9,20,34,0.15) 100%);
}
.hero__inner { position: relative; max-width: 640px; }
.hero p.lede { max-width: 52ch; color: rgba(255,255,255,0.82); }
.hero .accent-italic { color: var(--accent-2); font-style: italic; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-family: var(--font-display); font-size: 26px; }
.hero-stats div span { color: var(--muted-on-dark); font-size: 13.5px; }
.btn-arrow, .btn-play { display: inline-flex; }
.btn-play svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------
   Four-value strip (directly under hero)
--------------------------------------------------------------- */
.value-strip { background: var(--paper-2); padding: 56px 0; }
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.value-item { text-align: center; padding: 0 28px; position: relative; }
.value-item + .value-item::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line);
}
.value-icon {
  width: 66px; height: 66px; border-radius: 50%; background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.value-icon svg { width: 30px; height: 30px; }
.value-item h3 { font-size: 18px; margin-bottom: 8px; }
.value-item p { color: var(--muted); font-size: 14.5px; margin: 0; }
@media (max-width: 900px) {
  .value-grid { grid-template-columns: 1fr 1fr; gap: 40px 0; }
  .value-item + .value-item::before { display: none; }
}
@media (max-width: 560px) { .value-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------
   Cards
--------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; height: 100%;
}
.card--navy { background: var(--navy-2); border-color: rgba(255,255,255,0.1); color: var(--white); }
.card h3 { font-size: 21px; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }
.card .num { font-family: var(--font-display); font-size: 15px; color: var(--accent); font-weight: 700; margin-bottom: 14px; display: block; }
.card-link { font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--accent); }
.card-link:hover { text-decoration: underline; }

.contact-cards { display: grid; gap: 20px; }
.location-card { height: auto; padding: 28px; }
.location-card__sub { color: var(--muted); font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px; }
.contact-row { display: flex; align-items: flex-start; gap: 14px; }
.contact-row + .contact-row { margin-top: 14px; }
.contact-row p { margin: 0; line-height: 1.5; }
.contact-row a { font-weight: 600; }
.contact-icon {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--navy);
  display: flex; align-items: center; justify-content: center; color: var(--white); margin-top: 2px;
}
.contact-icon svg { width: 15px; height: 15px; }

.pillar {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 28px 0; border-top: 1px solid var(--line);
}
.pillar:last-child { border-bottom: 1px solid var(--line); }
.pillar .idx { font-family: var(--font-display); font-size: 15px; color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------
   Split / feature sections
--------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split-reverse { direction: rtl; } .split-reverse > * { direction: ltr; }

.stat-strip { display: flex; flex-wrap: wrap; gap: 48px; padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-strip div strong { display: block; font-family: var(--font-display); font-size: 32px; }
.stat-strip div span { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------
   Process steps
--------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 32px 0; border-top: 1px solid var(--line-dark); }
.section--navy .step { border-top-color: var(--line-dark); }
.section:not(.section--navy) .step { border-top-color: var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.section--navy .step:last-child { border-bottom-color: var(--line-dark); }
.step .step-num { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--accent-2); }
.step h3 { font-size: 20px; margin-bottom: 8px; }

/* ---------------------------------------------------------------
   Breadcrumb / page header
--------------------------------------------------------------- */
.page-hero { background: var(--navy); color: var(--white); padding: clamp(56px,8vw,96px) 0 clamp(40px,6vw,64px); }
.breadcrumb { font-size: 13px; color: var(--muted-on-dark); margin-bottom: 22px; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 8px; }

/* ---------------------------------------------------------------
   CTA band
--------------------------------------------------------------- */
.cta-band { background: var(--accent); color: var(--white); padding: clamp(56px,7vw,96px) 0; text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band .btn-ghost-dark { border-color: rgba(255,255,255,0.5); }

/* ---------------------------------------------------------------
   Forms
--------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 14px; }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 16px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.form-note { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.form-success, .form-error {
  padding: 18px 20px; border-radius: var(--radius); margin-bottom: 24px; font-weight: 600;
}
.form-success { background: #e7f3ea; color: #1c5e33; border: 1px solid #bfe3c8; }
.form-error { background: #fbe9e7; color: #8a2f22; border: 1px solid #f3c8c0; }

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.site-footer { background: var(--navy); color: var(--muted-on-dark); padding: 72px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; margin-bottom: 56px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { color: var(--white); }
.footer-col h4 { color: var(--white); font-family: var(--font-body); font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 28px; border-top: 1px solid var(--line-dark); font-size: 13px; }
.footer-bottom a:hover { color: var(--white); }
.footer-legal { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------------------------------------------------------------
   Insights / blog
--------------------------------------------------------------- */
.post-card { border-top: 1px solid var(--line); padding: 36px 0; display: grid; grid-template-columns: 1fr 3fr; gap: 32px; }
@media (max-width: 700px) { .post-card { grid-template-columns: 1fr; } }
.post-card time { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.post-card h2 { font-size: 24px; margin: 8px 0 10px; }
.post-card h2 a:hover { color: var(--accent); }
.article-body { font-size: 18px; }
.article-body h2 { font-size: 28px; margin-top: 1.6em; }
.article-body h3 { font-size: 21px; margin-top: 1.4em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.4em; list-style: revert; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-header { max-width: 74ch; margin: 0 auto; }
.article-wrap { max-width: 74ch; margin: 0 auto; }

/* ---------------------------------------------------------------
   404
--------------------------------------------------------------- */
.error-page { text-align: center; padding: clamp(80px,12vw,160px) 0; }

/* ---------------------------------------------------------------
   Utility
--------------------------------------------------------------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.section--navy .tag { border-color: var(--line-dark); color: var(--muted-on-dark); }
.divider { height: 1px; background: var(--line); border: none; margin: 0; }
.svc-block { scroll-margin-top: 110px; }
