/* ============================
   FinPulse HK — Design System
   ============================ */

/* --- CSS Custom Properties --- */
:root {
  --bg: #0d0d0f;
  --bg-card: rgba(25, 22, 18, 0.7);
  --bg-card-hover: rgba(40, 33, 22, 0.85);
  --surface: #1a1610;
  --text: #f0ece4;
  --text-muted: #a89e8c;
  --accent: #f58a07;
  --accent-light: #ffb347;
  --accent-dark: #c06a00;
  --accent-glow: rgba(245, 138, 7, 0.25);
  --gradient: linear-gradient(135deg, #f58a07, #ffb347, #f58a07);
  --border: rgba(245, 138, 7, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', monospace;
  --max-w: 1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  line-height:1.7;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img,svg{display:block;max-width:100%}
button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
input{font:inherit}

/* --- Animated Background --- */
.bg-grid{
  position:fixed;inset:0;z-index:-2;
  background-image:
    linear-gradient(rgba(245,138,7,0.03) 1px,transparent 1px),
    linear-gradient(90deg,rgba(245,138,7,0.03) 1px,transparent 1px);
  background-size:60px 60px;
}
.bg-glow{
  position:fixed;z-index:-1;
  width:600px;height:600px;
  border-radius:50%;
  filter:blur(120px);
  opacity:0.15;
  pointer-events:none;
}
.bg-glow--1{top:-200px;right:-100px;background:var(--accent)}
.bg-glow--2{bottom:-200px;left:-100px;background:var(--accent-dark)}

/* --- Utilities --- */
.text-gradient{
  background:var(--gradient);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

/* --- Navigation --- */
.nav{
  position:fixed;top:0;left:0;right:0;z-index:100;
  display:flex;align-items:center;justify-content:space-between;
  padding:1rem 2rem;
  background:rgba(13,13,15,0.6);
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid transparent;
  transition:var(--transition);
}
.nav--scrolled{
  background:rgba(13,13,15,0.92);
  border-bottom-color:var(--border);
  box-shadow:0 4px 30px rgba(0,0,0,0.3);
}
.nav__logo{
  display:flex;align-items:center;gap:0.6rem;
  font-size:1.25rem;font-weight:700;letter-spacing:-0.02em;
}
.nav__logo em{color:var(--accent);font-style:normal}
.nav__icon{width:36px;height:36px}
.nav__links{display:flex;gap:0.25rem}
.nav__link{
  padding:0.5rem 1rem;
  border-radius:var(--radius-sm);
  font-size:0.9rem;font-weight:500;
  color:var(--text-muted);
  transition:var(--transition);
}
.nav__link:hover,.nav__link--active{color:var(--text);background:var(--accent-glow)}
.nav__toggle{display:none;width:40px;height:40px;padding:8px}
@media(max-width:768px){
  .nav__links{
    position:fixed;top:64px;left:0;right:0;
    flex-direction:column;padding:1rem;
    background:rgba(13,13,15,0.96);
    backdrop-filter:blur(20px);
    border-bottom:1px solid var(--border);
    transform:translateY(-120%);transition:var(--transition);
  }
  .nav__links--open{transform:translateY(0)}
  .nav__toggle{display:block}
}

/* --- Hero --- */
.hero{
  min-height:100vh;
  display:flex;align-items:center;
  padding:8rem 2rem 4rem;
  max-width:var(--max-w);margin:0 auto;
  gap:3rem;
}
.hero__content{flex:1;max-width:600px}
.hero__tag{
  display:inline-block;
  padding:0.4rem 1rem;
  background:var(--accent-glow);
  border:1px solid var(--border);
  border-radius:999px;
  font-size:0.85rem;
  color:var(--accent-light);
  margin-bottom:1.5rem;
  animation:fadeInUp 0.6s ease-out;
}
.hero__title{
  font-size:clamp(2.5rem,5vw,4rem);
  font-weight:800;
  line-height:1.15;
  letter-spacing:-0.03em;
  margin-bottom:1.5rem;
  animation:fadeInUp 0.6s ease-out 0.1s both;
}
.hero__desc{
  font-size:1.15rem;
  color:var(--text-muted);
  max-width:480px;
  margin-bottom:2rem;
  animation:fadeInUp 0.6s ease-out 0.2s both;
}
.hero__cta{
  display:flex;gap:1rem;flex-wrap:wrap;
  animation:fadeInUp 0.6s ease-out 0.3s both;
}
.hero__visual{
  flex:1;max-width:400px;
  animation:fadeInUp 0.8s ease-out 0.4s both;
}
.hero__svg{width:100%;height:auto}
@media(max-width:768px){
  .hero{flex-direction:column;text-align:center;padding-top:6rem}
  .hero__content{max-width:100%}
  .hero__desc{margin-left:auto;margin-right:auto}
  .hero__cta{justify-content:center}
  .hero__visual{max-width:280px}
}

/* --- Buttons --- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:0.75rem 1.75rem;
  border-radius:var(--radius-sm);
  font-weight:600;font-size:0.95rem;
  transition:var(--transition);
  white-space:nowrap;
}
.btn--primary{
  background:var(--accent);color:#000;
  box-shadow:0 0 20px var(--accent-glow);
}
.btn--primary:hover{
  background:var(--accent-light);
  box-shadow:0 0 30px rgba(245,138,7,0.4);
  transform:translateY(-2px);
}
.btn--ghost{
  border:1px solid var(--border);
  color:var(--text-muted);
}
.btn--ghost:hover{
  border-color:var(--accent);color:var(--accent);
  background:var(--accent-glow);
}

/* --- Ticker / Stats --- */
.ticker{
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  padding:2rem;
  background:rgba(26,22,16,0.4);
}
.ticker__inner{
  max-width:var(--max-w);margin:0 auto;
  display:flex;justify-content:space-around;flex-wrap:wrap;gap:1.5rem;
}
.ticker__item{
  display:flex;align-items:center;gap:0.75rem;
  opacity:0;transform:translateY(20px);
  transition:opacity 0.5s,transform 0.5s;
}
.ticker__item.visible{opacity:1;transform:translateY(0)}
.ticker__icon{width:28px;height:28px;flex-shrink:0}
.ticker__item strong{display:block;font-size:1.1rem;color:var(--accent-light)}
.ticker__item span{font-size:0.8rem;color:var(--text-muted)}

/* --- Section Headers --- */
.section-header{text-align:center;margin-bottom:3rem}
.section-title{
  font-size:clamp(1.8rem,3.5vw,2.5rem);
  font-weight:800;letter-spacing:-0.02em;
}
.section-desc{color:var(--text-muted);margin-top:0.5rem}

/* --- Articles Grid --- */
.articles{
  max-width:var(--max-w);margin:0 auto;
  padding:5rem 2rem;
}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(340px,1fr));
  gap:1.5rem;
}
@media(max-width:400px){.grid{grid-template-columns:1fr}}

/* --- Cards --- */
.card{
  position:relative;
  display:flex;flex-direction:column;
  padding:2rem;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  backdrop-filter:blur(10px);
  transition:var(--transition);
  opacity:0;transform:translateY(30px);
  overflow:hidden;
}
.card.visible{opacity:1;transform:translateY(0)}
.card::before{
  content:'';position:absolute;inset:0;z-index:0;
  background:radial-gradient(circle at 30% 0%,var(--accent-glow),transparent 60%);
  opacity:0;transition:opacity 0.4s;
}
.card:hover{
  background:var(--bg-card-hover);
  border-color:rgba(245,138,7,0.3);
  transform:translateY(-4px);
  box-shadow:0 20px 60px rgba(0,0,0,0.4),0 0 40px var(--accent-glow);
}
.card:hover::before{opacity:1}
.card>*{position:relative;z-index:1}

.card--featured{grid-column:1/-1}
@media(min-width:769px){
  .card--featured{
    flex-direction:row;align-items:center;gap:2rem;
  }
  .card--featured .card__icon-wrap{width:180px;flex-shrink:0}
}

.card__badge{
  position:absolute;top:1rem;right:1rem;
  padding:0.25rem 0.75rem;
  background:var(--accent);color:#000;
  border-radius:999px;font-size:0.75rem;font-weight:700;
  z-index:2;
}
.card__icon-wrap{
  width:80px;height:80px;margin-bottom:1rem;
}
.card__icon-wrap svg{width:100%;height:100%}
.card__meta{
  display:flex;align-items:center;gap:0.75rem;
  margin-bottom:0.75rem;
  font-size:0.8rem;color:var(--text-muted);
}
.card__tag{
  padding:0.15rem 0.6rem;
  background:var(--accent-glow);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--accent-light);
  font-size:0.75rem;
}
.card__title{
  font-size:1.25rem;font-weight:700;
  line-height:1.4;margin-bottom:0.5rem;
}
.card__excerpt{
  color:var(--text-muted);font-size:0.9rem;
  flex:1;margin-bottom:1rem;
}
.card__cta{
  font-size:0.9rem;font-weight:600;
  color:var(--accent);
  transition:var(--transition);
}
.card:hover .card__cta{color:var(--accent-light);letter-spacing:0.02em}

/* --- Newsletter --- */
.newsletter{
  padding:5rem 2rem;
}
.newsletter__inner{
  max-width:600px;margin:0 auto;text-align:center;
  padding:3rem;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  position:relative;overflow:hidden;
  opacity:0;transform:translateY(30px);
  transition:opacity 0.6s,transform 0.6s;
}
.newsletter__inner.visible{opacity:1;transform:translateY(0)}
.newsletter__bg-icon{
  position:absolute;right:-40px;top:-40px;
  width:200px;height:200px;opacity:0.3;
}
.newsletter__title{
  font-size:1.8rem;font-weight:800;margin-bottom:0.5rem;
  position:relative;
}
.newsletter__desc{
  color:var(--text-muted);margin-bottom:1.5rem;
  position:relative;
}
.newsletter__form{
  display:flex;gap:0.75rem;position:relative;
  justify-content:center;flex-wrap:wrap;
}
.newsletter__input{
  flex:1;min-width:200px;max-width:320px;
  padding:0.75rem 1rem;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  transition:var(--transition);
}
.newsletter__input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-glow);
}

