/* Shared by every page */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Display type */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}

/* ---------- Header: full-width glass strip stuck to the top ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  /* initials on the left, the menu in the middle, the right corner free */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px var(--gutter);
  background: var(--header-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.site-header .logo {
  grid-column: 1;
  justify-self: start;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  padding: 10px 0;
  transition: opacity .3s ease;
}
.site-header .logo:hover { opacity: .6; color: var(--ink); }
.site-nav { grid-column: 2; }

.site-nav { display: flex; gap: 4px; font-size: 16px; }

.nav-link {
  --pad-x: 16px;
  position: relative;
  text-decoration: none;
  padding: 10px var(--pad-x);
  border-radius: var(--r-pill);
  transition: color .3s ease;
}
/* underline that draws in from the left on hover and slides out to the right after;
   the current section keeps it */
.nav-link::after {
  content: '';
  position: absolute;
  left: var(--pad-x); right: var(--pad-x);
  bottom: 5px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link[aria-current="true"]::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left center;
}
.nav-link[aria-current="true"],
.nav-link[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons ---------- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 18px 0 22px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--ground);
  font-size: 16px;
  text-decoration: none;
  transition: background-color .3s ease, opacity .3s ease;
}
.cta-arrow { flex: none; transition: transform .4s var(--ease-out); }
.cta:hover { background: var(--cta-hover); color: var(--ground); }
.cta:hover .cta-arrow { transform: translateX(4px); }

.text-button {
  background: none;
  border: 0;
  padding: 12px 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 15px;
  color: var(--muted);
}
.site-footer p { margin: 0; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  .site-header { padding: 6px 12px; }
  .nav-link { --pad-x: 12px; }
  /* home page, before scrolling: no initials, the menu on the left, the switch on the right.
     On the first scroll the menu slides to the middle and the initials fade in (home.js
     sets .is-top and --nav-shift). */
  .site-header .logo { transition: opacity .45s ease .1s, visibility 0s; }
  .site-nav { transition: transform .7s var(--ease-out); }
  .site-header.is-top .logo { opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s .25s; }
  .site-header.is-top .site-nav { transform: translateX(var(--nav-shift, 0px)); }
  .site-header.no-motion .logo, .site-header.no-motion .site-nav { transition: none; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
