@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif:ital,wght@0,400;0,500;0,700;0,800;1,400;1,500&display=swap');

:root {
    --gnc-green:       #094024;
    --gnc-green-deep:  #062d19;
    --gnc-green-light: #1F5E2C;
    --gnc-gold:        #EABA3B;
    --gnc-gold-light:  #F6D77B;
    --gnc-white:       #F9F6F1;
    --gnc-dark:        #1a1a1a;
    --gnc-red:         #B53333;
    --gh-ease:         cubic-bezier(.22, 1, .36, 1);
    --gh-base:         .95s; /* wait for the opening wipe before hero content animates in */
}

html { scroll-behavior: smooth; }
body { background-color: var(--gnc-white); }

/* =============================================================
   BACK TO TOP
   ============================================================= */
.gh-backtop {
    position: fixed; left: 22px; bottom: 22px; width: 46px; height: 46px;
    border: 0; border-radius: 50%; background: var(--gnc-green); color: var(--gnc-gold); font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1900;
    box-shadow: 0 8px 20px rgba(9, 64, 36, .35);
    opacity: 0; visibility: hidden; transform: translateY(14px);
    transition: opacity .3s, transform .3s, background .2s, color .2s, visibility .3s;
}
.gh-backtop.is-show { opacity: 1; visibility: visible; transform: none; }
.gh-backtop:hover { background: var(--gnc-gold); color: var(--gnc-green); transform: translateY(-3px); }
.gh-backtop:focus-visible { outline: 3px solid var(--gnc-gold); outline-offset: 3px; }

/* =============================================================
   HERO (same look: header photo, green wash, curved bottom)
   ============================================================= */
