/* base.css — reset, design tokens, typography primitives
   EU Project Research Hub · Get Ready for Europe — Summer University Programme */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  /* type */
  --font-display: "Zodiak", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Satoshi", ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;

  --text-xs: 0.75rem;    /* 12px floor */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 1rem;     /* 16px */
  --text-md: 1.0625rem;  /* 17px */
  --text-lg: 1.25rem;    /* 20px */
  --text-xl: 1.5rem;     /* 24px */
  --text-2xl: 1.875rem;  /* 30px */
  --text-3xl: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --text-hero: clamp(2.4rem, 1.35rem + 4.6vw, 4.5rem);

  /* spacing (4px base) */
  --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 2.75rem; --sp-8: 4rem;
  --sp-9: 5.5rem;

  --radius-sm: 3px;
  --radius: 5px;
  --border-w: 1px;

  --maxw: 1220px;
  --tap: 44px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Light theme — warm off-white foundation, deep EU navy ink, one golden accent */
:root, [data-theme="light"] {
  --bg:           #F6F2E8;
  --bg-alt:       #EFEADC;
  --surface:      #FCFAF4;
  --surface-2:    #F2EDE0;
  --ink:          #10203D;
  --ink-strong:   #0A1730;
  --ink-muted:    #4C5A72;
  --ink-faint:    #5C6878;
  --rule:         #CFC7B4;
  --rule-strong:  #9DA6B6;
  --navy:         #10203D;
  --navy-deep:    #0A1730;
  --on-navy:      #F6F2E8;
  --on-navy-mute: #B9C2D2;
  --accent:       #7E5700;   /* deep golden accent for text: AA on every light surface */
  --accent-flat:  #E8B22B;   /* golden-yellow surface fill */
  --accent-ink:   #2A1D00;   /* text on accent fill */
  --focus:        #0A57C2;
  --shadow: 0 1px 0 rgba(16, 32, 61, 0.05);
}

/* Dark theme */
[data-theme="dark"] {
  --bg:           #0B1526;
  --bg-alt:       #0E1B2F;
  --surface:      #12203A;
  --surface-2:    #16263F;
  --ink:          #E7E3D7;
  --ink-strong:   #F6F2E8;
  --ink-muted:    #AFB9CB;
  --ink-faint:    #8B97AC;
  --rule:         #2A3A56;
  --rule-strong:  #46577A;
  --navy:         #0E1B2F;
  --navy-deep:    #081120;
  --on-navy:      #F1EDE1;
  --on-navy-mute: #A9B4C7;
  --accent:       #E8B22B;
  --accent-flat:  #E8B22B;
  --accent-ink:   #17233A;
  --focus:        #8FB8FF;
  --shadow: none;
}

/* ---------- Base elements ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  font-weight: 400;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { text-wrap: pretty; }
strong { font-weight: 700; color: var(--ink-strong); }

a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

/* Layout helpers */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.stack > * + * { margin-top: var(--sp-4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  background: var(--accent-flat); color: var(--accent-ink);
  padding: var(--sp-3) var(--sp-4); font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 120ms var(--ease);
}
.skip-link:focus { top: 0; }

/* Small caps label primitive */
.label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
