/*
 * TeraScaleAI — Corporate Website Styles
 * Simple, semantic, and technology-focused.
 */

/* =====================================================
   Custom Properties
   ===================================================== */
:root {
  /* Colors */
  --color-bg: #0b0c10;
  --color-bg-elevated: #111217;
  --color-surface: #181920;
  --color-text: #e8e8e8;
  --color-text-muted: #9fa3ad;
  --color-accent: #4a9eff;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-focus: #4a9eff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --line-height: 1.6;
  --heading-line-height: 1.2;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Borders */
  --border-width: 1px;
  --border-radius: 0.5rem;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);

  /* Content width */
  --content-width: 1150px;
}

/* =====================================================
   Reset & Base
   ===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--color-accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--border-radius);
}

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

/* =====================================================
   Layout
   ===================================================== */
.container {
  width: min(92%, var(--content-width));
  margin-inline: auto;
}

.page-section {
  padding-block: var(--space-xl);
}

.page-section h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  line-height: var(--heading-line-height);
  margin-bottom: var(--space-sm);
}

.page-section > .container > p {
  color: var(--color-text-muted);
  max-width: 70ch;
  margin-bottom: var(--space-md);
}

/* =====================================================
   Skip link
   ===================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--border-radius) 0;
}

.skip-link:focus {
  top: 0;
}

/* =====================================================
   Header
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(11, 12, 16, 0.95);
  border-bottom: var(--border-width) solid var(--color-border);
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.wordmark:hover {
  color: var(--color-text);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

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

/* =====================================================
   Hero
   ===================================================== */
.hero {
  position: relative;
  padding-block: var(--space-2xl);
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 3rem 3rem;
  background-position: center top;
  opacity: 0.25;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: var(--heading-line-height);
  max-width: 25ch;
  margin-bottom: var(--space-md);
}

.hero__copy {
  color: var(--color-text-muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  max-width: 65ch;
  margin-bottom: var(--space-lg);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: none;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.btn--primary:hover {
  background-color: #75b4ff;
  color: var(--color-bg);
}

.btn--secondary {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* =====================================================
   Capability tags
   ===================================================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.tag {
  padding: 0.35rem 0.85rem;
  border: var(--border-width) solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* =====================================================
   Products
   ===================================================== */
.section__intro {
  color: var(--color-text-muted);
  max-width: 70ch;
  margin-bottom: var(--space-lg);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  background-color: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.product-card__header {
  margin-bottom: var(--space-sm);
}

.product-card h3 {
  font-size: 1.6rem;
  line-height: var(--heading-line-height);
  margin-bottom: 0.25rem;
}

.product-card__category {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-accent);
}

.product-card__desc {
  flex-grow: 1;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.product-card__link {
  align-self: flex-start;
}

/* =====================================================
   Footer
   ===================================================== */
.site-footer {
  border-top: var(--border-width) solid var(--color-border);
  padding-block: var(--space-lg);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.footer__brand p {
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
}

.wordmark--small {
  font-size: 1rem;
  color: var(--color-text);
}

.copyright {
  font-size: 0.9rem;
}

.footer__contact-name {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.footer__email {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--color-text);
}

.footer__email:hover,
.footer__email:focus-visible {
  color: var(--color-accent);
}

.footer__links ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__links a {
  color: var(--color-text-muted);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.footer__links a:hover,
.footer__links a:focus-visible {
  color: var(--color-accent);
}

/* =====================================================
   404 page
   ===================================================== */
.error-page {
  padding-block: var(--space-2xl);
}

.error-page .container {
  max-width: 70ch;
}

.error-page h1 {
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: var(--heading-line-height);
  margin-bottom: var(--space-sm);
}

.error-page p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.error-page .btn {
  margin-right: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* =====================================================
   Mobile adjustments
   ===================================================== */
@media (max-width: 600px) {
  .site-header .container {
    justify-content: center;
    text-align: center;
  }

  .site-nav ul {
    justify-content: center;
  }

  .hero {
    padding-block: var(--space-xl);
  }

  .hero h1 {
    max-width: 100%;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}
