/* ============================================================
   GOOGLE FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,700;0,900;1,400&family=JetBrains+Mono:wght@400;500&display=swap');


/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Backgrounds --- */
  --bg-primary:   #0D0D0F;
  --bg-secondary: #13131A;
  --bg-tertiary:  #1C1C26;
  --bg-card:      #16161E;

  /* --- Text --- */
  --text-primary:   #F2F2F4;
  --text-secondary: #9B9BAD;
  --text-muted:     #55556A;

  /* --- Accent --- */
  --accent:     #00C9A7;
  --accent-dim: rgba(0, 201, 167, 0.15);

  /* --- Terminal --- */
  --terminal-bg:    #111118;
  --terminal-green: #4ADE80;
  --terminal-text:  #E2E8F0;
  --terminal-dim:   #64748B;

  /* --- Borders --- */
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);

  /* --- Radius --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* --- Fonts --- */
  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Montserrat', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* --- Type scale --- */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.5rem;
  --text-hero: clamp(3.5rem, 8vw, 6.5rem);

  /* --- Spacing --- */
  --section-padding: clamp(5rem, 10vw, 9rem);
  --container-max:   1100px;
  --card-gap:        1rem;

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* --- Shadows --- */
  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow:  0 0 24px rgba(0, 201, 167, 0.18);
}


/* ============================================================
   MODERN CSS RESET
   ============================================================ */

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

/* Remove list styles on ul/ol with a role */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Core root defaults */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

/* Body defaults */
body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  overflow-x: hidden;
}

/* Media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Form element inheritance */
input,
button,
textarea,
select {
  font: inherit;
}

/* Avoid text overflow */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* Remove default anchor decoration */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}


/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 900; /* Montserrat Black */
  line-height: 1.1;
  color: var(--text-primary);
}

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

p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

strong {
  font-weight: 500;
  color: var(--text-primary);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* Accent colour utility */
.text-accent { color: var(--accent); }

/* Muted text utility */
.text-muted { color: var(--text-muted); }


/* ============================================================
   FOCUS STYLES (accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ============================================================
   SCROLL BAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background-color: var(--accent-dim);
  color: var(--text-primary);
}


/* ============================================================
   LOAD ANIMATION HELPERS
   Sections/elements start hidden; JS adds .is-visible via
   Intersection Observer to trigger the reveal.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* Staggered children — delay is set via inline style or nth-child */
.reveal--stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal--stagger.is-visible > *:nth-child(1)  { transition-delay: 0ms;   opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(2)  { transition-delay: 100ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(3)  { transition-delay: 200ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(4)  { transition-delay: 300ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(5)  { transition-delay: 400ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(6)  { transition-delay: 500ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(7)  { transition-delay: 600ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(8)  { transition-delay: 700ms; opacity: 1; transform: none; }
.reveal--stagger.is-visible > *:nth-child(n+9) { transition-delay: 800ms; opacity: 1; transform: none; }


/* ============================================================
   HERO ON-LOAD SEQUENCE
   These classes are added by JS after DOMContentLoaded.
   ============================================================ */
.hero-animate {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.hero-animate.is-loaded {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal--stagger > *,
  .hero-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
