/* ---------- THEME ---------- */
:root{
  --blue-900:#061a44;   /* deep sea */
  --blue-700:#0b2b6b;
  --blue-500:#1141a3;
  --gold-400:#f7c66b;
  --gold-500:#f0b244;
  --red-500:#e24b4b;
  --cream:#f7f3ea;
  --ink:#0b1021;
  --muted:#8aa4d4;
  --card:#0b1f55cc;
  --glass: rgba(255,255,255,0.06);

  --radius-2:12px; --radius-3:18px; --radius-4:26px;
  --shadow-1: 0 10px 30px rgba(0,0,0,.35);
  --shadow-glow: 0 0 20px rgba(247,198,107,.5), 0 0 40px rgba(26,112,255, .35);

  /* Layout rhythm */
  --container: 1120px;
  --grid-gap: 20px;
  --section-pad: clamp(72px, 8vw, 112px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--cream);
  background: radial-gradient(1200px 800px at 20% -10% , #123a9a 0%, #071739 36%, #051230 100%);
  font-family:"Poppins","Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.6; overflow-x:hidden;
}

/* Reset heading margins so spacing is consistent everywhere */
h1,h2,h3,h4,h5,h6{margin:0 0 .5em}
p{margin:.5em 0 0}

/* Containers + sections */
.container{
  width:min(var(--container), 92vw);
  margin-inline:auto;
  padding-inline: clamp(8px, 2vw, 16px); /* guard against edge clipping */
}
.section{
  padding-block: var(--section-pad);
  position:relative;
}
.section-head{
  margin: 0 auto clamp(18px, 2.5vw, 28px);
  text-align:center;              /* center all section headers */
  max-width: 820px;               /* same wrap width across pages */
}
.section-title{
  font-weight:800; letter-spacing:.3px; font-size:clamp(26px, 2vw + 16px, 40px);
  text-shadow:0 2px 0 rgba(0,0,0,.35)
}
.section-sub{color:var(--muted)}

/* ---------- PARTICLES CANVAS ---------- */
#particles{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
}

