/* ================================================================
   alexsiegel.com — styles

   COLORS — change these to re-colour the whole site.
   ================================================================ */
:root {
  --night:      #0f1817;  /* near-black teal from the album cover (music section) */
  --night-text: #e6ecea;  /* main text on the dark section */
  --night-soft: #9aaba7;  /* quieter text on the dark section */
  --accent:     #4ec5ec;  /* sky blue — matches the Bandcamp player's links */
  --ink:        #111111;  /* text on the light sky (matches the logo) */

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 24px;         /* space at the left/right edges on phones */
  --slow: 1.4s;           /* speed of the fade-ins */

  color-scheme: light;    /* the page looks the same in light and dark mode */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--night-text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }

/* A clear outline when moving through the page with the keyboard */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}


/* ================================================================
   1. OPENING SCREEN (sky + logo)
   ================================================================ */
.sky {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;       /* full phone screen, ignoring the browser bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
}

/* The cloud photo fills the whole screen */
.sky__image,
.sky__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sky__image img {
  object-fit: cover;
  object-position: 55% 30%;
}

/* "Dusk": the bottom of the sky softly fades into the night colour */
.sky::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(to bottom, transparent, var(--night));
  pointer-events: none;
}

.sky__logo {
  position: relative;
  z-index: 1;
  margin: 11vh 0 0;
  margin: 11svh 0 0;
  width: min(72vw, 420px);
}


/* ================================================================
   2. RELEASES (the music)
   ================================================================ */
.release {
  padding: 6vh var(--gutter) 4vh;
  text-align: center;
}

/* Hides text on screen but keeps it for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The Bandcamp player.
   Bandcamp gives the player a fixed size (e.g. 500 × 870). Here it is
   made to shrink on phones: the artwork stays square and the tracklist
   keeps its height (script.js reads that height from the pasted code). */
.release__player {
  --player-width: min(500px, calc(100vw - 2 * var(--gutter)));
  --tracklist: 370px;
  width: var(--player-width);
  margin: 0 auto;
}
.release__player iframe {
  display: block;
  width: 100% !important;
  height: calc(var(--player-width) + var(--tracklist)) !important;
  border: 0;
}

.release__link {
  margin: 2rem 0 0;
  font-size: 0.9375rem;
}


/* ================================================================
   3. CLOSING SCREEN (purple hillside sky)
   The mirror image of the opening: night fades down into the photo.
   ================================================================ */
.dawn {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.dawn__image,
.dawn__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dawn__image img {
  object-fit: cover;
  /* Keep the left side on phones so Alex (small, on the left) stays in frame */
  object-position: 8% 35%;
}

/* The top of the photo softly fades out of the night colour */
.dawn::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 38%;
  background: linear-gradient(to top, transparent, var(--night));
  z-index: 1;
  pointer-events: none;
}

/* A very light shade along the bottom edge so the © line stays readable
   over the hillside */
.dawn::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 22%;
  background: linear-gradient(to top, rgba(15, 24, 23, 0.6), transparent);
  z-index: 1;
  pointer-events: none;
}

/* The © line sits at the bottom of the photo */
.dawn__credit {
  position: absolute;
  z-index: 2;
  inset: auto 0 0 0;
  margin: 0;
  padding: 0 var(--gutter) 1.75rem;
  text-align: center;
  color: var(--night-text);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}


/* ================================================================
   GENTLE FADE-INS
   Sections marked "reveal" fade in as you scroll to them.
   (Only when JavaScript is on, so nothing is ever hidden by mistake.)
   ================================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--slow) ease, transform var(--slow) ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* The logo fades in once when the page opens */
.sky__logo {
  animation: fade-in 1.8s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Respect visitors who have turned off motion on their device */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky__logo { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
