/* ============================================================
   QUADRACONIS — corporate, geometric, disciplined.
   ============================================================ */

:root {
  /* Corporate palette */
  --navy: #17375E;
  --structural: #2F6690;
  --steel: #6E93B5;
  --carbon: #1C2733;
  --slate: #657481;
  --cloud: #EEF3F7;
  --white: #FFFFFF;
  --hairline: #D9E2EA;

  /* Departmental (accents only) */
  --admin: #23804A;
  --ops: #D88A24;
  --pr: #2879C8;
  --tech: #D53A35;

  --font-display: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", -apple-system, sans-serif;

  --chamfer: 18px;
  --maxw: 1160px;
  --ease-out: cubic-bezier(.2,.7,.3,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--carbon);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 10px 18px; z-index: 100;
}
.skip-link:focus { left: 0; }

h1, h2, h3 { font-family: var(--font-display); color: var(--navy); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: 0.01em; }
h3 { font-weight: 600; }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--structural); outline-offset: 3px;
}

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s linear;
}
.site-header.is-scrolled { border-bottom-color: var(--hairline); }

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

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.q-mark--nav { width: 34px; height: auto; flex: none; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.2em; color: var(--navy);
}

.site-nav { display: flex; gap: 30px; }
.site-nav a {
  font-size: 0.86rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--carbon); text-decoration: none;
  padding: 6px 0; position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--navy);
  transition: width 0.18s linear;
}
.site-nav a:hover::after { width: 100%; }

/* scroll progress hairline — precise, structural */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--navy) 70%, var(--structural));
  transform: scaleX(0); transform-origin: left center;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 96px 0 110px;
  background: var(--white);
  overflow: hidden;
}
.hero-geometry {
  position: absolute; inset: -200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='97' viewBox='0 0 112 97'%3E%3Cg fill='none' stroke='%2317375E' stroke-width='1'%3E%3Cpath d='M28 0 L84 0 L112 48.5 L84 97 L28 97 L0 48.5 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 112px 97px;
  opacity: 0.045;
  pointer-events: none;
  animation: geo-drift 120s linear infinite alternate;
}
@keyframes geo-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(112px, 97px); }
}
.hero-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.q-mark--hero { width: clamp(130px, 17vw, 180px); height: auto; margin-bottom: 30px; }

.hero-wordmark {
  font-size: clamp(1.6rem, 4.6vw, 2.9rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  margin-right: -0.22em; /* optically recenter tracked text */
  color: var(--navy);
}
.hero-tagline {
  max-width: 620px;
  margin-top: 20px;
  font-size: 1.1rem;
  color: var(--carbon);
}
.hero-actions { display: flex; gap: 16px; margin-top: 38px; flex-wrap: wrap; justify-content: center; }

/* hero entrance — controlled, sequential */
.q-mark--hero  { animation: rise-in 0.6s var(--ease-out) both; }
.hero-wordmark { animation: rise-in 0.5s var(--ease-out) 0.35s both; }
.hero-tagline  { animation: rise-in 0.5s var(--ease-out) 0.52s both; }
.hero-actions  { animation: rise-in 0.5s var(--ease-out) 0.68s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* glimmer: periodic glint sweeping across the wordmark */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero-wordmark {
    background: linear-gradient(115deg, var(--navy) 42%, var(--structural) 50%, var(--navy) 58%);
    background-size: 250% 100%;
    background-position: 130% 0;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rise-in 0.5s var(--ease-out) 0.35s both,
               wm-glint 9s linear 2.5s infinite;
  }
}
@keyframes wm-glint {
  0%   { background-position: 130% 0; }
  22%  { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.05em;
  text-decoration: none;
  padding: 13px 30px;
  border: 1px solid var(--navy);
  transition: background-color 0.15s linear, color 0.15s linear, transform 0.15s var(--ease-out);
  /* one 45° cut, lower-right */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
/* glimmer: a diagonal light band sweeps across on hover */
.btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 42%, var(--sheen, rgba(255,255,255,0.32)) 50%, transparent 58%);
  background-size: 250% 250%;
  background-position: 0% 0%;
  transition: background-position 0.55s linear;
}
.btn:hover::after { background-position: 100% 100%; }
.btn-secondary { --sheen: rgba(23, 55, 94, 0.08); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--structural); border-color: var(--structural); }
.btn-secondary { background: var(--white); color: var(--navy); }
.btn-secondary:hover { background: var(--cloud); }

/* ============ Sections ============ */
.section { padding: 96px 0; }

.section-kicker {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 22px;
}
.kicker-line {
  width: 44px; height: 1px; background: var(--steel);
  position: relative;
}
.kicker-line::after {
  content: ""; position: absolute; right: -5px; top: -2.5px;
  width: 6px; height: 6px; background: var(--steel);
  transform: rotate(45deg); transform-origin: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
/* the structural line draws in as its section reveals */
.js .section-kicker.reveal .kicker-line { width: 0; }
.js .section-kicker.reveal.is-visible .kicker-line {
  width: 44px;
  transition: width 0.5s var(--ease-out) 0.2s;
}

.section-lede {
  max-width: 640px; margin-top: 18px; color: var(--slate);
}

/* ============ About ============ */
.section-about { background: var(--cloud); }
.about-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start;
}
.about-copy p + p { margin-top: 16px; }
.about-copy strong { color: var(--navy); font-weight: 600; }