.history-hero {
    --history-curve-height: 100px;
    position: relative; isolation: isolate;
    min-height: 270px; padding: 4rem 1rem 6.5rem;
    display: flex; align-items: center; justify-content: center; text-align: center;
}
/* Cut the curve out of the photo itself, avoiding a straight SVG overlay edge. */
.history-hero-art {
    position: absolute; inset: 0; overflow: hidden; isolation: isolate; z-index: -1;
    background: var(--gnc-green-deep);
    -webkit-mask-image: linear-gradient(#000, #000), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1200Q600 120 0 0Z'/%3E%3C/svg%3E");
    mask-image: linear-gradient(#000, #000), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1200Q600 120 0 0Z'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% calc(100% - var(--history-curve-height) + 1px), 100% var(--history-curve-height);
    mask-size: 100% calc(100% - var(--history-curve-height) + 1px), 100% var(--history-curve-height);
    -webkit-mask-position: top, bottom;
    mask-position: top, bottom;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.hero-bg {
    position: absolute; inset: -10% 0; z-index: -2;
    background-image:
        linear-gradient(to bottom, rgba(9, 64, 36, .92) 0%, rgba(0, 0, 0, .62) 75%),
        url('/assets/images/gnc-header.png');
    background-size: cover; background-position: center;
    transform: scale(1.1); will-change: transform;
}
/* a few gold specks drifting upward */
.hero-dust { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-dust i {
    position: absolute; bottom: -12px; width: 6px; height: 6px; border-radius: 50%;
    background: radial-gradient(circle, var(--gnc-gold-light), rgba(234, 186, 59, 0) 70%);
    opacity: 0; animation: ghDust 14s linear infinite;
}
.hero-dust i:nth-child(1) { left: 8%;  animation-delay: -1s;  animation-duration: 15s; }
.hero-dust i:nth-child(2) { left: 19%; animation-delay: -6s;  animation-duration: 12s; width: 4px; height: 4px; }
.hero-dust i:nth-child(3) { left: 33%; animation-delay: -3s;  animation-duration: 17s; width: 8px; height: 8px; }
.hero-dust i:nth-child(4) { left: 47%; animation-delay: -9s;  animation-duration: 13s; }
.hero-dust i:nth-child(5) { left: 61%; animation-delay: -4s;  animation-duration: 16s; width: 4px; height: 4px; }
.hero-dust i:nth-child(6) { left: 74%; animation-delay: -11s; animation-duration: 14s; width: 7px; height: 7px; }
.hero-dust i:nth-child(7) { left: 86%; animation-delay: -7s;  animation-duration: 18s; }
.hero-dust i:nth-child(8) { left: 94%; animation-delay: -2s;  animation-duration: 12s; width: 5px; height: 5px; }
@keyframes ghDust {
    0%   { transform: translateY(0); opacity: 0; }
    15%  { opacity: .85; }
    100% { transform: translateY(-340px) translateX(24px); opacity: 0; }
}

.hero-content { position: relative; z-index: 1; margin-bottom: .6rem; }
.hero-eyebrow {
    display: inline-block; font-family: 'Inter', sans-serif; font-size: .74rem; font-weight: 700;
    letter-spacing: .32em; text-transform: uppercase; color: var(--gnc-gold); margin-bottom: .6rem;
    opacity: 0; animation: ghFadeUp .8s var(--gh-ease) calc(var(--gh-base) + .1s) forwards;
}
.hero-title {
    color: #fff; font-family: 'Noto Serif', serif; font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.3rem, 7vw, 4.2rem); line-height: 1.05; letter-spacing: 1px;
    text-shadow: 2px 4px 14px rgba(0, 0, 0, .7); margin: 0;
    opacity: 0; transform: translateY(26px);
    animation: ghFadeUp 1s var(--gh-ease) calc(var(--gh-base) + .25s) forwards;
}
.hero-rule {
    display: block; width: 0; height: 4px; background: var(--gnc-gold); margin: 1rem auto 0; border-radius: 2px;
    animation: ghRule .9s var(--gh-ease) calc(var(--gh-base) + .8s) forwards;
}
@keyframes ghFadeUp { to { opacity: 1; transform: none; } }
@keyframes ghRule { to { width: 90px; } }

/* Overlapping logo */
.logo-wrapper { position: relative; z-index: 3; display: flex; justify-content: center; margin-top: -80px; }
.logo-ring {
    position: relative; width: 108px; height: 108px; border-radius: 50%; background: #fff; padding: 5px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .2), 0 0 0 3px var(--gnc-gold);
    animation: ghPop .9s cubic-bezier(.34, 1.56, .64, 1) calc(var(--gh-base) + .5s) both;
}
@keyframes ghPop { from { opacity: 0; transform: scale(.45) translateY(18px); } to { opacity: 1; transform: none; } }
.overlap-logo { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; display: block; }

/* =============================================================
   JOURNEY HEADER
   ============================================================= */
.journey-section { background-color: var(--gnc-white); text-align: center; padding: 2.8rem 1rem 4rem; }
.journey-title {
    color: var(--gnc-green-light); font-family: 'Noto Serif', serif; font-weight: 800;
    font-size: clamp(1.9rem, 4.6vw, 2.8rem); line-height: 1.15; margin: 0 0 .4rem;
}
.title-underline { width: 85px; height: 4px; background: var(--gnc-gold); margin: .9rem auto 1.1rem; border-radius: 2px; }
.journey-sub { font-family: 'Inter', sans-serif; font-size: 1rem; color: #5d6b62; max-width: 520px; margin: 0 auto; line-height: 1.6; }

/* =============================================================
   REVEAL ANIMATIONS (only hidden when JS runs)
   ============================================================= */
.gh-js .reveal-up {
    opacity: 0; transform: translateY(42px);
    transition: opacity .8s var(--gh-ease), transform .8s var(--gh-ease);
}
.gh-js .reveal-up.from-left  { transform: translateX(-56px); }
.gh-js .reveal-up.from-right { transform: translateX(56px); }
.gh-js .reveal-up.is-visible { opacity: 1; transform: none; }

.gh-js .reveal-scale {
    opacity: 0; transform: translateX(-50%) scale(0);
    transition: opacity .5s cubic-bezier(.34, 1.56, .64, 1), transform .5s cubic-bezier(.34, 1.56, .64, 1);
    transition-delay: .15s;
}
.gh-js .reveal-scale.is-visible { opacity: 1; transform: translateX(-50%) scale(1); }

/* =============================================================
   TIMELINE (same layout: centre line, gold dots, alternating sides)
   ============================================================= */
.timeline-section { background-color: var(--gnc-white); padding: 0 1rem 5rem; overflow-x: clip; }
.timeline-container { position: relative; max-width: 940px; margin: 0 auto; }

/* the centre line: a pale track with a green-to-gold fill that grows on scroll */
.timeline-track {
    position: absolute; top: 14px; bottom: 0; left: 50%; width: 3px;
    background: #d9e2db; border-radius: 3px; transform: translateX(-50%);
}
.timeline-fill {
    width: 100%; height: 0; border-radius: 3px;
    background: linear-gradient(to bottom, var(--gnc-gold), var(--gnc-green-light));
    box-shadow: 0 0 12px rgba(234, 186, 59, .6);
}

.timeline-item {
    position: relative; display: flex; justify-content: space-between; align-items: flex-start;
    width: 100%; margin-bottom: 4.5rem;
}

/* gold dots */
.timeline-dot {
    position: absolute; left: 50%; top: 4px; width: 20px; height: 20px; z-index: 2;
    background: var(--gnc-gold); border: 4px solid var(--gnc-white); border-radius: 50%;
    box-shadow: 0 0 0 2px var(--gnc-gold);
    transform: translateX(-50%);
}
.timeline-dot::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--gnc-gold);
    opacity: 0; transform: scale(1);
}
/* The reveal animation sets transform too; keep the dot centered on the track while scaling. */
.gh-js .timeline-dot.reveal-scale { transform: translateX(-50%) scale(0); }
.gh-js .timeline-dot.reveal-scale.is-visible { transform: translateX(-50%) scale(1); }
.timeline-item.is-active .timeline-dot { background: var(--gnc-green); box-shadow: 0 0 0 2px var(--gnc-gold), 0 0 14px rgba(234, 186, 59, .8); }
.timeline-item.is-active .timeline-dot::after { animation: ghDot 1.8s ease-out infinite; }
@keyframes ghDot { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }

.timeline-content { width: 45%; }
.timeline-text { text-align: left; }
.timeline-item:nth-child(even) .timeline-text { text-align: right; }

.timeline-year {
    color: var(--gnc-green); font-family: 'Noto Serif', serif; font-weight: 800;
    font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.1; margin: 0 0 .25rem;
    transition: color .4s;
}
.timeline-item.is-active .timeline-year { color: var(--gnc-green-light); }

.timeline-subtitle {
    position: relative; display: inline-block;
    color: var(--gnc-red); font-family: 'Noto Serif', serif; font-weight: 700; font-size: 1.12rem;
    margin: 0 0 1.1rem; padding-bottom: .5rem;
}
.timeline-subtitle::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--gnc-gold);
    transition: width .9s var(--gh-ease) .35s;
}
.timeline-item:nth-child(even) .timeline-subtitle::after { left: auto; right: 0; }
.timeline-text.is-visible .timeline-subtitle::after,
html:not(.gh-js) .timeline-subtitle::after { width: 100%; }

.timeline-text p {
    font-family: 'Inter', sans-serif; font-size: .94rem; line-height: 1.75; color: var(--gnc-dark); margin: 0 0 1rem;
}
.timeline-text p:last-child { margin-bottom: 0; }

/* PHOTO SLOT: the gray box (same gray, same shape as before) */
.timeline-image-placeholder {
    position: relative; overflow: hidden; width: 100%; height: 200px;
    background-color: #D9D9D9;
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(9, 64, 36, .12);
    border-bottom: 4px solid var(--gnc-gold);
    transition: transform .4s var(--gh-ease), box-shadow .4s ease;
}
.timeline-image-placeholder img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease;
}
.history-photo-hint { display: grid; place-content: center; height: 100%; color: #66736b; font: 600 .95rem 'Inter', sans-serif; text-align: center; }
.history-photo-hint i { display: block; font-size: 1.5rem; margin-bottom: .35rem; }
.timeline-image-placeholder::after {      /* light sweep on hover */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .45) 50%, transparent 60%);
    transform: translateX(-130%); transition: transform .9s ease;
}
.timeline-item:hover .timeline-image-placeholder { transform: translateY(-5px); box-shadow: 0 18px 36px rgba(9, 64, 36, .22); }
.timeline-item:hover .timeline-image-placeholder img { transform: scale(1.06); }
.timeline-item:hover .timeline-image-placeholder::after { transform: translateX(130%); }

