/* ═══════════════════════════════════════════════════
   SINGHEALTH IMPACT REPORT 2025/26 — style.css
   Powered by Redbean
   ═══════════════════════════════════════════════════ */

/* ── FONTS ────────────────────────────────────────── */
@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Light.otf') format('opentype');
  font-weight: 300; font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Book.otf') format('opentype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Medium.otf') format('opentype');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Bold.otf') format('opentype');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Bastore';
  src: url('../fonts/Bastore.otf') format('opentype');
  font-weight: 400; font-display: swap;
}

/* ── VARIABLES ────────────────────────────────────── */
:root {
  --orange:     #F36E21;
  --blue:       #0070C0;
  --bg-hero:    #FFF3EA;
  --bg-leaders: #FFE9D9;
  --bg-stories: #FFFAF6;
  --text:       #1A1A1A;
  --mid:        #555555;
  --font:       'Gotham', Arial, sans-serif;
  --script:     'Bastore', cursive;
  --nav-h:      72px;
  --max-w:      1440px;
}

/* ── RESET ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: #fff; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── NAV ──────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  z-index: 200;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: box-shadow 0.3s;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 48px; height: 100%;
  display: flex; align-items: center; gap: 40px;
}
/* Logo image from graphic _1 — show only a cropped left portion (SingHealth logo) */
.nav-logo { flex-shrink: 0; display: block; overflow: hidden; }
.nav-logo-img {
  height: 44px; width: auto;
  /* Show only the left SingHealth logo, crop the DukeNUS part */
  max-width: 180px;
  object-fit: cover;
  object-position: left center;
}
.nav-links { display: flex; gap: 36px; margin-left: auto; }
.nav-link {
  font-size: 13px; font-weight: 500;
  color: var(--text); letter-spacing: 0.03em;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, font-weight 0.1s, border-color 0.2s;
}
/* Design spec: on hover → bold + orange */
.nav-link:hover,
.nav-link.active { color: var(--orange); font-weight: 700; border-color: var(--orange); }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; margin-left: auto;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); }
.nav-mobile-panel {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: #fff; padding: 16px 48px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.08); z-index: 199;
}
.nav-mobile-panel.open { display: block; }
.nav-mobile-panel a { display: block; padding: 12px 0; font-size: 15px; font-weight: 500; border-bottom: 1px solid #f0f0f0; }
.nav-mobile-panel a:hover { color: var(--orange); }

/* ── ECG LINE (shared) ────────────────────────────── */
.ecg-wrap { width: 100%; height: 56px; overflow: hidden; pointer-events: none; }
.ecg-svg { width: 100%; height: 100%; }
.ecg-line {
  fill: none; stroke: var(--orange); stroke-width: 2;
  stroke-dasharray: 5000; stroke-dashoffset: 5000;
  animation: ecg 2.8s ease-out forwards;
  animation-play-state: paused;
}
.ecg-line.running { animation-play-state: running; }
.ecg-wrap--blue .ecg-line { stroke: var(--blue); }
@keyframes ecg { to { stroke-dashoffset: 0; } }

/* ── HERO ─────────────────────────────────────────── */
.hero {
  background: var(--bg-hero);
  padding-top: var(--nav-h);
  overflow: hidden;
  position: relative;
}
.hero-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 60px 48px 40px;
  display: grid;
  grid-template-columns: 1fr 480px;
  grid-template-rows: auto auto;
  column-gap: 48px;
  row-gap: 32px;
  grid-template-areas:
    "headline illust"
    "body     illust";
}

/* Headline area — layered PNGs */
.hero-headline-wrap {
  grid-area: headline;
  position: relative;
  align-self: end;
}
.hero-img { width: 100%; height: auto; display: block; }
.hero-img--text {
  position: relative; z-index: 1;
}
.hero-img--chars {
  position: absolute; inset: 0;
  z-index: 2;
  /* Start invisible, animate in */
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease 0.4s, transform 0.9s ease 0.4s;
}
.hero-img--chars.visible {
  opacity: 1; transform: none;
}

/* Body copy */
.hero-body-wrap {
  grid-area: body;
  max-width: 540px;
  align-self: start;
}
.hero-body-intro {
  font-size: 17px; font-weight: 500; color: var(--orange);
  margin-bottom: 14px; letter-spacing: 0.01em;
}
.hero-body-sub {
  font-size: 14px; line-height: 1.85; color: var(--mid);
}
.hero-body-sub strong { font-weight: 700; color: var(--text); }
.hero-into { font-family: var(--script); font-style: normal; font-size: 1.15em; }

/* Main illustration */
.hero-illust-wrap {
  grid-area: illust;
  align-self: end;
  position: relative;
}
.hero-illust {
  width: 100%; height: auto;
  /* Subtle float animation */
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* ── LEADERS ──────────────────────────────────────── */
.leaders {
  background: var(--bg-leaders);
  padding: 80px 0 0;
  position: relative;
  overflow: hidden;
}
.leaders-decor {
  position: absolute;
  right: -60px; top: 40px;
  width: 400px; height: auto;
  opacity: 0.18;
  pointer-events: none;
  /* Slow rotation — design spec arrows moving */
  animation: spin-slow 30s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.section-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 48px; }

.leaders-heading {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 56px;
}
.leaders-heading-hear {
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700; letter-spacing: 0.06em; color: var(--text);
}
.leaders-heading-script {
  font-family: var(--script);
  font-size: clamp(36px, 5vw, 64px);
  color: var(--blue); line-height: 1;
}

.leaders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 64px;
}
.leader-card {
  background: rgba(255,255,255,0.55);
  border-radius: 20px;
  padding: 40px 28px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}
