/* ============================================================================
   base.css — Reset ringan, elemen dasar, tipografi, dan utility inti.
   ========================================================================== */

/* ===== Reset ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
    min-height: 100dvh;
    font-family: var(--app-font-sans);
    font-size: var(--app-text-base);
    line-height: var(--app-leading-normal);
    color: var(--app-text);
    background: var(--app-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

ul[class],
ol[class] { list-style: none; padding: 0; }

/* ===== Tipografi ======================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--app-font-display);
    font-weight: var(--app-weight-bold);
    line-height: var(--app-leading-tight);
    letter-spacing: var(--app-tracking-tight);
    text-wrap: balance;
}

h1 { font-size: var(--app-text-5xl); }
h2 { font-size: var(--app-text-3xl); }
h3 { font-size: var(--app-text-xl); line-height: var(--app-leading-snug); }

p { text-wrap: pretty; }

a {
    color: var(--app-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--app-duration-fast) var(--app-ease-out);
}

@media (hover: hover) and (pointer: fine) {
    a:hover { color: var(--app-primary-hover); }
}

/* ===== Fokus — wajib terlihat di semua elemen interaktif ================ */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--app-focus-ring);
    outline-offset: 3px;
    border-radius: var(--app-radius-sm);
}

/* ===== Layout dasar ===================================================== */
.container {
    width: 100%;
    max-width: var(--app-container);
    margin-inline: auto;
    padding-inline: var(--app-container-pad);
}

/* ===== Utility ========================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--app-space-4);
    top: 0;
    z-index: var(--app-z-skiplink);
    padding: var(--app-space-3) var(--app-space-4);
    background: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-md);
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform var(--app-duration-fast) var(--app-ease-out);
}

.skip-link:focus-visible { transform: translateY(var(--app-space-3)); }

[id] { scroll-margin-top: calc(var(--app-header-h) + var(--app-space-5)); }

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