/* --- Footer --- */
.footer{
  border-top:1px solid var(--border);
  padding:3rem 2rem 1.5rem;
  background:rgba(13,13,15,0.8);
}
.footer__inner{
  max-width:var(--max-w);margin:0 auto;
  display:flex;gap:4rem;flex-wrap:wrap;
}
.footer__brand{max-width:300px}
.footer__brand p{color:var(--text-muted);margin-top:1rem;font-size:0.9rem}
.footer__brand .nav__logo{margin-bottom:0.5rem}
.footer__links{display:flex;flex-direction:column;gap:0.5rem}
.footer__links h4{color:var(--accent);font-size:0.85rem;text-transform:uppercase;letter-spacing:0.08em;margin-bottom:0.25rem}
.footer__links a{color:var(--text-muted);font-size:0.9rem;transition:var(--transition)}
.footer__links a:hover{color:var(--accent-light)}
.footer__bottom{
  max-width:var(--max-w);margin:2rem auto 0;
  padding-top:1.5rem;
  border-top:1px solid var(--border);
  text-align:center;
  font-size:0.8rem;color:var(--text-muted);
}

/* --- SVG Line Animations --- */
.anim-line{
  stroke-dasharray:200;
  stroke-dashoffset:200;
  animation:drawLine 2s ease-out forwards;
}
.anim-line--1{animation-delay:0.1s}
.anim-line--2{animation-delay:0.2s}
.anim-line--3{animation-delay:0.3s}
.anim-line--4{animation-delay:0.4s}
.anim-line--5{animation-delay:0.5s}
.anim-line--6{animation-delay:0.6s}
.anim-line--7{animation-delay:0.7s}
.anim-line--8{animation-delay:0.8s}