/* ---------- HEADER ---------- */
.site-header{
  position:sticky; top:0; z-index:50; backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(5,14,34,.75), rgba(5,14,34,.25));
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding-block:12px;
}
.logo{
  font-weight:800; color:var(--gold-400); text-decoration:none; font-size:20px; padding:.4rem .8rem;
  border-radius:999px; border:1px solid rgba(247,198,107,.45);
}
nav{display:flex; align-items:center; gap: clamp(10px, 2vw, 18px);}
nav a{
  color:#dfe7ff; text-decoration:none; font-weight:600; opacity:.9; padding:.4rem .2rem
}
nav a:hover{opacity:1; text-shadow:0 0 12px rgba(255,255,255,.28)}
nav .cta{
  padding:.5rem .9rem; border-radius:999px; border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

/* ---------- HERO ---------- */
.hero{padding-top: clamp(96px, 10vw, 140px)}
.hero-grid{
  display:grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: var(--grid-gap);
  align-items: center;            /* vertical alignment fix */
}
.hero-copy{max-width: 640px; justify-self: start}
.eyebrow{letter-spacing:.16em; text-transform:uppercase; color:var(--muted); font-size:12px; margin:0 0 10px}
.handwritten{font-family:"Caveat", cursive}
.name{
  font-size:clamp(44px, 7vw, 88px); color:#fff; line-height:1;
  text-wrap: balance;
  text-shadow:0 0 0 transparent, 0 14px 40px rgba(12, 51, 146, .65);
}
.title{font-weight:700; margin:10px 0 12px}
.subtitle{color:#c6d7ff; max-width: 60ch}
.hero-actions{display:flex; gap:12px; margin-top:18px; flex-wrap:wrap}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer;
  border-radius:999px; padding:.8rem 1.1rem; font-weight:700; text-decoration:none; transition:transform .2s ease, box-shadow .2s ease;
}
.btn:hover{transform:translateY(-2px)}
.btn-gold{
  color:#1b1202; background:linear-gradient(180deg, var(--gold-400), var(--gold-500));
  box-shadow: var(--shadow-1), 0 0 0 2px rgba(247,198,107,.35) inset;
}
.btn-outline{
  color:#def; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.05)
}
.hero-art{position:relative; min-height:360px; justify-self: end}
.coin-ring, .shipwheel{
  position:absolute; inset:auto; border-radius:50%;
  filter: drop-shadow(0 0 30px rgba(247,198,107,.3));
}
.coin-ring{width:260px; height:260px; right:10%; top:8%;
  background: radial-gradient(circle at 30% 30%, #ffe59e, #f1b547 50%, #af6d1b 70%, #87530e 100%);
  box-shadow:0 0 0 4px rgba(255,255,255,.12) inset;
  animation: spin-slow 16s linear infinite;
}
.shipwheel{width:180px; height:180px; left:8%; bottom:8%;
  background: conic-gradient(from 0deg, #a63c3c, #e24b4b 30%, #a63c3c 60%, #e24b4b 100%);
  mask: radial-gradient(circle at center, transparent 40%, black 41%);
  animation: float 6s ease-in-out infinite;
}
.sparkles{
  position:absolute; inset:0; border-radius:26px;
  box-shadow:
    0 0 120px 30px rgba(26,122,255,.18),
    inset 0 0 80px rgba(247,198,107,.18);
  pointer-events:none;
}

/* ---------- PROJECTS ---------- */
.projects{
  background:linear-gradient(180deg, rgba(17,65,163,.12), rgba(6,26,68,.0));
}
.project-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--grid-gap);
  align-items: stretch;            /* equal height cards */
}
.project-card{
  display:flex; flex-direction:column;  /* fill height */
  overflow:hidden; border-radius:18px;
  background:linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  box-shadow: var(--shadow-1);
  min-height: 300px;
}
.project-card:hover{
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-1), 0 0 30px rgba(26,122,255,.35);
  border-color: rgba(247,198,107,.55);
}
.project-thumb{
  aspect-ratio: 16 / 10; width:100%; object-fit:cover; display:block; flex:0 0 auto;
  background:#0e245c;
}
.project-body{
  display:flex; flex-direction:column; gap:10px; padding:16px; flex:1 1 auto; /* consistent padding+fill */
}
.project-title{font-weight:800; letter-spacing:.2px}
.project-tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:auto} /* pins tags to bottom for equal heights */
.tag{
  font-size:12px; padding:.25rem .5rem; border-radius:999px; border:1px solid rgba(255,255,255,.18);
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
}

/* ---------- SKILLS ---------- */
.skills-toggle{
  display:flex; gap:10px; margin: 0 auto 16px; justify-content:center; /* center the switch */
}
.toggle-btn{
  padding:.6rem 1rem; border-radius:999px; border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.05); color:#e8f0ff; font-weight:700; cursor:pointer;
}
.toggle-btn.active{border-color:rgba(247,198,107,.55); box-shadow:inset 0 0 0 1px rgba(247,198,107,.35)}
.skills-wrap{position:relative}
.skills-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr));
  gap: var(--grid-gap);
  align-items: stretch;            /* equal height cards */
  opacity:0; transform:translateY(8px); pointer-events:none; transition:opacity .25s ease, transform .25s ease;
}
.skills-grid.active{opacity:1; transform:none; pointer-events:auto}
.skill{
  display:flex; flex-direction:column; justify-content:space-between;
  padding:16px; border-radius:14px; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 6px 20px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-height: 120px;
}
.skill:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-1), 0 0 26px rgba(62,148,255,.35), 0 0 18px rgba(247,198,107,.35) inset;
  border-color: rgba(247,198,107,.55);
}
.skill h5{margin:2px 0 8px; font-weight:800}
.skill .level{color:var(--muted); font-size:13px}

