/* =============================
   Base Styles & Reset
   ============================= */

*{box-sizing:border-box}

html{
    overflow-x:hidden;
    width:100%;
    position:relative;
    /* Removed direct safe-area paddings to avoid double spacing; handled in header/modals */
}

body{
    margin:0;
    font-size:15px;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
    background:var(--gradient-surface);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
    /* Consolidated min-height (removed earlier 100vh to avoid duplicate warning) */
    min-height:100vh;
    /* Remove padding-bottom; use pseudo-element instead to paint safe-area */
    padding-bottom:env(safe-area-inset-bottom);
}
body::after{display:none;}

/* Selection styling */
::selection{
    background:var(--primary-light);
    color:var(--text);
}

/* Smooth scrollbar */
::-webkit-scrollbar{width:10px}
::-webkit-scrollbar-track{background:var(--bg-secondary)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px}
::-webkit-scrollbar-thumb:hover{background:var(--primary-light)}

/* Visually hidden but accessible to screen readers */
.visually-hidden{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

/* Fluid heading scale */
h1,h2,h3,h4{font-weight:600;letter-spacing:-0.5px;color:var(--text);}
h2{font-size:clamp(20px,4.5vw,26px);}h3{font-size:clamp(18px,3.8vw,22px);}h4{font-size:clamp(16px,3.2vw,18px);}

/* Accessible focus ring */
:focus-visible{outline:2px solid var(--primary);outline-offset:3px;border-radius:6px;}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:1ms !important;animation-iteration-count:1 !important;transition:none !important;}
}
