/* ============================================
   Milas Integrations — Design Tokens
   Concept: systems integration studio.
   Palette drawn from circuit-board materials —
   slate-ink board, brass connector, teal trace.
   ============================================ */

:root {
  --ink: #0F171C;          /* board background */
  --ink-raised: #16212A;   /* raised surface */
  --ink-line: #24333D;     /* hairline / border */
  --paper: #ECEDE9;        /* primary text, warm off-white */
  --paper-dim: #8B99A1;    /* secondary text */
  --brass: #E3A94C;        /* signature accent — connector */
  --brass-dim: #8A6B36;
  --trace: #4FA491;        /* secondary accent — circuit trace */
  --trace-dim: #2C5850;

  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --measure: 68ch;
  --gutter: clamp(1.5rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 23, 28, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(227, 169, 76, 0.18);
  flex-shrink: 0;
}

nav.site-nav {
  display: flex;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

nav.site-nav a {
  text-decoration: none;
  color: var(--paper-dim);
  transition: color 0.2s ease;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

nav.site-nav a:hover,
nav.site-nav a:focus-visible {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ---------- Eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--trace);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--trace);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  color: var(--paper);
}

.hero h1 em {
  font-style: normal;
  color: var(--brass);
}

.hero p.lede {
  font-size: 1.09rem;
  color: var(--paper-dim);
  max-width: 46ch;
  margin: 0 0 2.2rem;
}

.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--brass);
  color: var(--ink);
  border: 1px solid var(--brass);
}

.btn-primary:hover { transform: translateY(-1px); background: #edb85f; }

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--ink-line);
}

.btn-ghost:hover { border-color: var(--trace); color: var(--trace); }

/* ---------- Schematic (signature element) ---------- */

.schematic {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.schematic .trace {
  fill: none;
  stroke: var(--ink-line);
  stroke-width: 1.5;
}

.schematic .trace-active {
  fill: none;
  stroke: var(--trace-dim);
  stroke-width: 1.5;
}

.schematic .node-ring {
  fill: var(--ink-raised);
  stroke: var(--ink-line);
  stroke-width: 1.5;
}

.schematic .node-core {
  fill: var(--ink);
  stroke: var(--brass);
  stroke-width: 1.5;
}

.schematic .pulse {
  fill: var(--brass);
  filter: drop-shadow(0 0 4px rgba(227, 169, 76, 0.8));
  opacity: 0;
}

.schematic text {
  font-family: var(--font-mono);
  font-size: 8.5px;
  fill: var(--paper-dim);
  letter-spacing: 0.02em;
}

.schematic .hub-label {
  font-family: var(--font-display);
  font-size: 11px;
  fill: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-a { offset-path: path('M40,70 C70,70 90,120 130,120'); animation: run 4.5s linear infinite; }
  .pulse-b { offset-path: path('M260,60 C220,60 200,110 130,120'); animation: run 5.2s linear infinite; animation-delay: -1.6s; }
  .pulse-c { offset-path: path('M40,190 C80,190 90,150 130,130'); animation: run 3.9s linear infinite; animation-delay: -0.8s; }
  .pulse-d { offset-path: path('M255,205 C210,205 190,160 132,132'); animation: run 5.8s linear infinite; animation-delay: -2.4s; }

  @keyframes run {
    0% { offset-distance: 0%; opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { opacity: 0; }
}

/* ---------- Section shell ---------- */

section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

.section-head {
  max-width: 56ch;
  margin-bottom: clamp(2.2rem, 5vw, 3.2rem);
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin: 0 0 0.8rem;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--paper-dim);
  margin: 0;
  font-size: 1.02rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--ink-line);
  margin: 0;
}

/* ---------- Capabilities ---------- */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink-line);
  border: 1px solid var(--ink-line);
}

@media (max-width: 780px) {
  .cap-grid { grid-template-columns: 1fr; }
}

.cap-card {
  background: var(--ink);
  padding: 2.1rem 1.9rem;
  transition: background 0.2s ease;
}

.cap-card:hover { background: var(--ink-raised); }

.cap-card .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--trace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  display: block;
}

.cap-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.18rem;
  margin: 0 0 0.7rem;
}

.cap-card p {
  color: var(--paper-dim);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Approach (process — numbering is meaningful here) ---------- */

.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

@media (max-width: 780px) {
  .process { grid-template-columns: 1fr; }
}

.step {
  border-top: 1px solid var(--brass-dim);
  padding-top: 1.1rem;
}

.step .num {
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.9rem;
}

.step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

.step p {
  color: var(--paper-dim);
  font-size: 0.94rem;
  margin: 0;
}

/* ---------- Contact ---------- */

.contact-panel {
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 4px;
  padding: clamp(2rem, 5vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 0.5rem;
}

.contact-panel p {
  color: var(--paper-dim);
  margin: 0;
  max-width: 42ch;
}

.contact-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper-dim);
  margin-top: 0.6rem;
}

.contact-meta a {
  color: var(--brass);
  text-decoration: none;
}

.contact-meta a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--ink-line);
  padding: 2.2rem 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--paper-dim);
}

footer a {
  text-decoration: none;
  color: var(--paper-dim);
  border-bottom: 1px solid transparent;
}

footer a:hover { color: var(--brass); border-bottom-color: var(--brass); }

footer .foot-links {
  display: flex;
  gap: 1.5rem;
}

/* ---------- Legal / privacy page ---------- */

.legal {
  padding: clamp(3rem, 7vw, 5rem) 0 4rem;
}

.legal .wrap { max-width: 780px; }

.legal h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.6rem;
}

.legal .updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--paper-dim);
  margin-bottom: 2.6rem;
  display: block;
}

.legal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 2.4rem 0 0.9rem;
}

.legal p, .legal li {
  color: var(--paper-dim);
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal ul { padding-left: 1.2rem; }

.legal a { color: var(--brass); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

.back-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--paper-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.back-link:hover { color: var(--brass); }
