/* Xiasma Limited — design system
   Brand red #E1261C, technical greys, Inter typeface.
   Aim: calm, technical, mature. Scientific instrument panel meets boutique software studio. */

:root {
  --red: #E1261C;
  --red-dark: #B41A12;
  --red-tint: #FCEDEC;
  --ink: #1A1D20;
  --slate: #3D4248;
  --grey: #73777B;
  --line: #E5E7EB;
  --line-strong: #CDD1D6;
  --paper: #FFFFFF;
  --surface: #F6F7F9;
  --surface-2: #EEF0F3;
  --focus: #2563EB;

  --maxw: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
  --radius-lg: 12px;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.1875rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2.125rem;
  --fs-2xl: 2.875rem;
  --fs-3xl: 3.75rem;

  --shadow-sm: 0 1px 2px rgba(15, 22, 36, 0.04), 0 1px 1px rgba(15, 22, 36, 0.03);
  --shadow-md: 0 6px 24px -8px rgba(15, 22, 36, 0.12), 0 2px 6px rgba(15, 22, 36, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--red-dark); }
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

h1 { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); letter-spacing: -0.015em; }

p { margin: 0 0 1.1em; }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

code, pre {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

/* Skip link */
.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 1000;
  text-decoration: none;
  font-weight: 500;
}
.skip:focus { top: 1rem; color: #fff; }

/* Layout */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
section.tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

.lede {
  font-size: var(--fs-md);
  color: var(--slate);
  max-width: 60ch;
}

.muted { color: var(--slate); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  line-height: 0;
}
.brand img {
  height: 30px;
  width: auto;
  display: block;
}
.brand:hover { opacity: 0.85; }
.footer__brand img { height: 32px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  display: inline-block;
  color: var(--slate);
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--secondary:hover { background: var(--surface); border-color: var(--grey); color: var(--ink); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.btn--ghost:hover { color: var(--red); background: transparent; }
.btn--lg { padding: 0.95rem 1.4rem; font-size: var(--fs-base); }

/* Hero */
.hero {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(ellipse 90% 60% at 80% -10%, var(--red-tint), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  max-width: 18ch;
  margin-bottom: 1.25rem;
}
.hero__lede { font-size: var(--fs-md); max-width: 56ch; color: var(--slate); margin-bottom: 2rem; }
.hero__ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero__visual {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

/* Page hero (interior pages) */
.page-hero {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
}
.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  max-width: 22ch;
}
.page-hero p { font-size: var(--fs-md); color: var(--slate); max-width: 60ch; }

/* Cards */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card h3 { font-size: var(--fs-md); margin-bottom: 0.45em; }
.card p { color: var(--slate); margin-bottom: 1rem; flex: 1; }
.card__icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--red-tint);
  color: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.card__icon svg { width: 22px; height: 22px; }
.card a.card__cta {
  align-self: flex-start;
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--red);
}
.card a.card__cta:hover { text-decoration: underline; }

a.card {
  text-decoration: none;
  color: inherit;
}
a.card:hover { border-color: var(--red); }
a.card h3 { color: var(--ink); }

/* Two-col content */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.two-col h2 { font-size: var(--fs-xl); }

/* Workflow diagram (homepage visual) */
.workflow {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  font-size: var(--fs-sm);
  color: var(--slate);
}
.workflow__row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.workflow__node {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
}
.workflow__node--out {
  background: var(--red-tint);
  border-color: var(--red);
  color: var(--red-dark);
}
.workflow__arrow {
  text-align: center;
  color: var(--grey);
  font-weight: 700;
}

/* Sectors / domains */
.sector-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.sector {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--slate);
  background: var(--paper);
}
.sector__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none;
}

/* CTA block */
.cta-block {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}
.cta-block h2 { color: #fff; margin-bottom: 0.4em; }
.cta-block p { color: #C9CDD2; margin: 0; max-width: 50ch; }
.cta-block .btn--primary { background: var(--red); border-color: var(--red); }
.cta-block .btn--secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.cta-block .btn--secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.6); color: #fff; }
.cta-block .btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Feature list */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.feature-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--slate);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 1px;
  transform: rotate(45deg);
}
.feature-list strong { color: var(--ink); font-weight: 600; }

/* Definition list pattern */
.def-list { display: grid; gap: 1.5rem; }
.def-list h3 { margin-bottom: 0.3em; }
.def-list p { color: var(--slate); margin: 0; }

/* Contact form */
.contact-form { display: grid; gap: 1.1rem; max-width: 560px; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.field .hint { font-size: var(--fs-xs); color: var(--slate); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
}
.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.checkbox-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: var(--fs-sm); color: var(--slate);
}
.checkbox-row input { margin-top: 0.25rem; }

/* Tag pill */
.tag {
  display: inline-block;
  background: var(--surface);
  color: var(--slate);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 500;
  border: 1px solid var(--line);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #C9CDD2;
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
  font-size: var(--fs-sm);
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--red); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 {
  color: #fff;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer__brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; }
.footer__brand .brand__word { color: #fff; }
.footer__about { color: #9DA3AB; max-width: 36ch; }
.footer__bottom {
  border-top: 1px solid #2C3036;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: #8B9098;
  font-size: var(--fs-xs);
}
.footer__bottom-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* Prose pages (legal) */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.5em; font-size: var(--fs-lg); }
.prose h3 { margin-top: 2em; font-size: var(--fs-md); }
.prose ul, .prose ol { color: var(--slate); }
.prose p { color: var(--slate); }

/* Utility */
.divider-top { border-top: 1px solid var(--line); }
.bg-surface { background: var(--surface); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

/* Responsive */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: 2; }
  .two-col { grid-template-columns: 1fr; }
  .cta-block { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .field--row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem var(--gutter) 1.25rem;
    gap: 0;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.85rem 0.5rem; border-radius: var(--radius); }
  .nav .btn { margin-top: 0.5rem; align-self: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  h1 { font-size: clamp(1.875rem, 7vw, 2.5rem); }
  .workflow__row { grid-template-columns: 1fr; }
  .workflow__arrow { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero__ctas, .cta-block { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
}
