/* ================================================================
   global.css
   ─────────────────────────────────────────────────────────────────
   Contains:
     1. CSS custom properties (design tokens)
     2. Box-model reset
     3. Base body / html styles
     4. Custom scrollbar
     5. Shared utility classes (.container, .btn, .section-*, .tag)
     6. Scroll-reveal animation ([data-reveal])
   ================================================================ */


/* ── 1. Design Tokens ────────────────────────────────────────────
   All colours, fonts, spacing, and timing are defined here as
   CSS custom properties so every stylesheet can reference them.
   To re-skin the portfolio, only this block needs to change.
   ─────────────────────────────────────────────────────────────── */
:root {
  /* Raw colour palette */
  --color-gold:        #e8c547;   /* primary accent — warm gold */
  --color-gold-deep:   #d4a832;   /* darker gold for hover states */
  --color-stone:       #7a9ec6;   /* muted blue-grey — soft accent */
  --color-stone-mid:   #b0c4de;   /* lighter stone for borders */
  --color-rose-mid:    #6b8fc2;   /* mid blue — secondary accent */
  --color-teal:        #20c8b4;   /* live/active indicator dot */

  /* Semantic background tokens */
  --bg-body:           #0d1b3e;   /* main page background */
  --bg-section-alt:    #09101f;   /* alternating section background */
  --bg-dark:           #060e1f;   /* darkest background (hero lower, footer) */
  --bg-card:           #111d3a;   /* card / panel background */

  /* Semantic text tokens */
  --text-primary:      #e8eef8;   /* headings and main copy */
  --text-secondary:    #b0d3de;   /* supporting body copy */
  --text-muted:        #7a9ec6;   /* labels, captions, metadata */
  --text-light:        #dde8f5;   /* light text on dark panel surfaces */

  /* Semantic accent aliases */
  --accent-primary:    var(--color-gold);      /* gold — CTAs, highlights */
  --accent-secondary:  var(--color-rose-mid);  /* blue — secondary highlights */
  --accent-soft:       var(--color-stone);     /* stone — panel ornaments */

  /* Borders */
  --border-color:      #1e2d52;   /* default card / component border */
  --border-accent:     var(--color-stone-mid); /* highlighted border */

  /* Typography */
  --font-display:      'Cinzel', 'Times New Roman', serif;            /* eyebrows, labels, nav */
  --font-serif:        'Cormorant Garamond', 'Georgia', serif;        /* headings, name, quotes */
  --font-body:         'Lato', 'Helvetica Neue', Arial, sans-serif;   /* paragraphs, tags */

  /* Spacing / shape */
  --radius-sm:         4px;
  --radius-md:         8px;

  /* Easing / transition speeds */
  --transition-fast:   0.2s ease;
  --transition-med:    0.35s ease;
  --transition-slow:   0.55s ease;
}


/* ── 2. Box-Model Reset ──────────────────────────────────────────
   border-box ensures padding/border are included in element width.
   Margin/padding reset removes browser UA stylesheet defaults.
   ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin:     0;
  padding:    0;
}


/* ── 3. Base html / body ─────────────────────────────────────────
   scroll-behavior: smooth enables CSS-driven anchor scrolling.
   overflow-x: hidden prevents horizontal scroll from decorative
   elements that bleed slightly outside the viewport.
   ─────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  font-size:       16px; /* base rem unit */
}

body {
  background-color: var(--bg-body);
  color:            var(--text-primary);
  font-family:      var(--font-body);
  line-height:      1.6;
  overflow-x:       hidden;
}


/* ── 4. Custom Scrollbar (Webkit) ────────────────────────────────
   Thin stone-blue scrollbar to match the dark theme.
   ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: var(--bg-dark); }
::-webkit-scrollbar-thumb  { background: var(--accent-soft); border-radius: 3px; }


/* ── 5. Shared Utility Classes ───────────────────────────────────
   These classes are used across multiple sections and live here
   rather than in a section-specific file.
   ─────────────────────────────────────────────────────────────── */

/* Max-width wrapper with horizontal gutter */
.container {
  max-width: 1200px;
  margin:    0 auto;
  padding:   0 40px;
}

/* Small all-caps eyebrow label above a section title */
.section-label {
  display:        block;
  font-family:    var(--font-display);
  font-size:      0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color:          var(--accent-primary);
  margin-bottom:  6px;
}

/* Large editorial section title */
.section-title {
  font-family: var(--font-serif);
  font-size:   clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 300;
  color:       var(--text-primary);
  line-height: 1.1;
}

/* Short gradient rule below a section title */
.section-divider {
  width:      60px;
  height:     1px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  margin:     14px 0 0;
}

/* ── Buttons ── */
/* Base button — shared between all button variants */
.btn {
  display:         inline-flex;
  align-items:     center;
  gap:             8px;
  padding:         12px 28px;
  font-family:     var(--font-display);
  font-size:       0.68rem;
  letter-spacing:  0.15em;
  text-transform:  uppercase;
  text-decoration: none;
  border:          1px solid transparent;
  cursor:          pointer;
  border-radius:   0;           /* square corners match the editorial aesthetic */
  transition:      all var(--transition-fast);
}

/* Gold-fill primary button */
.btn--primary {
  background:   var(--accent-primary);
  color:        var(--bg-dark);
  border-color: var(--accent-primary);
}
.btn--primary:hover {
  background:   var(--color-gold-deep);
  border-color: var(--color-gold-deep);
  transform:    translateY(-2px);
  box-shadow:   0 8px 24px rgba(232, 197, 71, 0.25);
}

/* Transparent ghost button */
.btn--ghost {
  background:   transparent;
  color:        var(--text-primary);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn--ghost:hover {
  border-color: var(--accent-primary);
  color:        var(--accent-primary);
}

/* Reusable skill / technology tag pill */
.tag {
  font-family:    var(--font-display);
  font-size:      0.53rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding:        4px 9px;
  border:         1px solid var(--border-color);
  color:          var(--text-muted);
  border-radius:  1px;
}


/* ── 6. Scroll-Reveal Animation ──────────────────────────────────
   Elements with [data-reveal] start invisible and slightly
   translated down. JavaScript (scroll.js) adds .is-visible when
   the element enters the viewport, triggering the transition.
   ─────────────────────────────────────────────────────────────── */
[data-reveal] {
  opacity:    0;
  transform:  translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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


/* ── Scroll-to-Top Button ─────────────────────────────────────── 
   Fixed button that appears after scrolling 400px down.
   JavaScript (scroll.js) adds .visible to show it.
   ─────────────────────────────────────────────────────────────── */
.scroll-top {
  position:        fixed;
  bottom:          30px;
  right:           30px;
  z-index:         200;
  width:           42px;
  height:          42px;
  background:      var(--bg-card);
  border:          1px solid var(--border-color);
  color:           var(--accent-primary);
  display:         grid;
  place-items:     center;
  text-decoration: none;
  font-size:       1rem;
  cursor:          pointer;
  opacity:         0;             /* hidden by default */
  pointer-events:  none;
  transition:      opacity 0.3s, border-color 0.2s, transform 0.2s;
}
.scroll-top.visible {
  opacity:        1;
  pointer-events: auto;
}
.scroll-top:hover {
  border-color: var(--accent-primary);
  transform:    translateY(-2px);
}
