/*===================================*\
  Base — shared by every redesigned page
  Tokens, reset, buttons, navigation, footer.
  Literata throughout, navy on white, one tangerine accent.
\*===================================*/

:root {
  --bg: #ffffff;
  --surface: #f5f5f3;
  --ink: #1f2b4d;
  --muted: #5d6479;
  --line: rgba(31, 43, 77, 0.12);
  --accent: #f7941d;
  --accent-hover: #ffa83f;
  --accent-ink: #1f2b4d;
  --navy: #1f2b4d;
  --navy-cell: #2b3a63;
  --navy-cell-focus: #3d4f80;
  --on-navy: #ffffff;
  --on-navy-muted: #c3c9d8;

  --font: 'Literata', Georgia, serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  --step-head: clamp(2rem, 1.5rem + 1.8vw, 2.875rem);
  --step-display: clamp(3rem, 2rem + 4.2vw, 5.5rem);

  --container: 92rem;
  --gutter: clamp(20px, 5vw, 112px);
  --nav-h: 72px;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d1220;
  --surface: #141a2d;
  --ink: #e9ecf3;
  --muted: #a4abbf;
  --line: rgba(233, 236, 243, 0.12);
  --navy: #1b2647;
  color-scheme: dark;
}

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

html {
  /* Fluid scale: 16px on phones, growing to about 21px on very large screens.
     Everything sized in rem follows, so the whole layout scales with the screen. */
  font-size: clamp(100%, 0.8rem + 0.3vw, 131.25%);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
dd { margin: 0; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a, button { touch-action: manipulation; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.text-link {
  text-decoration: underline;
  transition: color 0.2s var(--ease);
}
.text-link:hover { color: var(--muted); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
}
.arrow-link span { transition: transform 0.2s var(--ease); }
.arrow-link:hover span { transform: translateX(4px); }
.arrow-link.back:hover span { transform: translateX(-4px); }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 var(--step-small)/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-quiet:hover { background: var(--surface); border-color: var(--muted); }

/* ===================================
   NAVIGATION
   =================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  transition: box-shadow 0.25s var(--ease), background-color 0.3s var(--ease);
}
.top-nav.scrolled { box-shadow: 0 1px 0 var(--line); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--nav-h);
}
.nav-brand {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-actions { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: var(--step-small); }
.nav-link {
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav-links .nav-link:hover { color: var(--muted); }
.nav-link.active,
.nav-link[aria-current="page"] { text-decoration: underline; }
.nav-cv { padding: 9px 16px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--muted); background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.hamburger {
  display: none;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 600 var(--step-small)/1.2 var(--font);
  cursor: pointer;
}
.mobile-drawer { display: none; }

/* ===================================
   SECTIONS (shared)
   =================================== */
.section { padding: 112px 0; }
.section-alt { background: var(--surface); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
  margin-bottom: 56px;
}
.section-head h2 { font-size: var(--step-head); }
.section-intro { margin-top: 14px; max-width: 40em; color: var(--muted); }

/* ===================================
   FOOTER
   =================================== */
.site-footer { padding: 40px 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  font-size: var(--step-small);
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* Copy toast (floats above the page) */
.toast-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step-small);
  box-shadow: 0 10px 30px rgba(5, 7, 10, 0.25);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.toast-notice.show { opacity: 1; transform: none; }
.toast-notice ion-icon { display: none; }

/* ===================================
   ENTRANCES (only when the script runs)
   =================================== */
.js [data-enter] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .is-in [data-enter] { opacity: 1; transform: none; }

/* ===================================
   RESPONSIVE NAVIGATION
   =================================== */
@media (max-width: 1080px) {
  .nav-links { gap: 18px; }
  .nav-actions { gap: 18px; }
}

@media (max-width: 960px) {
  .nav-links, .nav-cv { display: none; }
  .hamburger { display: inline-flex; }
  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    flex-direction: column;
    gap: 4px;
    padding: 96px var(--gutter) 24px;
    background: var(--bg);
    color: var(--ink);
    font-size: var(--step-head);
  }
  .mobile-drawer.open { display: flex; }
  .mobile-drawer .nav-link { padding: 6px 0; }
  .drawer-close { position: absolute; top: 16px; right: var(--gutter); }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-enter] { transform: none; transition: opacity 0.3s linear; }
  .arrow-link span { transition: none; }
}

/* Bold reads as bold: regular text is 400, emphasis and small headings 700 */
strong, b { font-weight: 700; }
.nav-brand { font-weight: 700; }
