/* ============================================================
   Gaspard Hafner — personal site
   Tokens, layout and components for the four-screen one-pager.
   ============================================================ */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --mut: #6b6b6b;
  --hair: rgba(10, 10, 10, .13);
  --hair-chip: rgba(10, 10, 10, .16);
  --num: #a3a09a;
  /* Vertical room taken by the down-arrow cue at the bottom of each screen
     (its bottom offset + height). Content is centred in the space ABOVE it. */
  --gh-cue-space: 88px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Mandatory so a touch flick that settles between two screens is always
     pulled to a full screen (no half-cut screen) — same feel on mobile as
     on desktop. Screens taller than the viewport (long text on small phones)
     stay freely scrollable: the spec treats an oversized section as its own
     valid snap zone, so mandatory only snaps at the boundaries between screens. */
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px;
  line-height: 1.62;
  font-weight: 400;
  overflow-x: hidden;
}

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

/* ---- Screens ------------------------------------------------ */
.gh-sec { scroll-snap-align: start; }

.gh-screen {
  position: relative;
  min-height: 100vh;   /* fallback for browsers without dvh */
  min-height: 100dvh;  /* real visible height — adapts to the browser toolbar */
  display: flex;
  align-items: center;
  /* Extra bottom padding = the cue zone, so the content is centred in the
     space between the top of the screen and the down-arrows, not the full
     height (which read as slightly too low). */
  padding: 80px 40px calc(80px + var(--gh-cue-space));
}

.gh-inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.gh-inner--center { text-align: center; }

/* ---- Scroll-reveal ----------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s cubic-bezier(.2, .7, .2, 1),
              transform 1s cubic-bezier(.2, .7, .2, 1);
}
[data-reveal].gh-in { opacity: 1; transform: none; }

/* ---- Down-arrow cue ---------------------------------------- */
.gh-cue-wrap {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}
.gh-cue-arrow {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.5;
  color: var(--mut);
  cursor: pointer;
  text-decoration: none;
  border: none;
  padding: 8px;
  animation: gh-cue 2.4s ease-in-out infinite;
}
.gh-cue-arrow svg { display: block; }
.gh-cue-arrow svg.gh-cue-2 { opacity: .4; margin-top: -4px; }

@keyframes gh-cue {
  0%, 100% { transform: translateY(0); opacity: .35; }
  50%      { transform: translateY(16px); opacity: 1; }
}

/* ============================================================
   01 — Hero
   ============================================================ */
.gh-hero {
  position: relative;
  min-height: 100vh;   /* fallback for browsers without dvh */
  min-height: 100dvh;  /* real visible height — adapts to the browser toolbar */
  padding: 34px 40px 26px;
}
.gh-hero-stack {
  position: absolute;
  top: 44%;
  left: 40px;
  right: 40px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(30px, 4.2vw, 50px);
}
.gh-portrait {
  width: clamp(92px, 12vw, 128px);
  height: clamp(92px, 12vw, 128px);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--hair);
  background: var(--paper);
  display: block;
  flex: none;
}
.gh-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  filter: grayscale(1) contrast(1.03);
  display: block;
}

/* Styled by class (not #id) so the infinite-loop clone — which keeps its
   classes but has its ids stripped — retains the handwritten font. */
.gh-name {
  position: relative;
  text-align: center;
  margin: 0;
  /* Base cushion for the cursive side-bearings (esp. the g descender) in case
     the JS auto-fit doesn't run; the script overrides this with exact values. */
  padding: 0 0.22em;
  font-family: 'La Belle Aurore', cursive;
  font-weight: 400;
  font-size: 7em;
  line-height: 1.02;
  letter-spacing: normal;
  color: var(--ink);
  white-space: nowrap;
}
.gh-l {
  display: inline-block;
  animation: gh-breathe 3.4s ease-in-out infinite;
  /* iOS Safari rasterizes each animated span into a compositing layer sized
     to its border box, clipping the cursive ink that overhangs it (the g's
     descender loop on the left, the h/r swashes on the right). Padding
     enlarges the painted box; the negative margins cancel it in layout. */
  padding: 0.45em;
  margin: -0.45em;
}
.gh-name-gap { display: inline-block; width: 0.32em; }

