/**
 * ═══════════════════════════════════════════════════════════════════════════
 * DYMMO UI SYSTEM - Modern CSS Reset
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * Based on modern-normalize + custom additions
 * Ensures consistent rendering across all browsers
 * 
 * @version   3.0.0
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   Document & Sections
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Sections
   ═══════════════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--dm-font-black);
    line-height: var(--dm-leading-tight);
    color: var(--dm-text-primary);
}

h1 { font-size: var(--dm-text-5xl); }
h2 { font-size: var(--dm-text-4xl); }
h3 { font-size: var(--dm-text-3xl); }
h4 { font-size: var(--dm-text-2xl); }
h5 { font-size: var(--dm-text-xl); }
h6 { font-size: var(--dm-text-lg); }

p {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Text-level semantics
   ═══════════════════════════════════════════════════════════════════════════ */

a {
    color: var(--dm-brand-primary);
    text-decoration: none;
    background-color: transparent;
    transition: color var(--dm-duration-200) var(--dm-ease-out);
}

a:hover {
    color: var(--dm-green-400);
}

abbr[title] {
    border-bottom: none;
    text-decoration: underline;
    text-decoration: underline dotted;
}

b,
strong {
    font-weight: var(--dm-font-bold);
}

code,
kbd,
samp,
pre {
    font-family: var(--dm-font-mono);
    font-size: 0.875em;
}

small {
    font-size: 80%;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Embedded content
   ═══════════════════════════════════════════════════════════════════════════ */

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

img,
svg {
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════════════════════ */

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

button,
input {
    overflow: visible;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText;
}

fieldset {
    padding: 0;
    margin: 0;
    border: 0;
    min-width: 0;
}

legend {
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal;
}

progress {
    vertical-align: baseline;
}

textarea {
    overflow: auto;
    resize: vertical;
}

[type="checkbox"],
[type="radio"] {
    padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Interactive
   ═══════════════════════════════════════════════════════════════════════════ */

details {
    display: block;
}

summary {
    display: list-item;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Lists
   ═══════════════════════════════════════════════════════════════════════════ */

ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════════════════════ */

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

th {
    text-align: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Misc
   ═══════════════════════════════════════════════════════════════════════════ */

template {
    display: none;
}

[hidden] {
    display: none !important;
}

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--dm-border-primary);
    margin: var(--dm-space-6) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Accessibility
   ═══════════════════════════════════════════════════════════════════════════ */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--dm-brand-primary);
    outline-offset: 2px;
}

/* Screen reader only */
.dm-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;
}

.dm-sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

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

    abbr[title]::after {
        content: " (" attr(title) ")";
    }

    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }

    pre {
        white-space: pre-wrap !important;
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   Selection
   ═══════════════════════════════════════════════════════════════════════════ */

::selection {
    background-color: var(--dm-brand-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--dm-brand-primary);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbars (WebKit)
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

::-webkit-scrollbar-thumb {
    background: var(--dm-bg-tertiary);
    border-radius: var(--dm-radius-full);
    border: 2px solid var(--dm-bg-secondary);
}

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

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--dm-bg-tertiary) var(--dm-bg-secondary);
}
