/* ============================================================
   STRATALIS GROUP, Base Reset & Global Styles
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: var(--nav-height, 72px);
}

/* View transitions */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out 200ms var(--ease-in); }
::view-transition-new(root) { animation: fade-in 300ms var(--ease-out); }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in  { from { opacity: 0; } }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { max-width: 70ch; line-height: 1.7; }
p + p { margin-top: var(--space-4); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--trans-fast);
}
a:hover { color: var(--red-dark); }

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

ul, ol { list-style: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* Layout containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(var(--space-8), 4vw, var(--space-20));
}

.container-md {
  width: 100%;
  max-width: var(--container-md);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

@media (max-width: 768px) {
  .container, .container-md { padding: 0 var(--space-5); }
}

/* Section spacing */
.section {
  padding: var(--space-24) 0;
}
.section-sm {
  padding: var(--space-16) 0;
}

/* Scroll reveal */
.fade-in {
  opacity: 1;
}
@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 75%;
  }
}
@keyframes reveal-fade { to { opacity: 1; } }

.reveal-up {
  opacity: 1;
}
@supports (animation-timeline: scroll()) {
  .reveal-up {
    clip-path: inset(30% 0 0 0);
    opacity: 0;
    animation: reveal-clip linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 65%;
  }
}
@keyframes reveal-clip {
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* Staggered children, opacity always 1 as fallback */
.stagger > * {
  opacity: 1;
}
@supports (animation-timeline: scroll()) {
  .stagger > *:nth-child(1) { animation-delay: 0s; }
  .stagger > *:nth-child(2) { animation-delay: 0.05s; }
  .stagger > *:nth-child(3) { animation-delay: 0.10s; }
  .stagger > *:nth-child(4) { animation-delay: 0.15s; }
  .stagger > *:nth-child(5) { animation-delay: 0.20s; }
  .stagger > *:nth-child(6) { animation-delay: 0.25s; }
  .stagger > * {
    opacity: 1;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 75%;
  }
}

/* Dotted texture pattern */
.dotted-bg {
  background-image: radial-gradient(circle, var(--grey-200) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Thin rule */
.rule {
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Utility */
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--color-text-muted); }
.text-white  { color: var(--white); }
.text-center { text-align: center; }
.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.font-semibold { font-weight: 600; }
.uppercase   { text-transform: uppercase; letter-spacing: 0.08em; }
.mt-auto     { margin-top: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  transition: background var(--trans-fast), color var(--trans-fast),
              transform var(--trans-fast), box-shadow var(--trans-fast),
              border-color var(--trans-fast);
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
}
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}
.btn-outline:hover { background: var(--red); color: var(--white); }

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.12); border-color: white; }

.btn-ghost {
  background: transparent;
  color: var(--charcoal-dark);
  border: 2px solid transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--red); transform: none; box-shadow: none; }

/* Arrow link */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: gap var(--trans-fast), color var(--trans-fast);
}
.arrow-link:hover { gap: var(--space-3); color: var(--red-dark); }
.arrow-link::after { content: '→'; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--trans-base), transform var(--trans-base), border-color var(--trans-base);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--grey-300); }

/* Tags / chips */
.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  background: var(--grey-50);
  color: var(--charcoal);
}
.tag-red   { background: rgba(212,69,29,0.1); color: var(--red); }
.tag-green { background: rgba(151,168,34,0.12); color: var(--green-dark); }

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

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--red);
  color: white;
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }
