/* =============================================================================
   DRAADLOZE — BASE STYLES
   Reset, typography, and global element styles
   ============================================================================= */

/* -------------------------------------------------------------------------
   CSS RESET (Modern Minimal)
   ------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* -------------------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------------------- */

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

h1 {
  font-size: var(--heading-hero);
  font-weight: var(--font-extrabold);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--heading-section);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--heading-card);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

p {
  color: var(--color-text-secondary);
  text-wrap: pretty;
  max-width: 65ch;
}

p + p {
  margin-top: var(--space-4);
}

/* Lead paragraph */
.lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* Small text */
small,
.text-small {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

/* Text colors */
.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-accent {
  color: var(--color-accent);
}

.text-success {
  color: var(--color-success);
}

.text-error {
  color: var(--color-error);
}

/* Font weights */
.font-medium {
  font-weight: var(--font-medium);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

.font-extrabold {
  font-weight: var(--font-extrabold);
}

/* -------------------------------------------------------------------------
   LINKS
   ------------------------------------------------------------------------- */

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

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

/* -------------------------------------------------------------------------
   LISTS
   ------------------------------------------------------------------------- */

ul, ol {
  list-style: none;
}

.list-disc {
  list-style: disc;
  padding-left: var(--space-6);
}

.list-decimal {
  list-style: decimal;
  padding-left: var(--space-6);
}

.list-disc li,
.list-decimal li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* -------------------------------------------------------------------------
   IMAGES & MEDIA
   ------------------------------------------------------------------------- */

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

img {
  border-style: none;
}

/* -------------------------------------------------------------------------
   FORMS (Base reset)
   ------------------------------------------------------------------------- */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  appearance: button;
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}

button:disabled,
[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Remove default focus styles */
:focus {
  outline: none;
}

/* Restore focus-visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove inner border in Firefox */
::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/* Fix autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset;
  -webkit-text-fill-color: var(--color-text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

/* -------------------------------------------------------------------------
   TABLES
   ------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* -------------------------------------------------------------------------
   HORIZONTAL RULE
   ------------------------------------------------------------------------- */

hr {
  height: 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* -------------------------------------------------------------------------
   SELECTION
   ------------------------------------------------------------------------- */

::selection {
  background-color: var(--color-accent);
  color: white;
}

/* -------------------------------------------------------------------------
   SCROLLBAR STYLING
   ------------------------------------------------------------------------- */

/* Webkit browsers */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg);
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) var(--color-bg);
}

/* -------------------------------------------------------------------------
   LAYOUT UTILITIES (Base)
   ------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

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

/* -------------------------------------------------------------------------
   ACCESSIBILITY
   ------------------------------------------------------------------------- */

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: white;
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid white;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: var(--color-border-strong);
  }
}

/* -------------------------------------------------------------------------
   PRINT STYLES
   ------------------------------------------------------------------------- */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