.anim-node{
  opacity:0;
  animation:nodeAppear 0.4s ease-out forwards;
}
.anim-node--1{animation-delay:0.3s}
.anim-node--2{animation-delay:0.5s}
.anim-node--3{animation-delay:0.5s}
.anim-node--4{animation-delay:0.7s}
.anim-node--5{animation-delay:0.7s}
.anim-node--6{animation-delay:0.9s}

@keyframes drawLine{to{stroke-dashoffset:0}}
@keyframes nodeAppear{to{opacity:1}}
@keyframes fadeInUp{
  from{opacity:0;transform:translateY(20px)}
  to{opacity:1;transform:translateY(0)}
}

/* --- Article Page Styles --- */
.article-page{
  max-width:800px;margin:0 auto;
  padding:7rem 2rem 4rem;
}
.article-page__back{
  display:inline-flex;align-items:center;gap:0.5rem;
  color:var(--accent);font-weight:600;font-size:0.9rem;
  margin-bottom:2rem;transition:var(--transition);
}
.article-page__back:hover{color:var(--accent-light);gap:0.75rem}
.article-page__meta{
  display:flex;align-items:center;gap:1rem;
  margin-bottom:1.5rem;font-size:0.85rem;color:var(--text-muted);
}
.article-page h1{
  font-size:clamp(2rem,4vw,3rem);
  font-weight:800;line-height:1.2;
  letter-spacing:-0.02em;
  margin-bottom:1.5rem;
}
.article-page__lead{
  font-size:1.15rem;color:var(--text-muted);
  border-left:3px solid var(--accent);
  padding-left:1.25rem;margin-bottom:2.5rem;
}
.article-page h2{
  font-size:1.5rem;font-weight:700;
  margin:2.5rem 0 1rem;
  color:var(--accent-light);
}
.article-page h3{
  font-size:1.15rem;font-weight:600;
  margin:2rem 0 0.75rem;
  color:var(--text);
}
.article-page p{
  margin-bottom:1.25rem;
  color:var(--text-muted);
  line-height:1.85;
}
.article-page ul,.article-page ol{
  margin:0 0 1.5rem 1.5rem;
  color:var(--text-muted);
}
.article-page li{margin-bottom:0.5rem;line-height:1.7}
.article-page li::marker{color:var(--accent)}
.article-page blockquote{
  border-left:3px solid var(--accent);
  padding:1rem 1.5rem;
  margin:1.5rem 0;
  background:var(--bg-card);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  color:var(--text-muted);
  font-style:italic;
}
.article-page code{
  font-family:var(--font-mono);
  background:var(--surface);
  padding:0.15rem 0.4rem;
  border-radius:4px;
  font-size:0.9em;
  color:var(--accent-light);
}

