/*
 * Homepage hero (index.php): a full-bleed photograph under a navy gradient.
 *   Left   the name, the promise, two calls to action, a "log in" line and the society in numbers.
 *   Right  two frosted-glass cards: the next event (when one is ahead) and the newest published piece
 *          (or a line of Tagore's Gitanjali while nothing is published).
 *   Foot   a gently curved edge and a scroll cue.
 * Every class is hm-hero* and scoped under .hm-home; colour and type tokens come from css/home.css (.hm-home { --hm-… }).
 * Light page, dark hero. Motion is transform / opacity only and is switched off for prefers-reduced-motion.
 */

.hm-home .hm-hero {
  --hm-hero-text: #f4f7fb;           /* body text on the photograph */
  --hm-hero-soft: #dbe4f0;           /* secondary text */
  --hm-hero-glass: rgba(8, 20, 42, 0.7);
  --hm-hero-glass-line: rgba(255, 255, 255, 0.2);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* fills the first screen (header and top bar are about 7.8rem) but never gets silly on tall or short screens */
  min-height: max(34rem, min(54rem, calc(100vh - 7.8rem)));
  min-height: max(34rem, min(54rem, calc(100svh - 7.8rem)));
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(5.5rem, 4rem + 4vw, 8rem);
  background: var(--hm-navy);        /* shown while the photograph loads */
  color: var(--hm-hero-text);
  clip-path: ellipse(160% 100% at 50% 0);   /* the bottom edge is a very soft arc instead of a ruler line */
}

/* the photograph */
.hm-home .hm-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}

/* navy veil: dense behind the words on the left, open over the stage on the right, darker at the foot for the cards */
.hm-home .hm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(56rem 34rem at 14% 42%, rgba(201, 164, 107, 0.16), transparent 70%),
    linear-gradient(90deg, rgba(5, 14, 32, 0.95) 0%, rgba(5, 14, 32, 0.9) 40%, rgba(5, 14, 32, 0.56) 68%, rgba(5, 14, 32, 0.26) 100%),
    linear-gradient(180deg, rgba(5, 14, 32, 0.4) 0%, transparent 26%, transparent 58%, rgba(5, 14, 32, 0.7) 100%);
}

.hm-home .hm-hero a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hm-home .hm-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  width: 100%;
}

/* ---------- Left: words ---------- */

.hm-home .hm-hero__copy { min-width: 0; }

.hm-home .hm-hero__title {
  margin: 0;
  font: 700 clamp(3rem, 1rem + 8vw, 6.75rem) / 0.95 var(--hm-serif);
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.45);
}
.hm-home .hm-hero__tagline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.25rem;
  font: 700 clamp(0.78rem, 0.7rem + 0.35vw, 0.95rem) / 1.5 var(--hm-sans);
  letter-spacing: clamp(0.12em, 0.08em + 0.3vw, 0.24em);
  text-transform: uppercase;
  color: var(--hm-gold-soft);
  text-shadow: none;
}
.hm-home .hm-hero__tagline::before {
  content: "";
  flex: 0 0 clamp(1.5rem, 4vw, 2.75rem);
  height: 1px;
  background: var(--hm-gold);
}

.hm-home .hm-hero__lead {
  max-width: 31rem;
  margin: 1.6rem 0 2.1rem;
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--hm-hero-text);
  text-wrap: pretty;
}

.hm-home .hm-hero .hm-actions { justify-content: flex-start; }

