/* ===================================================
   BASE — CSS Custom Properties, Reset & Typography
   =================================================== */

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

:root {
  /* ── Layout ── */
  --nav-height: 64px;

  /* ── Backgrounds ── */
  --bg:        #ffffff;
  --bg2:       #fafafa;
  --bg3:       #ffffff;
  --bg-subtle: #f5f5f5;

  /* ── Borders ── */
  --border:              #e5e5e5;
  --border-hover:        #d4d4d4;
  --border-medium:       rgba(0, 0, 0, 0.2);
  --border-strong:       rgba(0, 0, 0, 0.25);
  --border-hover-strong: rgba(0, 0, 0, 0.3);
  --border-emphasis:     rgba(0, 0, 0, 0.4);

  /* ── Text ── */
  --text:       #171717;
  --text-muted: #737373;
  --text-soft:  #404040;

  /* ── Accent ── */
  --accent:      #171717;
  --accent-dim:  rgba(0, 0, 0, 0.04);
  --accent-dim2: rgba(0, 0, 0, 0.02);

  /* ── Overlays ── */
  --overlay-nav:      rgba(255, 255, 255, 0.9);
  --overlay-drawer:   rgba(255, 255, 255, 0.98);
  --overlay-card-bg:  rgba(255, 255, 255, 0.85);
  --overlay-img-fade: rgba(255, 255, 255, 0.7);

  /* ── Shadows & Glows ── */
  --shadow-card:  rgba(0, 0, 0, 0.04);
  --shadow-image: rgba(0, 0, 0, 0.08);
  --glow-soft:    rgba(0, 0, 0, 0.06);
  --shine-color:  rgba(0, 0, 0, 0.1);

  /* ── Typography ── */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Skip to main content ── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

/* ── Keyboard focus rings ── */

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

/* Remove outline for mouse users while keeping it for keyboard users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Non-interactive elements that receive programmatic focus should not show a ring */
main:focus {
  outline: none;
}

/* ── Screen-reader only utility ── */

.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;
}

/* ── Contact form error ── */

.form-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #c00;
  min-height: 1.2em;
}

/* ── 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 {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