/* Info Box */
.info-box{
  padding:1.5rem;margin:2rem 0;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
}
.info-box__title{
  display:flex;align-items:center;gap:0.5rem;
  font-weight:700;margin-bottom:0.75rem;
  color:var(--accent-light);
}

/* Related articles at bottom */
.related{
  margin-top:4rem;
  padding-top:2rem;
  border-top:1px solid var(--border);
}
.related h3{
  font-size:1.2rem;font-weight:700;margin-bottom:1.5rem;
  color:var(--text);
}
.related__grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:1rem;
}
.related__card{
  padding:1.25rem;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  transition:var(--transition);
}
.related__card:hover{
  border-color:var(--accent);
  transform:translateY(-2px);
  box-shadow:0 8px 30px rgba(0,0,0,0.3);
}
.related__card h4{font-size:1rem;margin-bottom:0.25rem}
.related__card p{font-size:0.8rem;color:var(--text-muted);margin:0}

/* About page */
.about-page{
  max-width:800px;margin:0 auto;
  padding:7rem 2rem 4rem;
}
.about-page h1{
  font-size:clamp(2rem,4vw,3rem);
  font-weight:800;margin-bottom:2rem;
}
.about-avatar{
  width:120px;height:120px;margin-bottom:2rem;
}
.about-page p{
  color:var(--text-muted);margin-bottom:1.25rem;line-height:1.85;
}
.skill-tags{display:flex;flex-wrap:wrap;gap:0.5rem;margin:1.5rem 0}
.skill-tag{
  padding:0.35rem 0.85rem;
  background:var(--accent-glow);
  border:1px solid var(--border);
  border-radius:999px;font-size:0.8rem;
  color:var(--accent-light);
}
