/* ==========================================================================
   aniss.me — minimal single-screen landing page
   Small and dependency-free on purpose. Sections:
     1. Reset / base
     2. Background photo + scrim
     3. Hero (greeting + button)
     4. Config-driven overlays (anchors)
     5. Social bar + footer
     6. Responsive
     7. Reduced motion
   ========================================================================== */

/* 1. Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  color: #f6f6f4;
  background-color: #15161a;              /* neutral base behind everything */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 2. Background photo + scrim -------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #15161a;              /* shows while the photo loads */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;                             /* faded in by background.js */
  transition: opacity 0.45s ease;         /* short: keeps the fade without stalling LCP */
}
.bg.is-loaded { opacity: 1; }

/* Dark gradient scrim keeps the greeting legible over light OR dark photos. */
.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%,
                    rgba(0, 0, 0, 0.22) 0%,
                    rgba(0, 0, 0, 0.50) 60%,
                    rgba(0, 0, 0, 0.70) 100%),
    linear-gradient(to bottom,
                    rgba(0, 0, 0, 0.35) 0%,
                    rgba(0, 0, 0, 0.28) 35%,    /* was 0.15 — the mid-screen gap where
                                                   the greeting sits on mobile */
                    rgba(0, 0, 0, 0.60) 100%);
}

/* 3. Hero (greeting + button) ------------------------------------------- */
/* Name pinned to the top-left corner (like the original site). */
.site-name {
  position: fixed;
  top: clamp(1.5rem, 4vh, 2.5rem);
  left: clamp(1.5rem, 4vw, 3rem);
  z-index: 4;
  margin: 0;
  max-width: 8em;                         /* lets "Benelmouffok" wrap under "Aniss" */
  font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.hero {
  position: relative;
  z-index: 2;                             /* above below-text overlays */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;                  /* greeting sits toward the bottom... */
  justify-content: flex-start;            /* ...and to the left, like the old site */
  padding: 16vh 6vw 16vh;                 /* whitespace; bottom clears the social bar */
}

.hero__inner {
  width: 100%;
  max-width: 46rem;
  text-align: left;
}

.greeting {
  font-size: clamp(1.35rem, 1rem + 1.9vw, 2.35rem);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.1px;
  text-wrap: balance;
  /* Two shadows: a tight dark one for glyph legibility over bright photos,
     plus a soft wide one for overall separation from the background. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65),
               0 2px 18px rgba(0, 0, 0, 0.45);
}
.greeting p { margin: 0; }

/* Body links inside the greeting: subtle underline, warm accent on hover. */
.greeting a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.greeting a:hover,
.greeting a:focus-visible {
  color: #f2c14e;
  text-decoration-color: #f2c14e;
}

/* "Get In Touch" — clean outline button that stands out without shouting. */
.btn-touch {
  display: inline-block;
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  padding: 0.7em 1.6em;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(2px);
  transition: background 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease;
}
.btn-touch:hover,
.btn-touch:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #15161a;
  transform: translateY(-1px);
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
.btn-touch:focus-visible {
  outline: 2px solid #f2c14e;
  outline-offset: 3px;
}

/* 4. Config-driven overlays --------------------------------------------- */
/* Each overlay is an <img class="overlay anchor-* overlay--(above|below)-text">
   with inline --ox / --oy / --rot / width / opacity coming from overlays.yaml.
   The transform pins it to an anchor, nudges it, then rotates around centre. */
.overlay {
  position: fixed;
  height: auto;
  max-width: none;
  pointer-events: none;
  transform-origin: center center;
  transform:
    translate(var(--bx, 0), var(--by, 0))     /* centre on the anchor */
    translate(var(--ox, 0), var(--oy, 0))     /* user nudge */
    rotate(var(--rot, 0deg));                 /* user rotation */
}

.overlay--below-text { z-index: 1; }          /* behind the greeting */
.overlay--above-text { z-index: 5; }          /* on top of the greeting */

/* A linked overlay (has `link:` in overlays.yaml) is clickable; plain overlays
   stay click-through so they never block the greeting/button beneath them. */
.overlay--linked { pointer-events: auto; cursor: pointer; }
.overlay__img    { display: block; width: 100%; height: auto; }

/* Anchors: pin an edge/corner, then set the base translate that centres the
   image on that anchor point. */
.anchor-top-left     { top: 0;    left: 0;   --bx: 0;    --by: 0;    }
.anchor-top          { top: 0;    left: 50%; --bx: -50%; --by: 0;    }
.anchor-top-right    { top: 0;    right: 0;  --bx: 0;    --by: 0;    }
.anchor-left         { top: 50%;  left: 0;   --bx: 0;    --by: -50%; }
.anchor-center       { top: 50%;  left: 50%; --bx: -50%; --by: -50%; }
.anchor-right        { top: 50%;  right: 0;  --bx: 0;    --by: -50%; }
.anchor-bottom-left  { bottom: 0; left: 0;   --bx: 0;    --by: 0;    }
.anchor-bottom       { bottom: 0; left: 50%; --bx: -50%; --by: 0;    }
.anchor-bottom-right { bottom: 0; right: 0;  --bx: 0;    --by: 0;    }

/* 5. Social bar + footer ------------------------------------------------- */
.social {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2.4rem;
  z-index: 6;
  display: flex;
  justify-content: center;
}
.social ul {
  display: flex;
  gap: 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.15s ease, transform 0.15s ease;
}
.social a:hover,
.social a:focus-visible {
  color: #ffffff;
  transform: translateY(-2px);
}
.social svg {
  width: 22px;
  height: 22px;
  display: block;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  z-index: 6;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* 6. Responsive ---------------------------------------------------------- */
@media (max-width: 600px) {
  .overlay--hide-mobile { display: none; }
  .hero { align-items: center; padding: 16vh 7vw 16vh; }  /* centre vertically on small screens */
  .site-name { top: 1.25rem; left: 1.25rem; }
  .social { bottom: 2.1rem; }
  .social ul { gap: 0.95rem; }
  .social svg { width: 20px; height: 20px; }
}

/* 7. Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .bg { opacity: 1; }   /* no fade — show the photo immediately */
}