/* =============================================================
   QUOTE BANNER (same look: green box with gold quote marks)
   ============================================================= */
.quote-banner-section { background-color: var(--gnc-white); padding: 0 1rem 5.5rem; }
.quote-banner-box {
    position: relative; overflow: hidden; max-width: 1000px; margin: 0 auto;
    padding: 4rem 5rem; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background-image: linear-gradient(135deg, rgba(9, 64, 36, .94), rgba(6, 45, 25, .96)), var(--history-quote-background, url('/assets/images/gnc-header.png'));
    background-size: cover; background-position: center;
    border-bottom: 5px solid var(--gnc-gold);
    box-shadow: 0 18px 40px rgba(9, 64, 36, .22);
}
.quote-banner-box::before {
    content: ''; position: absolute; width: 340px; height: 340px; right: -110px; top: -150px; border-radius: 50%;
    background: radial-gradient(circle, rgba(234, 186, 59, .28), transparent 65%);
    animation: ghGlow 8s ease-in-out infinite alternate;
}
.history-background-edit {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    max-width: calc(100% - 24px); padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .65); border-radius: 6px;
    background: #094024; color: #fff; font: 600 12px/1.4 'Inter', sans-serif;
    cursor: pointer;
}
.history-background-edit:hover { background: #1f5e2c; }
.history-background-edit:focus-visible { outline: 3px solid var(--gnc-gold); outline-offset: 3px; }
@keyframes ghGlow { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.15); opacity: 1; } }
.quote-text {
    position: relative; z-index: 1; color: #fff; font-family: 'Noto Serif', serif; font-style: italic;
    font-size: clamp(1.1rem, 2.3vw, 1.4rem); line-height: 1.65; margin: 0; max-width: 720px;
}
.quote-mark { position: absolute; z-index: 1; color: var(--gnc-gold); font-family: 'Noto Serif', serif; font-size: 5.5rem; line-height: 1; }
.quote-left  { top: 1rem; left: 2rem; }
.quote-right { bottom: -.5rem; right: 2rem; }

