@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/font-0.ttf) format('truetype');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/font-1.ttf) format('truetype');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/font-2.ttf) format('truetype');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/font-3.ttf) format('truetype');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/font-4.ttf) format('truetype');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/font-5.ttf) format('truetype');
}

/* ===========================================================================
   StayIn base styles — reset, typography, forms, links, a11y helpers.
   =========================================================================== */

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

* {
    margin: 0;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 500;
    text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p {
    text-wrap: pretty;
}

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

a:hover {
    color: var(--brand-strong);
}

/* Focus visibility is a platform invariant --------------------------------- */
:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 4px;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* Skip link ---------------------------------------------------------------- */
.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -48px;
    z-index: var(--z-toast);
    background: var(--surface);
    color: var(--text);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 12px;
}

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

/* Forms -------------------------------------------------------------------- */
label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-block-end: var(--space-1);
}

input,
select,
textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--focus-ring);
}

input[type='checkbox'],
input[type='radio'] {
    width: auto;
    accent-color: var(--brand);
}

::placeholder {
    color: var(--text-faint);
}

.field {
    margin-block-end: var(--space-4);
}

.field-error {
    color: var(--danger);
    font-size: var(--text-sm);
    margin-block-start: var(--space-1);
}

.hint {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-block-start: var(--space-1);
}

/* Scrollbars (subtle, dark-friendly) -------------------------------------- */
@supports (scrollbar-width: thin) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--border-strong) transparent;
    }
}

/* Selection ---------------------------------------------------------------- */
::selection {
    background: var(--brand-soft);
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 1rem; border-color: var(--border-strong); background: var(--bg-elevated); }
textarea { resize: vertical; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--nav-height) + 1.5rem); }
