:root{
  --bg:#fff7ed;--text:#2b2b2b;--muted:#7a5841;--accent:#d97706;--card:#fffaf5
}
:root.dark{--bg:#0b1220;--text:#e6eef8;--muted:#9aa8be;--accent:#f59e0b;--card:#071226}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
.container{max-width:1000px;margin:0 auto;padding:2rem}
.site-header{border-bottom:1px solid rgba(0,0,0,.06);background:transparent}
.header-inner{display:flex;align-items:center;justify-content:space-between}
.brand{margin:0;font-size:1.25rem}
.nav a{margin-right:1rem;color:var(--muted);text-decoration:none}
#theme-toggle{background:transparent;border:0;cursor:pointer;font-size:1.1rem}
.hero{display:flex;align-items:center;min-height:60vh}
.hero-title{font-size:2.25rem;margin:.2rem 0}
.hero-sub{color:var(--muted);margin:0 0 1rem}
.btn{display:inline-block;background:var(--accent);color:white;padding:.6rem 1rem;border-radius:6px;text-decoration:none}
.btn.ghost{background:transparent;border:1px solid rgba(0,0,0,.08);color:var(--text)}
.about,.projects,.contact{padding:3rem 0}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.card{background:var(--card);padding:1rem;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.04);overflow:hidden;word-wrap:break-word}
.card h4{margin:0 0 0.5rem;font-size:1rem}
.card p{margin:0 0 0.5rem;font-size:0.95rem;line-height:1.5}
.link{color:var(--accent);text-decoration:none}
.contact-form{display:grid;gap:.5rem;max-width:600px}
.contact-form label{display:block;font-size:.9rem;color:var(--muted)}
.contact-form input,.contact-form textarea{width:100%;padding:.6rem;border-radius:6px;border:1px solid rgba(0,0,0,.08);background:transparent;color:var(--text)}
.site-footer{border-top:1px solid rgba(0,0,0,.06);padding:1rem 0;text-align:center;color:var(--muted)}

@media (prefers-color-scheme:dark){:root:not(.dark){}}

@media (max-width:600px){.header-inner{padding:0 1rem}.hero{min-height:50vh}.hero-title{font-size:1.6rem}}

/* Music embeds */
.music {padding:3rem 0}
.music .muted{color:var(--muted);margin-top:-.4rem}
.music-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem;margin-top:1rem}
.embed-card{background:var(--card);padding:1rem;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.embed-card h4{margin:0 0 .5rem}
.embed-card iframe{width:100%;height:360px;border:0;border-radius:6px}

@media (max-width:600px){.embed-card iframe{height:240px}}

/* News articles */
.articles{display:flex;flex-direction:column;gap:1.5rem;margin-top:1rem}
.article-card{background:var(--card);padding:1.5rem;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.04);border-left:4px solid var(--accent)}
.article-card h4{margin:0 0 0.5rem;font-size:1.15rem;color:var(--text)}
.article-source{color:var(--muted);font-size:0.85rem;margin:0 0 1rem;display:block}
.article-excerpt{margin:0 0 1rem}
.article-excerpt p{margin:0 0 0.8rem;font-size:0.95rem;line-height:1.6;color:var(--text)}
.article-excerpt p:last-child{margin-bottom:0}
.articles .link{font-weight:500}

/* Contact link color (kept orange as requested) */
.contact a{color:#d97706;text-decoration:none}

/* --- Interactive / animation styles --- */
/* container layout for hero */
.hero{display:flex;align-items:center;gap:2rem;min-height:64vh}
.hero-left{flex:1}
.hero-right{width:320px;position:relative;display:flex;align-items:center;justify-content:center}
.photo-wrap{width:220px;height:220px;border-radius:50%;overflow:hidden;box-shadow:0 8px 30px rgba(16,24,40,.12);border:6px solid rgba(255,255,255,.6);background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(0,0,0,.02))}
.hero-photo{width:100%;height:100%;object-fit:cover;display:block;transform:translateY(4px);}
#hero-canvas{position:absolute;inset:0;border-radius:14px;pointer-events:none}

/* simple fade + slide animation */
.reveal-hero{opacity:0;transform:translateY(10px);transition:opacity .6s ease,transform .6s cubic-bezier(.2,.9,.2,1)}
.reveal-hero.is-visible{opacity:1;transform:none}

/* general reveal for cards and sections */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .6s ease,transform .6s cubic-bezier(.2,.9,.2,1)}
.reveal.visible{opacity:1;transform:none}

/* reduce hero size on small screens */
@media (max-width:800px){
  .hero{flex-direction:column;gap:1rem;padding-top:2rem}
  .hero-right{width:200px}
  .photo-wrap{width:180px;height:180px}
}

/* subtle parallax-ish glow for photo on hover */
.photo-wrap:hover{transform:translateY(-4px)}
.photo-wrap{transition:transform .28s ease,box-shadow .28s ease}

/* ensure canvas sits behind photo content visually */
.hero-right canvas{z-index:0}
.photo-wrap{z-index:1}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion:reduce){
  .reveal-hero,.reveal{transition:none;transform:none;opacity:1}
}

/* Medium embed styles */
.medium-section h3{margin-top:0}
.embed-wrap{height:62vh;border-radius:8px;overflow:hidden;background:var(--card);border:1px solid rgba(0,0,0,.06);position:relative}
.medium-iframe{width:100%;height:100%;border:0;display:block}
.medium-fallback{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(0,0,0,.02));color:var(--muted)}
.medium-fallback .link{font-weight:600}

/* Gallery Section */
.gallery-section{width:100%;overflow:hidden;background:var(--bg);padding:3rem 0}
.gallery-container{width:100%;overflow:hidden;background:var(--bg)}
.gallery-track{display:flex;animation:scroll 30s linear infinite;width:calc(200% + 2rem)}
.gallery-item{flex:0 0 calc(16.666% - 0.167rem);min-width:220px;height:300px;margin-right:1rem;border-radius:8px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,.1);cursor:pointer;transition:transform .3s ease,box-shadow .3s ease}
.gallery-item:hover{transform:scale(1.05);box-shadow:0 8px 24px rgba(0,0,0,.15)}
.gallery-item img{width:100%;height:100%;object-fit:cover;display:block}

@keyframes scroll{
  0%{transform:translateX(0)}
  100%{transform:translateX(-50%)}
}

/* Pause animation on hover */
.gallery-section:hover .gallery-track{animation-play-state:paused}

/* Responsive gallery */
@media (max-width:768px){
  .gallery-item{min-width:180px;height:240px}
  .gallery-track{animation:scroll 25s linear infinite}
}

@media (max-width:480px){
  .gallery-item{min-width:140px;height:180px}
  .gallery-track{animation:scroll 20s linear infinite}
  .gallery-section{padding:2rem 0}
}
