/* ============================================================
   FUNDORA SOLUTIONS — BASE STYLES
   Role: Reset, body, typography system, utility classes
   ============================================================ */

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

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

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; }

/* ── TYPOGRAPHY ── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

h1 { font-size: var(--t-4xl); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--t-3xl); font-weight: 700; letter-spacing: -0.025em; }
h3 { font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.02em; }
h4 { font-size: var(--t-xl);  font-weight: 600; }
h5 { font-size: var(--t-lg);  font-weight: 600; }
h6 { font-size: var(--t-md);  font-weight: 600; }

p {
  color: var(--c-text-2);
  line-height: 1.75;
  max-width: 65ch;
}

strong { color: var(--c-text); font-weight: 600; }
em     { font-style: italic; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--c-bg-2);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}

/* ── LAYOUT PRIMITIVES ── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

.container--md {
  max-width: var(--max-w-md);
  margin: 0 auto;
  padding: 0 var(--px);
}

.container--sm {
  max-width: var(--max-w-sm);
  margin: 0 auto;
  padding: 0 var(--px);
}

section {
  position: relative;
}

/* ── SECTION SPACING ── */

.section {
  padding: clamp(64px, 8vw, 120px) 0;
}

.section--sm {
  padding: clamp(40px, 5vw, 64px) 0;
}

.section--lg {
  padding: clamp(80px, 10vw, 160px) 0;
}

/* ── GRID ── */

.grid {
  display: grid;
  gap: var(--s-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── FLEX UTILITIES ── */

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2       { gap: var(--s-2); }
.gap-3       { gap: var(--s-3); }
.gap-4       { gap: var(--s-4); }
.gap-6       { gap: var(--s-6); }
.gap-8       { gap: var(--s-8); }

/* ── TEXT UTILITIES ── */

.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-green  { color: var(--c-green); }
.text-muted  { color: var(--c-text-2); }
.text-dim    { color: var(--c-text-3); }

.text-sm     { font-size: var(--t-sm); }
.text-xs     { font-size: var(--t-xs); }
.text-lg     { font-size: var(--t-lg); }

.font-mono   { font-family: var(--font-mono); }

.uppercase   { text-transform: uppercase; letter-spacing: 0.08em; }
.tracking-wide { letter-spacing: 0.06em; }

/* ── SECTION LABEL (the small eyebrow text above headings) ── */

.label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-green);
  margin-bottom: var(--s-4);
}

.label::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--c-green);
  opacity: 0.6;
}

/* ── DIVIDER ── */

.divider {
  width: 100%;
  height: 1px;
  background: var(--c-border);
}

/* ── SPACING UTILITIES ── */

.mt-4  { margin-top: var(--s-4); }
.mt-6  { margin-top: var(--s-6); }
.mt-8  { margin-top: var(--s-8); }
.mt-10 { margin-top: var(--s-10); }
.mt-12 { margin-top: var(--s-12); }
.mb-4  { margin-bottom: var(--s-4); }
.mb-6  { margin-bottom: var(--s-6); }
.mb-8  { margin-bottom: var(--s-8); }

/* ── SCROLL REVEAL (initial state — JS adds .is-visible) ── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }
.reveal-delay-5 { transition-delay: 400ms; }

/* ── NOISE TEXTURE OVERLAY ── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 9999;
}

/* ── SCROLLBAR ── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb {
  background: var(--c-bg-3);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--c-text-3); }

/* ── SELECTION ── */

::selection {
  background: var(--c-green);
  color: #000;
}

/* ── FOCUS ── */

:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── RESPONSIVE BASE ── */

@media (max-width: 768px) {
  h1 { letter-spacing: -0.025em; }
  p  { max-width: 100%; }
}
