/* ==========================================================================
   Todatel — styles.css
   Palette extracted from the brand logo PDF:
     brand orange #F77F00 (dominant), brand black #000000, reversal white #FFFFFF.
   Neutrals are derived from brand black (warm-lifted surfaces) and reversal
   white (warm off-white text). Every color used on the page resolves to a
   custom property defined in :root below.
   Spacing runs on an 8px scale.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --color-brand: #F77F00;          /* logo orange, exact */
  --color-brand-bright: #FF941F;   /* hover lift on dark ground */
  --color-brand-wash: rgba(247, 127, 0, 0.10);
  --color-brand-line: rgba(247, 127, 0, 0.35);
  --color-on-brand: #14100A;       /* ink on orange fills */

  /* Neutrals derived from brand black / reversal white */
  --color-bg: #0C0B09;
  --color-surface: #14120F;
  --color-card: #1A1713;
  --color-line: #2A251F;
  --color-text: #F4F0E9;
  --color-muted: #A69E8F;

  /* Functional */
  --color-error: #FF6B5E;
  --color-focus: #FF941F;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* 8px spacing scale */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-8: 64px;
  --s-12: 96px;
  --s-16: 128px;

  --radius: 4px;
  --container: 1140px;
  --header-h: 80px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

main {
  display: block;
}

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

a {
  color: var(--color-text);
  text-decoration: none;
}

ul {
  list-style: none;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s-2));
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s-2);
  z-index: 100;
  padding: var(--s-1) var(--s-2);
  background: var(--color-brand);
  color: var(--color-on-brand);
  border-radius: var(--radius);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--s-1);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  max-width: 15ch;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.375rem);
  max-width: 24ch;
}

h3 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: var(--s-2);
}

.section-lede {
  color: var(--color-muted);
  max-width: 62ch;
  margin-top: var(--s-2);
}

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-block;
  padding: 12px var(--s-3);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.btn-primary:hover {
  background: var(--color-brand-bright);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
}

.link-quiet {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.link-quiet:hover {
  color: var(--color-brand);
  border-color: var(--color-brand-line);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.site-header.is-scrolled {
  background: var(--color-surface);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.brand-logo {
  height: 48px;
  width: auto;
}

.header-menu {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.site-nav ul {
  display: flex;
  gap: var(--s-4);
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color 0.2s var(--ease);
}

.site-nav a:hover {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
}

.nav-toggle-box {
  display: block;
  width: 18px;
}

.nav-toggle-line {
  display: block;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle-line + .nav-toggle-line {
  margin-top: 4px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--s-12) var(--s-12);
  border-bottom: 1px solid var(--color-line);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: var(--s-8);
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--color-brand);
  margin-top: var(--s-3);
}

.hero-sub {
  color: var(--color-muted);
  max-width: 56ch;
  margin-top: var(--s-2);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* Orbital figure (echoes the logo mark) */
.hero-visual {
  display: flex;
  justify-content: center;
}

.orbital {
  width: min(100%, 420px);
  height: auto;
}

.orbit {
  fill: none;
  stroke: var(--color-line);
  stroke-width: 1;
}

.orbit-faint {
  stroke: var(--color-surface);
}

.orbit-dashed {
  stroke: var(--color-brand-line);
  stroke-dasharray: 3 10;
}

.node {
  stroke: none;
}

.node-brand {
  fill: var(--color-brand);
}

.node-line {
  fill: var(--color-muted);
}

.core-ring {
  fill: var(--color-brand-wash);
  stroke: var(--color-brand-line);
  stroke-width: 1;
}

.core-dot {
  fill: var(--color-brand);
}

.orbital-spin-slow {
  transform-origin: 260px 260px;
  animation: spin 90s linear infinite;
}

.orbital-spin-fast {
  transform-origin: 260px 260px;
  animation: spin 45s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--s-12);
}

.section-alt {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.section-head {
  margin-bottom: var(--s-8);
}

/* ---------- Services ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--s-4);
  transition: border-color 0.25s var(--ease);
}

.card:hover {
  border-color: var(--color-brand-line);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  border: 1px solid var(--color-brand-line);
  border-radius: var(--radius);
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: var(--s-3);
}

.card h3 {
  font-size: 1.375rem;
  margin-bottom: var(--s-2);
}

.card > p {
  color: var(--color-muted);
}

.feature-list {
  margin-top: var(--s-3);
  border-top: 1px solid var(--color-line);
  padding-top: var(--s-3);
  display: grid;
  gap: var(--s-2);
}

.feature-list li {
  position: relative;
  padding-left: var(--s-3);
  font-size: 0.9375rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 2px;
  background: var(--color-brand);
}

/* ---------- Network highlights ---------- */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
}

.highlight {
  border-top: 2px solid var(--color-brand);
  background: var(--color-card);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--s-3);
}

.highlight h3 {
  margin-bottom: var(--s-1);
}

.highlight p {
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ---------- Why us ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6) var(--s-8);
}

.why-item {
  border-left: 1px solid var(--color-line);
  padding-left: var(--s-3);
}

.why-item h3 {
  color: var(--color-brand);
  margin-bottom: var(--s-1);
}

.why-item p {
  color: var(--color-muted);
}

/* ---------- Contact ---------- */
.contact-wrap {
  max-width: 720px;
}

.contact-form {
  display: grid;
  gap: var(--s-3);
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--s-1);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 12px var(--s-2);
  transition: border-color 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--color-brand);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--color-error);
}

.field-error {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: var(--s-1);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: var(--s-6);
  background: var(--color-bg);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.footer-name {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.footer-tagline {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.footer-nav ul {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--color-muted);
  font-size: 0.875rem;
  transition: color 0.2s var(--ease);
}

.footer-nav a:hover {
  color: var(--color-text);
}

.footer-legal {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ---------- Reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .orbital {
    width: min(60vw, 300px);
  }

  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .section {
    padding-block: var(--s-8);
  }

  .hero {
    padding-block: var(--s-6) var(--s-8);
  }

  .nav-toggle {
    display: block;
  }

  .header-menu {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-3);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    padding: var(--s-3);
  }

  .header-menu.is-open {
    display: flex;
  }

  .site-nav ul {
    flex-direction: column;
    gap: var(--s-2);
  }

  .site-nav a {
    display: block;
    padding: var(--s-1) 0;
    font-size: 1.0625rem;
  }

  .header-cta {
    text-align: center;
  }

  .card-grid,
  .why-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    gap: var(--s-4);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .orbital-spin-slow,
  .orbital-spin-fast {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .card,
  .site-nav a,
  .footer-nav a,
  .link-quiet {
    transition: none;
  }
}