@keyframes gh-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* ============================================================
   02 — Présentation
   ============================================================ */
.gh-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 0 0 34px;
}
.gh-eyebrow--tight { margin-bottom: 22px; }

.gh-lead { margin: 0 0 28px; color: var(--mut); }
/* Class-based (not #id) so the infinite-loop clones — whose ids are
   stripped — render exactly like the originals. */
.gh-body { margin: 0; color: var(--ink); }

.gh-num { color: var(--num); }

/* Inline brand logo chips */
.gh-ilogo-box {
  display: inline-block;
  width: 64px;
  height: 30px;
  border-radius: 5px;
  overflow: hidden;
  vertical-align: middle;   /* centre le logo verticalement avec le texte de la ligne */
  margin: 0 .2em;
  box-shadow: inset 0 0 0 1px var(--hair-chip);
}
.gh-ilogo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gh-ilogo-img--round { border-radius: 10px; }

/* ============================================================
   03 — Investisseur
   ============================================================ */
.gh-intro {
  margin: 0 0 44px;
  width: 100%;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.6;
}

.gh-inv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 24px;
}
.gh-inv-cell {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}
.gh-inv-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
/* Fixed-height slot so every logo occupies the same block height and the
   caption below always sits at the same distance, whatever the logo's size.
   Logos share a common baseline (bottom-aligned). */
.gh-inv-logo-box {
  display: flex;
  align-items: flex-end;
  height: 22px;
  margin-bottom: 10px;
}
.gh-inv-logo {
  width: auto;
  display: block;
  filter: var(--logo-filter, none);
}
.gh-inv-cap {
  display: block;   /* block (not inline-block) so it top-aligns right below
                       the fixed-height logo box, whatever its line count */
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--mut);
}

/* ============================================================
   04 — Contact
   ============================================================ */
.gh-quote {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0 auto 64px;
  white-space: nowrap;
  color: var(--ink);
}

.gh-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  letter-spacing: 0.02em;
}
a.gh-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(10, 10, 10, .28);
  padding-bottom: 1px;
  transition: border-color .25s ease;
}
a.gh-link:hover { border-color: var(--ink); }

.gh-signature {
  margin-top: 72px;
  font-family: 'La Belle Aurore', cursive;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1;
  color: var(--ink);
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 600px) {
  /* Compact everything so each screen (content + arrows) fits even the small
     toolbar-shown viewport of an iPhone SE — no overflow, no hidden arrows. */
  :root { --gh-cue-space: 58px; }

  .gh-screen { padding: 20px 26px calc(14px + var(--gh-cue-space)); }

  /* Smaller, closer down-arrows */
  .gh-cue-wrap { bottom: 20px; }
  .gh-cue-arrow { padding: 6px; }
  .gh-cue-arrow svg { width: 30px; height: 17px; }

  /* Narrower on mobile so the cursive "g" descender can never reach the left
     edge — safe even if the JS auto-fit doesn't run (e.g. an iOS quirk). */
  .gh-name { font-size: clamp(20px, 10.5vw, 44px); }

  /* Eyebrows: less space above/below (this is the big top margin) */
  .gh-eyebrow { margin-bottom: 16px; }
  .gh-eyebrow--tight { margin-bottom: 14px; }

  /* Screen 2 — compact the two paragraphs.
     Target the body paragraphs only, NOT the .gh-eyebrow (keeps it 12px). */
  /* Class selectors (not #gh-p2 …) so the loop clones — ids stripped —
     get the same mobile sizing as the real screens (no visible re-adjust
     when the loop teleports back). */
  .gh-lead, .gh-body { font-size: 14.5px; line-height: 1.4; }
  .gh-lead { margin: 0 0 12px; }

  /* Screen 3 — compact intro + investor grid */
  .gh-intro { font-size: 15px; line-height: 1.4; margin-bottom: 20px; }
  .gh-inv-cell { padding: 13px 0; }
  .gh-inv-logo-box { height: 20px; margin-bottom: 6px; }

  /* Screen 4 — tighten */
  .gh-quote { margin: 0 auto 40px; }
  .gh-signature { margin-top: 44px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .gh-l, .gh-cue-arrow { animation: none; }
  [data-reveal] { transition: none; }
}
