/* EllianaFisher.com
   Single-page personal site. Layout mirrors the original Sitely design:
   a 960px composition that now scales fluidly down to phone widths. */

/* ---------- Fonts (SIL Open Font License, see ATTRIBUTIONS.md) ---------- */

@font-face {
  font-family: "Atma";
  src: url("../fonts/Atma-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block; /* avoid a fallback-font flash on the big title */
}

@font-face {
  font-family: "Oswald";
  src: url("../fonts/Oswald-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("../fonts/Kalam-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --pink: #eb98df;
  --purple: #6c34cd;
  --ink: #000;
  --shadow: #808080;
  --page-width: 960px;
  --gutter: 16px;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Shared centred column: 960px wide, with a gutter on narrower screens. */
.hero-inner,
.videos-inner,
.bio {
  width: min(var(--page-width), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* ---------- Hero: photo, title and family link ---------- */

.hero {
  background: var(--pink);
}

.hero-inner {
  position: relative;
  aspect-ratio: 960 / 591;
  container-type: inline-size;
}

/* The photo is a transparent cut-out, so it sits in front of the title
   (the violin bow crosses "Ellie!", as in the original). */
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.hero-title {
  position: absolute;
  /* 0 at full width; nudged down on phones so it clears the family link */
  top: max(0px, 14px - 1.46cqi);
  left: 1.15%;
  z-index: 1;
  margin: 0;
  font-family: "Atma", system-ui, sans-serif;
  font-weight: 400;
  font-size: 22.7cqi; /* 218px at full width */
  line-height: 1.62;
  color: var(--purple);
}

.family-link {
  position: absolute;
  top: 0;
  left: 3.85%;
  z-index: 3;
  font-family: "Oswald", system-ui, sans-serif;
  font-size: max(13px, 1.5625cqi); /* 15px at full width, readable on phones */
  line-height: 2.068;
  text-decoration: underline;
  text-shadow: 3px 3px 1px var(--shadow);
}

/* ---------- Videos ---------- */

.videos {
  background: linear-gradient(to bottom, var(--pink), #fff);
  overflow-x: hidden; /* contains the slide-in animation */
  overflow-x: clip;
}

.videos-inner {
  padding: 5px 10px 21px 11px;
}

.videos h2 {
  margin: 0 0 0.3em;
  font-family: "Atma", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(16px, 3.02vw, 29px);
  line-height: 1.622;
  text-align: center;
  text-wrap: balance;
}

.videos h2 a {
  white-space: nowrap;
  text-decoration: none;
  text-shadow: 1px 1px 1px var(--shadow);
}

.videos h2 a:hover {
  text-decoration: underline;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  justify-content: space-between;
  column-gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-list a {
  display: block;
}

.video-list img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- Bio ---------- */

.bio {
  padding: 27px 0 48px;
}

.bio p {
  margin: 0;
  font-family: "Kalam", cursive;
  font-size: clamp(17px, 2.6vw, 25px);
  line-height: 2.24;
  text-shadow: 1px 1px 1px var(--shadow);
}

/* ---------- Entrance animations (same sequence and timing as the original) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-photo {
    animation: zoom-in 2s ease both;
  }

  .hero-title {
    animation: fade-in 2s ease 2s both;
  }

  .family-link {
    animation: fade-in-right 5s ease 3s both;
  }

  .videos-inner {
    animation: slide-in-right 3s ease 2.5s both;
  }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
  50%  { opacity: 1; }
  to   { transform: none; }
}

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

@keyframes fade-in-right {
  from { opacity: 0; transform: translate3d(100%, 0, 0); }
  to   { opacity: 1; transform: none; }
}

@keyframes slide-in-right {
  from { transform: translate3d(100%, 0, 0); }
  to   { transform: none; }
}
