:root {
  --pad-x: 20vw;    /* left/right padding */
  --pad-y: 16px;   /* top/bottom padding */
}

body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;  /* CDN font first, fallbacks after */
  font-weight: 900;
  text-transform: uppercase;
  color: #333333;           /* text color for the hero and the subtitle */
}

/* ---------- Sections: stacked one after the other, the page scrolls ---------- */

.section {
  box-sizing: border-box;   /* so min-height includes the padding */
  min-height: 100dvh;       /* each section is at least one full viewport tall */
  padding: var(--pad-y) var(--pad-x);
}

/* First section: exactly the viewport, so the next section starts below it.
   Hero + subtitle are centered vertically in it. */
.section-hero {
  display: flex;
  flex-direction: column;   /* hero, then subtitle */
  justify-content: center;  /* vertical centering of hero + subtitle in the viewport */
}

/* ---------- CV section ---------- */

.section-cv {
  /* Same method as the navigation: fixed px sizes, a bigger step from 768px up (see below).
     One value drives every CV text size; every other size is this value times a ratio. */
  --cv-font-size: 14px;

  padding-top: 96px;                /* keeps the first lines clear of the fixed navigation */
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  text-transform: none;             /* the body is uppercase: normal text case for the CV */
  font-size: var(--cv-font-size);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .section-cv { --cv-font-size: 16px; }
}

/* Blurred, rounded panel behind all the CV text */
.cv-panel {
  padding: 40px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.2);        /* light veil over the animated background */
  backdrop-filter: blur(24px);                 /* blurs what is behind the panel */
  -webkit-backdrop-filter: blur(24px);         /* Safari */
}

.section-cv h2 {
  margin: 0 0 16px;
  font-size: calc(var(--cv-font-size) * 2.5);
  font-weight: 700;
}

.cv-intro {
  margin: 0 0 8px;
  font-size: calc(var(--cv-font-size) * 1.25);
}

.cv-contact {
  margin: 0;
  font-size: calc(var(--cv-font-size) * 0.875);
}

.cv-group {
  margin-top: 40px;
}

.cv-group h3 {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333333;
  font-size: calc(var(--cv-font-size) * 1.375);
  font-weight: 700;
}

.cv-entry {
  margin-bottom: 24px;
}

.cv-entry h4 {
  margin: 0;
  font-size: var(--cv-font-size);
  font-weight: 700;
}

.cv-meta {
  margin: 0 0 8px;
  font-size: calc(var(--cv-font-size) * 0.875);
}

.cv-entry p {
  margin: 0 0 8px;
}

.cv-entry ul {
  margin: 0;
  padding-left: 20px;
}

/* Small pills (technologies, skills, hobbies) */
.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.cv-entry .cv-tags {
  margin: 8px 0;                    /* these two beat the generic ".cv-entry ul" rule above */
  padding-left: 0;
}

.cv-tags li {
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.35);
  font-size: calc(var(--cv-font-size) * 0.875);

  display: flex;                    /* logo + text on one line */
  align-items: center;              /* logo vertically centered on the text */
  gap: 8px;                         /* space between the logo and the text */
}

.cv-tags li img {
  width: var(--cv-font-size);       /* logos scale with the text */
  height: var(--cv-font-size);
}

/* ---------- Navigation (uses the <nav-header> component) ---------- */

nav-header {
  --nav-color: #333333;                       /* same text color as the hero */
  --nav-cursor-bg: #333333;                   /* same black as the text */
  --nav-font: "Montserrat", sans-serif;       /* same font as the hero */
}

/* The cursor is now as dark as the links, so the hovered link turns white to stay readable.
   (Styles from the page win over the component's own ::slotted rule.) */
nav-header a {
  transition: color 0.3s ease;
}

nav-header a:hover,
nav-header a:focus {
  color: #ffffff;
}

/* ---------- Language switcher (uses the <lang-switcher> component, same look as the navigation) ---------- */

lang-switcher {
  --nav-color: #333333;                       /* same text color as the hero */
  --nav-cursor-bg: #333333;                   /* same black as the text */
  --nav-font: "Montserrat", sans-serif;       /* same font as the hero */
}

/* Same as the navigation: the cursor is dark, so the button under it turns white to stay readable.
   The selected language keeps the cursor, so it stays white as well. */
lang-switcher button {
  transition: color 0.3s ease;
}

lang-switcher button:hover,
lang-switcher button:focus,
lang-switcher button[aria-pressed="true"] {
  color: #ffffff;
}

/* While the pointer is on another button, the selected one is not under the cursor any more:
   it goes back to the normal color */
lang-switcher:has(button:hover) button[aria-pressed="true"]:not(:hover) {
  color: #333333;
}

/* ---------- Subtitle ---------- */

.subtitle {
  --subtitle-ratio: 0.25;   /* subtitle size = 0.25 x the hero text size */

  margin: calc(var(--hero-font-size) * var(--subtitle-ratio) * 0.5) 0 0;  /* small gap under the hero text: half the subtitle size */
  text-align: center;
  font-family: "Lexend Zetta", sans-serif;
  font-weight: 700;
  font-size: calc(var(--hero-font-size) * var(--subtitle-ratio));  /* --hero-font-size is set by the script */
}

/* ---------- Page background (uses the .solarized-mesh-gradient element) ---------- */

.page-background {
  position: fixed;       /* covers the whole viewport, whatever the page height */
  inset: 0;              /* top/right/bottom/left = 0 */
  z-index: -1;           /* behind everything */
  pointer-events: none;  /* clicks and selection go to the page */
}

/* ---------- Hero text ---------- */

.hero {
  margin: 0;
  width: 100%;          /* content width, i.e. viewport minus the padding */
  text-align: left;     /* the script fits the ink to both padding edges, so there is nothing left to center */
}

/* Landscape (default): both words on a single line */
.hero-line {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}

.hero-word {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

/* Portrait: "Schell" goes under "Gabriel", each word spans the full width */
@media (orientation: portrait) {
  .hero {
    overflow-x: clip;     /* the invisible spacing after the last letter must not cause a horizontal scroll */
  }

  .hero-line {
    display: block;
  }

  .hero-word {
    display: block;
    width: max-content;   /* keep the natural text width so the script can measure it */
  }
}
