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

:root {
  --color-bg: #000000;
  --color-text: #ffffff;
  --color-nav-bg: #000000;
  --color-text-dim: rgba(255, 255, 255, 0.4);
  --color-text-dimmer: rgba(255, 255, 255, 0.45);
  --color-text-faint: rgba(255, 255, 255, 0.18);
  --color-link-underline: rgba(255, 255, 255, 0.35);
  --color-link-underline-hover: #ffffff;
  --color-divider: rgba(255, 255, 255, 0.15);
  --color-divider-light: rgba(255, 255, 255, 0.12);
  --color-scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --color-scrollbar-thumb-hover: rgba(255, 255, 255, 0.4);
  --color-tooltip-bg: #ffffff;
  --color-tooltip-text: #000000;
  --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Grid constants matching Figma 1440px frame */
  --margin: calc(200 / 1440 * 100%);
  --content-margin: calc(297 / 1440 * 100%);

  /* Shell heights — every page offset is derived from these */
  --nav-h: 76px;
  --footer-h: 72px;
}

@media (max-width: 768px) {
  :root {
    --footer-h: 56px;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-nav-bg: #ffffff;
    --color-text-dim: rgba(0, 0, 0, 0.4);
    --color-text-dimmer: rgba(0, 0, 0, 0.45);
    --color-text-faint: rgba(0, 0, 0, 0.18);
    --color-link-underline: rgba(0, 0, 0, 0.35);
    --color-link-underline-hover: #000000;
    --color-divider: rgba(0, 0, 0, 0.15);
    --color-divider-light: rgba(0, 0, 0, 0.12);
    --color-scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.4);
    --color-tooltip-bg: #000000;
    --color-tooltip-text: #ffffff;
  }
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Home page: lock to viewport, no scroll */
body.page-home {
  overflow: hidden;
}

/* Right arrow after link text (assets/icons/arrow-right.svg, inlined so it takes the text colour) */
.icon-arrow {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.3em;
  vertical-align: -0.14em;
  transition: transform 0.2s ease;
}

a:hover .icon-arrow,
.project__link:hover .icon-arrow {
  transform: translateX(3px);
}

/* Readable by screen readers and search engines, invisible on screen */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  flex: 1;
}

/* Hero page: exact viewport height, no flex growth */
main.hero {
  flex: none;
}

.footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text-dimmer);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .footer {
    font-size: 14px;
  }
}