/* ============ Capabilities ============ */
.cap-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 22px; margin-top: 46px;
}
.cap-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--cap);
  padding: 30px 30px 26px;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%);
  transition: border-color 0.18s linear, transform 0.18s var(--ease-out), box-shadow 0.18s linear;
}

/* glimmer: faint diagonal sheen crosses cards on hover */
.cap-card::after, .co-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 42%, rgba(23, 55, 94, 0.05) 50%, transparent 58%);
  background-size: 250% 250%;
  background-position: 0% 0%;
  transition: background-position 0.7s linear;
}
.cap-card:hover::after, a.co-card:hover::after { background-position: 100% 100%; }

.cap-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.cap-icon { width: 44px; height: 44px; color: var(--cap); flex: none; }
.cap-card h3 { font-size: 1.2rem; color: var(--navy); }
.cap-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  list-style: none; margin-top: 18px;
}
.cap-tags li {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--cap-ink);
  border: 1px solid color-mix(in srgb, var(--cap) 40%, transparent);
  padding: 3px 10px;
}

/* department motion: gears turn, globe rotates, nodes pulse, seal is still */
.gear-spin  { animation: spin 46s linear infinite; }
.globe-spin { animation: spin 120s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.node-pulse    { animation: pulse 3.2s ease-in-out infinite; }
.node-pulse.n2 { animation-delay: 1.05s; }
.node-pulse.n3 { animation-delay: 2.1s; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============ Companies ============ */
.co-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 22px; margin-top: 46px;
}
.co-card {
  display: flex; flex-direction: column;
  position: relative;
  background: var(--white);
  border: 1px solid var(--hairline);
  padding: 28px;
  text-decoration: none; color: inherit;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer));
  transition: border-color 0.18s linear, background-color 0.18s linear, transform 0.18s var(--ease-out), box-shadow 0.18s linear;
}
.co-monogram {
  display: grid; place-items: center;
  position: relative;
  width: 46px; height: 46px;
  margin-bottom: 18px;
  background: var(--navy); color: var(--white);
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background-color 0.18s linear;
}
a.co-card:hover .co-monogram { background: var(--structural); }
.co-monogram::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  background-size: 250% 250%;
  background-position: 0% 0%;
  transition: background-position 0.6s linear;
}
a.co-card:hover .co-monogram::after { background-position: 100% 100%; }
.co-monogram--future { background: var(--cloud); color: var(--slate); border: 1px solid var(--hairline); }
.co-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.co-card p { font-size: 0.93rem; color: var(--slate); flex: 1; }
.co-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.co-industry {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--slate);
}
.co-link { font-size: 0.82rem; font-weight: 500; color: var(--structural); }
.co-card--future { background: var(--cloud); border-style: dashed; }

/* ============ Contact ============ */
.section-contact { padding-top: 40px; }
.contact-card {
  display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center;
  background: var(--cloud);
  border: 1px solid var(--hairline);
  padding: 56px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
}
.contact-card h2 { margin-bottom: 12px; }
.contact-card p { color: var(--slate); max-width: 460px; }
.contact-action { justify-self: end; text-align: right; }
.contact-note { font-size: 0.84rem; margin-top: 14px; }

/* ============ Footer ============ */
.site-footer {
  background: var(--carbon);
  padding: 64px 0 48px;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.q-mark--footer { width: 44px; height: auto; opacity: 0.92; }
.footer-nav { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.footer-nav a {
  font-size: 0.82rem; letter-spacing: 0.05em;
  color: #9FB0BF; text-decoration: none;
  transition: color 0.15s linear;
}
.footer-nav a:hover { color: var(--white); }
.footer-legal { font-size: 0.78rem; color: #657481; }

/* ============ Scroll reveal — short, controlled ============ */
/* hidden state only applies when JS is running (html.js), so content
   is never invisible for no-JS visitors or crawlers */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s linear, transform 0.45s var(--ease-out),
              border-color 0.18s linear, background-color 0.18s linear, box-shadow 0.18s linear;
}

/* card hover lift — declared after reveal rules so hover wins once visible */
.cap-card:hover,
.js .cap-card.reveal.is-visible:hover {
  border-color: var(--cap);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(23, 55, 94, 0.09);
  transition: border-color 0.18s linear, transform 0.18s var(--ease-out), box-shadow 0.18s linear;
}
a.co-card:hover,
.js a.co-card.reveal.is-visible:hover {
  border-color: var(--structural);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(23, 55, 94, 0.09);
  transition: border-color 0.18s linear, transform 0.18s var(--ease-out), box-shadow 0.18s linear;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .about-grid, .contact-card { grid-template-columns: 1fr; }
  .contact-action { justify-self: start; text-align: left; }
  .co-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .site-nav { display: none; }
  .section { padding: 64px 0; }
  .hero { padding: 72px 0 80px; }
  .cap-grid, .co-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 34px 26px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .q-mark--hero, .hero-geometry,
  .hero-wordmark, .hero-tagline, .hero-actions,
  .gear-spin, .globe-spin, .node-pulse { animation: none !important; }
  .hero-wordmark {
    background: none; -webkit-text-fill-color: currentColor; color: var(--navy);
  }
  .btn::after, .cap-card::after, .co-card::after, .co-monogram::after { display: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .section-kicker.reveal .kicker-line { width: 44px; }
  .btn:hover, .cap-card:hover, a.co-card:hover { transform: none; }
  .scroll-progress { display: none; }
}
