/* ==========================================================================
   TAX SPARROW — Design System
   Foundation tokens, reset, and utility classes.
   Dark theme. Orange accents. Crypto meets Steuerberater.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   All values are CSS custom properties. Components reference these only.
   -------------------------------------------------------------------------- */

:root {

  /* --- Backgrounds (darkest to lightest) -------------------------------- */
  --bg-void:    #030508;
  --bg-base:    #060a10;
  --bg-deep:    #0a1018;
  --bg-surface: #0f1a24;
  --bg-raised:  #142030;
  --bg-card:    #1a2a3a;

  /* --- Orange spectrum -------------------------------------------------- */
  --orange-900: #4a2400;
  --orange-800: #6b3300;
  --orange-700: #8c4400;
  --orange-600: #b35a00;
  --orange-500: #d47210;
  --orange:     #f1861d;
  --orange-400: #f1861d;
  --orange-300: #f5a04a;
  --orange-200: #f8ba78;
  --orange-100: #fbd4a6;

  /* --- Neutrals --------------------------------------------------------- */
  --white: #ede9e0;
  --bone:  #c8c4ba;
  --smoke: #7a7a72;
  --mute:  #3a3a35;

  /* --- Semantic text ---------------------------------------------------- */
  --text-primary:   var(--white);
  --text-secondary: var(--bone);
  --text-muted:     var(--smoke);
  --text-accent:    var(--orange);
  --text-heading:   var(--white);

  /* --- Status ----------------------------------------------------------- */
  --success: #34d399;
  --error:   #f87171;
  --info:    #60a5fa;

  /* --- Typography — Families -------------------------------------------- */
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans:  "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono:  "Space Mono", ui-monospace, "Courier New", monospace;

  /* --- Typography — Fluid Type Scale (ratio ≈ 1.25) --------------------- */
  --text-xs:   clamp(0.70rem, 0.65rem + 0.25vw, 0.80rem);
  --text-sm:   clamp(0.80rem, 0.75rem + 0.25vw, 0.90rem);
  --text-base: clamp(0.94rem, 0.88rem + 0.30vw, 1.06rem);
  --text-lg:   clamp(1.06rem, 0.98rem + 0.40vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1.13rem + 0.60vw, 1.56rem);
  --text-2xl:  clamp(1.50rem, 1.30rem + 1.00vw, 1.95rem);
  --text-3xl:  clamp(1.88rem, 1.56rem + 1.60vw, 2.44rem);
  --text-4xl:  clamp(2.34rem, 1.88rem + 2.30vw, 3.05rem);
  --text-5xl:  clamp(2.93rem, 2.25rem + 3.40vw, 3.81rem);
  --text-6xl:  clamp(3.66rem, 2.70rem + 4.80vw, 4.77rem);
  --text-7xl:  clamp(4.58rem, 3.20rem + 6.90vw, 5.96rem);

  /* --- Typography — Line Heights ---------------------------------------- */
  --leading-none:    1;
  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* --- Typography — Letter Spacing -------------------------------------- */
  --tracking-tight:   -0.02em;
  --tracking-normal:   0;
  --tracking-wide:     0.04em;
  --tracking-wider:    0.08em;
  --tracking-widest:   0.14em;

  /* --- Spacing (8px grid) ----------------------------------------------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;
  --space-40: 160px;
  --space-48: 192px;

  /* --- Section dimensions ----------------------------------------------- */
  --section-py:     clamp(3rem, 2.5rem + 2.5vw, 5rem);
  --section-px:     clamp(1.25rem, 1rem + 2vw, 3rem);
  --section-max:    1280px;
  --section-narrow: 900px;
  --section-wide:   1440px;

  /* --- Shadows ---------------------------------------------------------- */
  --shadow-sm:   0 1px 2px  rgba(0, 0, 0, 0.40);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.50);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-xl:   0 16px 48px rgba(0, 0, 0, 0.60);
  --shadow-glow: 0 0 24px rgba(241, 134, 29, 0.25);

  /* --- Transitions ------------------------------------------------------ */
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
  --duration-slower: 800ms;

  /* --- Border radii ----------------------------------------------------- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* --- Z-index layers --------------------------------------------------- */
  --z-behind:  -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* --- Borders ---------------------------------------------------------- */
  --border-color:       rgba(255, 255, 255, 0.06);
  --border-color-light: rgba(255, 255, 255, 0.12);
  --border-color-focus: var(--orange);
}


/* --------------------------------------------------------------------------
   2. MODERN CSS RESET
   Opinionated reset for consistent cross-browser rendering.
   -------------------------------------------------------------------------- */

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

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--text-heading);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}


/* --------------------------------------------------------------------------
   3. SCROLLBAR
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: var(--mute);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--smoke);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--mute) var(--bg-void);
}


/* --------------------------------------------------------------------------
   4. SELECTION
   -------------------------------------------------------------------------- */

::selection {
  background-color: rgba(241, 134, 29, 0.30);
  color: var(--white);
}


/* --------------------------------------------------------------------------
   5. FOCUS VISIBLE
   Keyboard-only focus ring. Mouse clicks show no outline.
   -------------------------------------------------------------------------- */

:focus {
  outline: none;
}

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


/* --------------------------------------------------------------------------
   6. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* --- Container ---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--section-max);
  margin-inline: auto;
  padding-inline: var(--section-px);
}

.container--narrow {
  max-width: var(--section-narrow);
}

.container--wide {
  max-width: var(--section-wide);
}

/* --- Screen-reader only ------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* --------------------------------------------------------------------------
   7. REVEAL ANIMATIONS
   Elements start hidden and slide up when .revealed is added via JS.
   -------------------------------------------------------------------------- */

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

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }


/* --------------------------------------------------------------------------
   8. PRETITLE
   Monospace label above section headings.
   -------------------------------------------------------------------------- */

.pretitle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: var(--space-6);
}

.pretitle::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 2px;
  background-color: var(--orange);
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   9. SECTION HEADING
   Large serif heading. <em> children render in orange.
   -------------------------------------------------------------------------- */

.section-heading {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: 400;
  line-height: var(--leading-tight);
  color: var(--text-heading);
  margin-bottom: var(--space-10);
}

.section-heading em {
  font-style: italic;
  color: var(--text-accent);
}


/* --------------------------------------------------------------------------
   10. BODY TEXT
   Readable paragraph block with comfortable measure.
   -------------------------------------------------------------------------- */

.body-text {
  max-width: 60ch;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.body-text + .body-text {
  margin-top: var(--space-6);
}

.body-text strong {
  font-weight: 700;
  color: var(--text-primary);
}

.body-text em {
  font-style: italic;
  color: var(--text-accent);
}