/* ---------- ABOUT ---------- */
.about-grid{
  display:grid; grid-template-columns:1.1fr .9fr; gap: var(--grid-gap);
  align-items: stretch;           /* equal height columns */
}
.about-card{
  padding:18px; background:linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12); border-radius:18px; box-shadow:var(--shadow-1);
  height:100%;
}
.about-list{margin:10px 0 0 16px}
.about-stats{
  display:grid; grid-template-columns:repeat(2,1fr); gap: var(--grid-gap);
  height:100%;
}
.stat{
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.12); border-radius:18px; text-align:center; padding:18px 10px;
  box-shadow: var(--shadow-1);
  display:flex; flex-direction:column; justify-content:center;
}
.stat-num{font-size:clamp(28px, 4vw, 48px); font-weight:800; color:var(--gold-400); text-shadow:0 0 20px rgba(247,198,107,.35)}
.stat-label{color:var(--muted)}

/* ---------- CONTACT ---------- */
.contact{isolation:isolate}
.sea-wave{
  position:absolute; inset:0; z-index:-1;
  background: radial-gradient(1000px 400px at 50% 120%, rgba(27,112,255,.22), transparent 60%),
              radial-gradient(1200px 500px at 50% -40%, rgba(27,112,255,.16), transparent 60%);
  animation: tide 14s ease-in-out infinite alternate;
  opacity:.8;
}
.contact-form{
  padding:16px; border-radius:18px; background:rgba(5,14,34,.45);
  backdrop-filter: blur(10px);
  max-width: 760px;               /* centers + consistent width */
  margin-inline:auto;
}
.form-row{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
label{font-weight:700}
input, textarea{
  width:100%; padding:12px 14px; border-radius:12px; color:#eaf1ff; background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12); outline:none;
}
input:focus, textarea:focus{border-color:rgba(247,198,107,.6); box-shadow:0 0 0 3px rgba(247,198,107,.15)}
.error{min-height:18px; font-size:12px; color:#ffb3b3}
.form-status{margin-top:10px; color:#bde3b6}

.btn-send{
  position:relative; overflow:hidden; border:none; color:#0f162e; font-weight:900;
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  box-shadow: var(--shadow-1), 0 0 0 2px rgba(247,198,107,.35) inset;
}
.btn-send .btn-glow{
  position:absolute; inset:-30% -30%; background: radial-gradient(circle at var(--x,50%) var(--y,50%), rgba(255,255,255,.6), transparent 40%);
  mix-blend-mode: soft-light; transition:opacity .2s ease; opacity:.8; pointer-events:none;
}

/* ---------- FOOTER ---------- */
.site-footer{
  padding:30px 0; border-top:1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(6,26,68,.55), rgba(6,26,68,.1));
}
.footer-grid{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.socials{display:flex; gap:14px}
.socials a{color:#dfe7ff; text-decoration:none}
.socials a:hover{text-shadow:0 0 10px rgba(255,255,255,.3)}

/* ---------- GLOW + ANIMATIONS ---------- */
.glow-outline{
  box-shadow: 0 0 0 1px rgba(247,198,107,.3) inset, 0 0 30px rgba(26,122,255,.25);
}
[data-animate]{opacity:0; transform:translateY(12px); transition: transform .6s cubic-bezier(.21,1,.21,1), opacity .6s}
.in-view{opacity:1; transform:none}
[data-animate="float-in"]{transform: translateY(8px) scale(.98)}
[data-animate="slide-up"]{transform: translateY(16px)}
@keyframes spin-slow{to{transform:rotate(360deg)}}
@keyframes float{50%{transform:translateY(-8px)}}
@keyframes tide{to{background-position: 50% 130%, 50% -30%}}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px){
  .hero-grid{grid-template-columns:1fr; text-align:center}
  .hero-copy{justify-self:center}
  .hero-actions{justify-content:center}
  .hero-art{justify-self:center}
  .about-grid{grid-template-columns:1fr}
}
@media (max-width: 640px){
  nav{gap:10px}
  .project-grid{grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))}
  .skills-grid{grid-template-columns: repeat(auto-fit, minmax(170px, 1fr))}
}