/* Keep CMS-authored rich text aligned with the original history-page typography. */
.hero-eyebrow p, .hero-title p, .journey-title p, .journey-sub p, .quote-text p { margin: 0; }
.timeline-text h2, .timeline-text h3 { font-family: 'Noto Serif', serif; }
.timeline-text h2 { color: var(--gnc-green); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.1; margin: 0 0 .25rem; text-align: left; }
.timeline-text h3 { position: relative; display: table; color: var(--gnc-red); font-weight: 700; font-size: 1.12rem; margin: 0 0 1.1rem; padding-bottom: .5rem; text-align: left; }
.timeline-text h3::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--gnc-gold); }

@media (min-width: 769px) {
    .timeline-item > .timeline-text:first-child h2,
    .timeline-item > .timeline-text:first-child h3 { text-align: right; }
    .timeline-item > .timeline-text:first-child h3 { margin-left: auto; }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
    .history-hero { --history-curve-height: 60px; min-height: 240px; padding: 3.5rem 1rem 5rem; }
    .logo-wrapper { margin-top: -50px; }
    .logo-ring { width: 84px; height: 84px; padding: 4px; }
    .journey-section { padding: 2.2rem 1rem 3rem; }

    /* line moves to the left edge, items stack */
    .timeline-track { left: 20px; transform: none; }
    .timeline-item, .timeline-item:nth-child(even) { flex-direction: column; padding-left: 50px; margin-bottom: 3.5rem; }
    .timeline-dot { left: 12px; transform: none; }
    .gh-js .timeline-dot.reveal-scale,
    .gh-js .timeline-dot.reveal-scale.is-visible { transform: none; }
    .gh-js .reveal-scale { transform: scale(0); }
    .gh-js .reveal-scale.is-visible { transform: scale(1); }
    .timeline-content { width: 100%; margin-bottom: 1.4rem; }
    .timeline-item:nth-child(even) .timeline-text { text-align: left; }
    .timeline-item:nth-child(even) .timeline-subtitle::after { left: 0; right: auto; }
    .gh-js .reveal-up.from-left, .gh-js .reveal-up.from-right { transform: translateY(34px); }
    .gh-js .reveal-up.is-visible { transform: none; }
    .timeline-image-placeholder { height: 190px; }

    .quote-banner-box { padding: 3.2rem 1.8rem 2.8rem; }
    .quote-mark { font-size: 3.6rem; }
    .quote-left { top: .4rem; left: 1rem; }
    .quote-right { bottom: -.9rem; right: 1rem; }
}

/* =============================================================
   OPENING TRANSITION (same wipe as the Contact Us page)
   6 green panels slide up and reveal the page. Pure CSS; the whole
   layer is also hidden at the end so it can never block the page.
   ============================================================= */
.gh-open {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; pointer-events: none;
    animation: ghOpenGone 0s linear 1.7s forwards;
}
.gh-open > i {
    flex: 1; margin-right: -1px;
    background: var(--gnc-green);
    animation: ghOpenWipe .85s cubic-bezier(.76, 0, .24, 1) forwards;
    animation-delay: calc(.35s + var(--n, 0) * .07s);
}
.gh-open > i:nth-child(even) { background: #083320; }
.gh-open-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem;
    color: var(--gnc-gold); text-align: center;
    animation: ghOpenLabel 1.1s ease forwards;
}
.gh-open-label img { width: 64px; height: 64px; object-fit: contain; }
.gh-open-label span {
    font-family: 'Noto Serif', serif; font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: .02em;
}
@keyframes ghOpenWipe { to { transform: translateY(-101%); } }
@keyframes ghOpenGone { to { visibility: hidden; } }
@keyframes ghOpenLabel {
    0%   { opacity: 0; transform: translateY(14px); }
    30%  { opacity: 1; transform: none; }
    70%  { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
    .gh-open { display: none; }
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-dust i, .quote-banner-box::before,
    .timeline-item.is-active .timeline-dot::after { animation: none !important; }
    .hero-eyebrow, .hero-title, .logo-ring { animation: none !important; opacity: 1 !important; transform: none !important; }
    .hero-rule { animation: none !important; width: 90px; }
    .gh-js .reveal-up, .gh-js .reveal-scale { opacity: 1 !important; transition: none !important; }
    .gh-js .reveal-up { transform: none !important; }
    .gh-js .reveal-scale { transform: translateX(-50%) !important; }
    .timeline-subtitle::after { width: 100% !important; transition: none !important; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
    .gh-js .reveal-scale { transform: none !important; }
}
