/* ==========================================================================
   ONDORA.PT - Base Styles
   Dark-themed mesh communication network | Tomar, Portugal
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   2. CSS Variables
   -------------------------------------------------------------------------- */

:root {
  /* Colors */
  --bg-deep: #060610;
  --bg-surface: #0c0c1e;
  --accent-teal: #00d4aa;
  --accent-teal-dim: rgba(0, 212, 170, 0.15);
  --accent-amber: #ff6b35;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-dim: #555570;

  /* Fonts */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  /* Content widths */
  --content-max: 1100px;
  --content-narrow: 680px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms;
  --transition-base: 300ms;
  --transition-slow: 600ms;
}

/* --------------------------------------------------------------------------
   3. Base HTML / Body Styles
   -------------------------------------------------------------------------- */

html {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

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

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

h4 {
  font-size: 1.15rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  line-height: 1.7;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-out),
              opacity var(--transition-fast) var(--ease-out);
}

a:hover {
  opacity: 0.8;
}

::selection {
  background-color: var(--accent-teal);
  color: var(--bg-deep);
}

::-moz-selection {
  background-color: var(--accent-teal);
  color: var(--bg-deep);
}

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

/* --------------------------------------------------------------------------
   5. Bilingual Support
   -------------------------------------------------------------------------- */

[data-lang="en"] .lang-pt {
  display: none;
}

[data-lang="pt"] .lang-en {
  display: none;
}

/* --------------------------------------------------------------------------
   6. Progressive Enhancement
   -------------------------------------------------------------------------- */

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   7. Accessibility
   -------------------------------------------------------------------------- */

/* Skip-to-content link */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 9999;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--accent-teal);
  color: var(--bg-deep);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 4px 4px;
  transition: top var(--transition-fast) var(--ease-out);
}

.skip-to-content:focus {
  top: 0;
  outline: none;
}

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

/* 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;
  }
}

/* --------------------------------------------------------------------------
   8. Scrollbar Styling (Webkit)
   -------------------------------------------------------------------------- */

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

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

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 4px;
}

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

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--text-dim) var(--bg-deep);
}
