/* =========================================================
   Ametrix Technologies - site styles
   Brand: flat, geometric, precise. No gradients, no shadows.
   ========================================================= */

:root {
  /* Light theme - Modern Blue */
  --bg: #E6EAF0;           /* cool gray page base */
  --surface: #FFFFFF;      /* cards and panels */
  --surface-2: #D9DFE8;    /* alternate sections, footer */
  --surface-3: #F1F4F8;    /* near soft white for the header and hero */
  --text: #0F2D5B;
  --text-muted: #3F5273;
  --accent: #2497E8;
  --accent-strong: #1B6FB4;   /* deeper blue for small text on light bg (WCAG AA) */
  --accent-soft: #E3F1FC;
  --support: #459DCE;
  --highlight: #2497E8;       /* orange is reserved for the dark theme */
  --border: #BCC7D5;
  --grid: rgba(15, 45, 91, 0.12);
  --btn-bg: #0F2D5B;
  --btn-fg: #F8FAFC;
  --btn-bg-hover: #163D78;
  --logo-icon: #2497E8;
  --logo-word: #0F2D5B;
  --logo-desc: #2497E8;
  --focus: #2497E8;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --maxw: 1160px;
  --gutter: 16px;
  --header-h: 72px;
}

html[data-theme="dark"] {
  /* Dark theme - Midnight & Retro Orange */
  --bg: #0E1117;
  --surface: #151A23;
  --surface-2: #1B2230;
  --surface-3: #0E1117;
  --text: #FFEEDB;
  --text-muted: #B3AB9F;
  --accent: #22B8E6;
  --accent-strong: #22B8E6;
  --accent-soft: #10303C;
  --support: #22B8E6;
  --highlight: #FF8A52;
  --border: #273140;
  --grid: rgba(255, 238, 219, 0.06);
  --btn-bg: #22B8E6;
  --btn-fg: #0E1117;
  --btn-bg-hover: #4BC7EC;
  --logo-icon: #22B8E6;
  --logo-word: #FFEEDB;
  --logo-desc: #FF8A52;
  --focus: #22B8E6;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: var(--radius); z-index: 100; }
.skip-link:focus { left: 8px; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 0.9rem;
}
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.section { padding: clamp(48px, 6vw, 80px) 0; }
.section-tight { padding-top: 0; }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.section-head h2 { margin-bottom: 0.75rem; }
.section-alt { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.975rem; line-height: 1;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand .brand-logo { height: 40px; width: auto; }
.site-footer .brand .brand-logo { height: 44px; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: 0.95rem; padding: 8px 12px; border-radius: 6px; }
.site-nav a:hover { text-decoration: none; background: var(--surface-2); color: var(--accent-strong); }
.site-nav .nav-cta { margin-left: 8px; padding: 10px 16px; color: var(--btn-fg); }
.site-nav .nav-cta:hover { background: var(--btn-bg-hover); color: var(--btn-fg); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius);
  background: transparent; color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-close { display: block; }
body.nav-open .nav-toggle .icon-menu { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
/* Decorative technical grid (allowed in supporting graphics). Lines only, no gradient effect. */
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 .tag { color: var(--highlight); }
.hero .lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-figure { display: grid; place-items: center; }
/* A schematic of the work, rather than a repeated brand mark. */
.system-diagram { width: 100%; max-width: 440px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.system-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 24px; color: var(--text-muted); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; }
.system-heading span:last-child { white-space: nowrap; color: var(--accent-strong); }
.system-layer { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; gap: 12px; align-items: center; padding: 18px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.system-number { font-size: 0.7rem; font-weight: 600; color: var(--accent-strong); }
.system-layer h2 { font-size: 0.95rem; line-height: 1.35; letter-spacing: -0.02em; }
.system-layer p { margin: 5px 0 0; font-size: 0.72rem; line-height: 1.6; color: var(--text-muted); }
.system-layer svg { width: 30px; height: 30px; color: var(--accent-strong); }
.system-layer-accent { background: var(--accent-soft); border-color: var(--accent); }
.system-connector { display: flex; flex-direction: column; align-items: center; height: 36px; color: var(--accent-strong); }
.system-connector span { width: 1px; flex: 1; background: var(--accent); }
.system-connector b { font-size: 16px; line-height: 20px; font-weight: 400; }
.system-caption { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-muted); }
@media (max-width: 420px) {
  .system-diagram { padding: 18px; }
  .system-layer { padding: 14px 10px; gap: 8px; grid-template-columns: 18px minmax(0, 1fr) 24px; }
  .system-layer svg { width: 24px; height: 24px; }
  .system-heading { font-size: 0.6rem; }
}

/* ---------- Hero proof row ---------- */
.proof { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 1.6rem; }
.proof li { position: relative; padding-left: 16px; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.proof li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--accent); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color .18s ease;
}
.card:hover { border-color: var(--accent); }
.card .icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-strong);
  margin-bottom: 14px;
}
.card .icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 0.4rem; font-size: 1.1rem; }
.card p { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.95rem; }
.card ul { display: grid; gap: 6px; }
.card li { position: relative; padding-left: 18px; font-size: 0.9rem; }
.card li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--accent); }
.card-featured { grid-column: span 2; }

/* ---------- Approach steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.steps li { padding: 18px 16px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); }
.steps li::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em;
  color: var(--highlight); margin-bottom: 8px;
}
.steps h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.steps p { margin: 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.45; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.about h2 { margin-bottom: 0.75rem; }
.about .lead { margin: 0; }
.values { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.values li { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.values h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.values p { margin: 0; font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact-panel {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(32px, 5vw, 64px); align-items: center;
  padding: clamp(28px, 4vw, 44px); border-radius: var(--radius-lg);
  background: var(--btn-bg); color: var(--btn-fg);
}
html[data-theme="dark"] .contact-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.contact-panel h2 { margin-bottom: 0.75rem; }
.contact-panel .lead { color: inherit; opacity: 0.85; }
.contact-panel .btn-primary { background: var(--accent); border-color: var(--accent); color: #0E1117; }
.contact-panel .btn-primary:hover { background: #4BC7EC; border-color: #4BC7EC; }
html[data-theme="dark"] .contact-panel .btn-primary { background: var(--highlight); border-color: var(--highlight); }
html[data-theme="dark"] .contact-panel .btn-primary:hover { background: #FFA27A; border-color: #FFA27A; }
.contact-details { display: grid; gap: 14px; }
.contact-details a { color: inherit; font-weight: 600; font-size: 1.1rem; word-break: break-all; }
.contact-details .label { display: block; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; margin-bottom: 2px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 24px; background: var(--surface-2); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.site-footer .brand { margin-bottom: 14px; }
.site-footer .tagline { font-weight: 600; color: var(--highlight); margin: 0 0 6px; }
.site-footer p { font-size: 0.925rem; color: var(--text-muted); max-width: 40ch; }
.site-footer h4 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.site-footer ul { display: grid; gap: 8px; }
.site-footer li a { color: var(--text); font-size: 0.95rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Reveal animation (subtle, respects reduced motion) ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
html.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card-featured { grid-column: span 2; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-figure { order: 0; }
  .about, .contact-panel { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }

  .nav-toggle { display: inline-grid; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px; background: var(--surface-3); border-bottom: 1px solid var(--border);
  }
  body.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 12px 14px; font-size: 1.05rem; }
  .site-nav .nav-cta { margin: 8px 0 0; justify-content: center; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .values { grid-template-columns: 1fr; }
  .card-featured { grid-column: auto; }
  .footer-top { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .proof { flex-direction: column; gap: 6px; }
}