.leader-card:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-6px);
}
/* Design spec: on hover, coloured spinning ring appears around photo */
.leader-card:hover .leader-ring {
  opacity: 1;
  animation: ring-spin 1.2s linear infinite;
}
.leader-card:hover .leader-arrow { color: var(--orange); }

.leader-photo-wrap {
  position: relative; width: 130px; height: 130px; margin-bottom: 18px;
}
.leader-photo {
  width: 130px; height: 130px; border-radius: 50%;
  object-fit: cover; object-position: top center;
}
.leader-photo-placeholder {
  width: 130px; height: 130px; border-radius: 50%;
  background: #d8d8d8;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #888;
}
.leader-ring {
  position: absolute; inset: -7px; border-radius: 50%;
  border: 3px solid var(--orange);
  opacity: 0;
  transition: opacity 0.3s;
}
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.leader-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.leader-title { font-size: 12px; color: var(--mid); line-height: 1.5; margin-bottom: 20px; }
.leader-arrow {
  margin-top: auto; width: 38px; height: 38px;
  color: var(--blue); transition: color 0.25s;
}
.leader-arrow svg { width: 100%; height: 100%; }

/* Double card */
.leader-card--double .leader-double-row {
  display: flex; gap: 10px; margin-bottom: 12px;
}
.leader-card--double .leader-photo-wrap { width: 110px; height: 110px; margin-bottom: 0; }
.leader-card--double .leader-photo,
.leader-card--double .leader-photo-placeholder { width: 110px; height: 110px; }
.leader-double-names { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* ── STORIES ──────────────────────────────────────── */
.stories { background: var(--bg-stories); padding: 60px 0 80px; }

/* Header image replaces text heading entirely */
.stories-header-img-wrap { text-align: center; margin-bottom: 48px; }
.stories-header-img {
  max-width: 860px; width: 90%; height: auto; margin: 0 auto;
}

/* 3-col grid */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.story-tile {
  position: relative;
  background: color-mix(in srgb, var(--c) 20%, #fff);
  border-radius: 14px;
  padding: 28px 22px;
  min-height: 180px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.3s, transform 0.25s;
}
/* Design spec: hover → full colour, text → white */
.story-tile:hover {
  background: var(--c);
  transform: scale(1.025);
}
.story-tile:hover .story-num,
.story-tile:hover .story-title { color: #fff; }

/* Photo reveal on hover (for tiles with data-photo) */
.story-tile__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 14px;
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.story-tile:hover .story-tile__photo { opacity: 0.3; }

.story-num {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--c); transition: color 0.3s;
}
.story-title {
  font-size: 14px; font-weight: 700; line-height: 1.4;
  color: var(--text); text-transform: uppercase; letter-spacing: 0.02em;
  transition: color 0.3s;
}
.story-tile--wide { grid-column: 1 / -1; min-height: 130px; }

/* ── BACK TO TOP ──────────────────────────────────── */
.btt-wrap { display: flex; justify-content: flex-end; margin-top: 48px; }
.btt {
  display: flex; align-items: center; gap: 12px;
  color: var(--blue); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; transition: color 0.2s;
}
.btt:hover { color: var(--orange); }
/* Design spec: arrow spins + changes blue→green on hover */
.btt:hover .btt-icon svg circle { stroke: #43A047; }
.btt:hover .btt-icon svg path  { stroke: #43A047; }
.btt-icon svg {
  width: 44px; height: 44px;
  transition: transform 0.6s ease;
}
.btt:hover .btt-icon svg { transform: rotate(360deg); }

/* ── FOOTER ───────────────────────────────────────── */
.site-footer { background: #fff; border-top: 1px solid rgba(0,0,0,0.06); }
.footer-img { width: 100%; max-width: var(--max-w); margin: 0 auto; display: block; height: auto; }

/* ── SCROLL REVEAL ────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-inner {
    grid-template-columns: 1fr 360px;
  }
  .leaders-grid { grid-template-columns: 1fr 1fr; }
  .leader-card--double { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .nav-inner { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile-panel { padding: 16px 24px 24px; }
  .section-inner { padding: 0 24px; }
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "headline" "illust" "body";
    padding: 32px 24px 32px;
    gap: 24px;
  }
  .hero-illust-wrap { max-width: 340px; margin: 0 auto; }
  .leaders-grid { grid-template-columns: 1fr; }
  .stories-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .story-tile--wide { grid-column: 1 / -1; }
  .leaders { padding: 56px 0 0; }
  .leaders-decor { width: 220px; right: -30px; }
}
@media (max-width: 480px) {
  .stories-grid { grid-template-columns: 1fr; }
}

/* ── REDUCED MOTION ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ecg-line { animation: none; stroke-dashoffset: 0; }
  .hero-illust { animation: none; }
  .leaders-decor { animation: none; }
  .leader-ring { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img--chars { opacity: 1; transform: none; transition: none; }
  .btt-icon svg { transition: none; }
}