.hm-home a.hm-btn--glass {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hm-home a.hm-btn--glass:hover { background: #fff; border-color: #fff; color: var(--hm-navy); }

.hm-home .hm-hero__signin {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  color: var(--hm-hero-soft);
}
.hm-home .hm-hero__signin a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--hm-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}
.hm-home .hm-hero__signin a:hover { text-decoration-color: #fff; }

/* the society in numbers */
.hm-home .hm-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem clamp(1.4rem, 1rem + 2vw, 2.5rem);
  max-width: 31rem;
  margin: clamp(1.75rem, 1.2rem + 2vw, 2.6rem) 0 0;
  padding: 1.15rem 0 0;
  list-style: none;
  border-top: 1px solid var(--hm-hero-glass-line);
}
.hm-home .hm-hero__facts li { display: grid; gap: 0.2rem; }
.hm-home .hm-hero__facts strong {
  font: 700 clamp(1.5rem, 1.2rem + 1vw, 1.95rem) / 1 var(--hm-serif);
  font-variant-numeric: lining-nums;
  color: #fff;
}
.hm-home .hm-hero__facts span {
  font: 700 0.75rem / 1.3 var(--hm-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hm-hero-soft);
}

/* ---------- Right: glass cards ---------- */

.hm-home .hm-hero__side {
  display: grid;
  gap: 0.9rem;
  width: min(100%, 25rem);
  min-width: 0;
  justify-self: end;
  align-self: end;
}

.hm-home .hm-hero__next,
.hm-home .hm-hero__piece {
  position: relative;
  margin: 0;
  border: 1px solid var(--hm-hero-glass-line);
  background: linear-gradient(160deg, rgba(16, 36, 68, 0.74), var(--hm-hero-glass));
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

/* up-next ticket */
.hm-home a.hm-hero__next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.15rem 0.75rem 0.75rem;
  border-radius: 16px;
  transition: transform 0.25s var(--hm-ease), border-color 0.25s;
}
.hm-home .hm-hero__next-date {
  display: grid;
  place-items: center;
  align-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2cb7e, #d4a24a);
  color: #1a1305;
}
.hm-home .hm-hero__next-date b { font: 700 1.45rem / 1 var(--hm-serif); font-variant-numeric: lining-nums; }
.hm-home .hm-hero__next-date i {
  margin-top: 0.2rem;
  font: 700 0.65rem / 1 var(--hm-sans);
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hm-home .hm-hero__next-text { display: grid; gap: 0.15rem; min-width: 0; }
.hm-home .hm-hero__next-label {
  font: 700 0.75rem / 1 var(--hm-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hm-gold-soft);
}
.hm-home .hm-hero__next-title {
  overflow: hidden;
  font: 700 1.05rem / 1.3 var(--hm-serif);
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm-home .hm-hero__next-meta {
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--hm-hero-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm-home .hm-hero__next > i { font-size: 0.9rem; color: var(--hm-gold-soft); transition: transform 0.25s var(--hm-ease); }
.hm-home a.hm-hero__next:hover > i { transform: translateX(4px); }

/* newest published piece */
.hm-home .hm-hero__piece {
  display: block;
  padding: 1.4rem 1.5rem 1.2rem;
  border-radius: 20px;
  transition: transform 0.3s var(--hm-ease), border-color 0.3s, box-shadow 0.3s;
}
.hm-home .hm-hero__piece::before {      /* a gold bar on the top edge */
  content: "";
  position: absolute;
  top: -1px;
  left: 1.5rem;
  width: 3.25rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #f2cb7e, #d4a24a);
}
.hm-home .hm-hero__piece-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.9rem;
  font: 700 0.75rem / 1.2 var(--hm-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hm-gold-soft);
}
.hm-home .hm-hero__piece-type {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  letter-spacing: 0.1em;
  color: #fff;
}
.hm-home .hm-hero__piece-title {
  display: -webkit-box;
  overflow: hidden;
  font: 700 1.4rem / 1.2 var(--hm-serif);
  color: #fff;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;          /* a title can be 255 characters; the card must not grow over the words */
  -webkit-box-orient: vertical;
}
.hm-home .hm-hero__piece-excerpt {
  display: -webkit-box;
  margin-top: 0.65rem;
  overflow: hidden;
  font: italic 500 1.02rem / 1.55 var(--hm-serif);
  color: #e9eff7;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.hm-home .hm-hero__piece-by {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hm-hero-glass-line);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--hm-hero-soft);
}
.hm-home .hm-hero__piece-by i { color: var(--hm-gold-soft); font-size: 0.85em; transition: transform 0.25s var(--hm-ease); }
.hm-home a.hm-hero__piece:hover .hm-hero__piece-by i { transform: translateX(4px); }

@media (hover: hover) {
  .hm-home a.hm-hero__next:hover,
  .hm-home a.hm-hero__piece:hover {
    transform: translateY(-4px);
    border-color: rgba(236, 217, 176, 0.75);
  }
}

/* the same glass card carrying a line of Gitanjali, until something is published */
.hm-home .hm-hero__piece--quote blockquote { margin: 0; padding: 0; border: 0; background: none; }
.hm-home .hm-hero__piece--quote blockquote::before {
  content: "\201C";
  display: block;
  height: 1.9rem;
  font: 700 3.8rem / 1 var(--hm-serif);
  color: var(--hm-gold);
}
.hm-home .hm-hero__piece--quote p {
  margin: 0;
  font: italic 500 1.2rem / 1.5 var(--hm-serif);
  color: #fff;
  text-wrap: balance;
}
.hm-home .hm-hero__piece--quote figcaption {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hm-hero-glass-line);
  font-size: 0.88rem;
  color: var(--hm-hero-soft);
}
.hm-home .hm-hero__piece--quote cite { font-style: normal; font-weight: 700; color: #fff; }

/* ---------- Scroll cue ---------- */

.hm-home a.hm-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.4rem, 1rem + 1.5vw, 2.4rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  text-decoration: none;
  transform: translateX(-50%);
  transition: background-color 0.25s, color 0.25s;
}
.hm-home a.hm-hero__scroll:hover { background: #fff; color: var(--hm-navy); }

/* ---------- Narrower screens: words first, then the cards; the photograph stays behind both ---------- */

@media (max-width: 900px) {
  .hm-home .hm-hero { min-height: 0; padding-block: clamp(2.75rem, 2rem + 3vw, 4rem) 6rem; clip-path: ellipse(200% 100% at 50% 0); }
  .hm-home .hm-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hm-home .hm-hero__side { justify-self: start; align-self: start; width: min(100%, 28rem); }
  .hm-home .hm-hero__bg { object-position: 62% 30%; }
  .hm-home .hm-hero::before {
    background:
      radial-gradient(34rem 24rem at 20% 20%, rgba(201, 164, 107, 0.16), transparent 70%),
      linear-gradient(180deg, rgba(5, 14, 32, 0.74) 0%, rgba(5, 14, 32, 0.84) 50%, rgba(5, 14, 32, 0.92) 100%);
  }
  .hm-home a.hm-hero__scroll { display: none; }
}
@media (max-width: 480px) {
  .hm-home .hm-hero__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
  .hm-home .hm-hero__facts span { letter-spacing: 0.08em; }
}
@media (max-width: 420px) {
  .hm-home .hm-hero__piece { padding: 1.25rem 1.2rem 1.05rem; }
}

/* ---------- Motion (only when it is welcome) ---------- */

@keyframes hm-hero-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes hm-hero-zoom { from { transform: scale(1.1); } }
@keyframes hm-hero-cue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

@media (prefers-reduced-motion: no-preference) {
  .hm-home .hm-hero__bg { animation: hm-hero-zoom 1.8s var(--hm-ease) both; }
  .hm-home .hm-hero__copy > * { animation: hm-hero-rise 0.9s var(--hm-ease) both; }
  .hm-home .hm-hero__copy > :nth-child(2) { animation-delay: 0.1s; }
  .hm-home .hm-hero__copy > :nth-child(3) { animation-delay: 0.2s; }
  .hm-home .hm-hero__copy > :nth-child(4) { animation-delay: 0.3s; }
  .hm-home .hm-hero__copy > :nth-child(5) { animation-delay: 0.4s; }
  .hm-home .hm-hero__side > * { animation: hm-hero-rise 0.9s var(--hm-ease) 0.45s both; }
  .hm-home .hm-hero__side > :nth-child(2) { animation-delay: 0.6s; }
  .hm-home a.hm-hero__scroll { animation: hm-hero-cue 1.6s ease-in-out 1.8s 3; }   /* three nudges, then still: nothing runs on past five seconds (WCAG 2.2.2) */
}
@media (prefers-reduced-motion: reduce) {
  .hm-home a.hm-hero__next,
  .hm-home .hm-hero__next > i,
  .hm-home .hm-hero__piece,
  .hm-home .hm-hero__piece-by i,
  .hm-home a.hm-hero__scroll { transition: none; }
  .hm-home a.hm-hero__next:hover,
  .hm-home a.hm-hero__piece:hover { transform: none; }
}

/* ---------- Print: the photograph and the veil are backgrounds and are dropped, so the words must not stay white ---------- */

@media print {
  .hm-home .hm-hero { min-height: 0; padding-block: 1.5rem; background: #fff; clip-path: none; }
  .hm-home .hm-hero__bg,
  .hm-home .hm-hero::before,
  .hm-home a.hm-hero__scroll { display: none; }
  .hm-home .hm-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hm-home .hm-hero,
  .hm-home .hm-hero * { color: var(--hm-ink) !important; text-shadow: none !important; }
  .hm-home .hm-hero__next,
  .hm-home .hm-hero__piece { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #bbb; }
  .hm-home .hm-hero__facts { border-top-color: #bbb; }
  .hm-home a.hm-btn--gold,
  .hm-home a.hm-btn--glass { box-shadow: none; }
}
