/* =============================================
   MARIA RACHEL M. SALUNA — Portfolio Stylesheet
   ============================================= */

/* ===== Custom Properties ===== */
:root {
  --white:       #ffffff;
  --off-white:   #faf9f7;
  --ink:         #0d0d0d;
  --ink-mid:     #444444;
  --ink-soft:    #777777;
  --ink-faint:   #aaaaaa;
  --border:      #e8e6e3;
  --border-dark: rgba(255,255,255,0.12);
  --accent:      #c17b5a;
  --accent-bg:   rgba(193,123,90,0.08);

  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  --nav-h:    68px;
  --max-w:    1180px;
  --px:       clamp(24px, 5vw, 56px);
  --section-py: clamp(72px, 10vw, 120px);

  --radius:      14px;   /* cards, frames */
  --radius-lg:   22px;   /* large images */
  --radius-sm:   10px;   /* buttons */
  --radius-pill: 999px;  /* tags & badges */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* ===== Layout ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

.section { padding: var(--section-py) 0; }
.section.alt { background: var(--off-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ===== Typography helpers ===== */
.label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.label--light { color: rgba(255,255,255,0.45); }

.heading {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 52px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-dark {
  background: var(--ink);
  color: var(--white);
}
.btn-dark:hover { background: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--white); }


/* =====================
   NAVIGATION
   ===================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: box-shadow 0.3s var(--ease);
}
.nav.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.06); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--ink);
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(3px, 3px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(3px, -3px); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: absolute;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px var(--px) 20px;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.nav-drawer.open { display: flex; }

.drawer-link {
  display: block;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s;
}
.drawer-link:last-child { border-bottom: none; }
.drawer-link:hover { color: var(--accent); padding-left: 8px; }


/* =====================
   HERO
   ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 100px) var(--px);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: clamp(48px, 8vw, 96px);
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7.5vw, 5.8rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: var(--ink-mid);
  line-height: 1.65;
  max-width: 420px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-socials {
  display: flex;
  gap: 20px;
}
.social-pill {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.social-pill:hover { color: var(--accent); border-color: var(--accent); }

/* Hero photo */
.hero-photo { position: relative; }

.photo-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
}
.photo-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(193,123,90,0.08) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}
.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 36px; left: var(--px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-scroll-hint span {
  writing-mode: vertical-lr;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.scroll-track {
  width: 1px;
  height: 56px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.scroll-track::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollDrop 2.2s ease-in-out infinite;
}
@keyframes scrollDrop {
  0%   { top: -100%; }
  50%  { top: 0; }
  100% { top: 100%; }
}


/* =====================
   ABOUT
   ===================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(48px, 8vw, 96px);
  align-items: start;
}

.about-body p {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.8;
  margin-bottom: 22px;
}

.about-stats {
  display: flex;
  gap: clamp(32px, 6vw, 60px);
  padding-top: 40px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 6px;
}

.about-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(15%) contrast(1.02);
  transition: filter 0.4s var(--ease);
}
.about-photo:hover img { filter: grayscale(0%) contrast(1); }


/* =====================
   SKILLS
   ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 44px 64px;
}
.skill-group--wide { grid-column: 1 / -1; }

.skill-group h3 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: color 0.2s, border-color 0.2s;
}
.tag-list li:hover { color: var(--accent); border-color: var(--accent); }


/* =====================
   EXPERIENCE
   ===================== */
.timeline { border-top: 1px solid var(--border); }

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-left { padding-top: 2px; }

.tl-period {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  line-height: 1.5;
}

.tl-role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.tl-company {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.tl-list { display: flex; flex-direction: column; gap: 9px; }
.tl-list li {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}
.tl-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}


/* =====================
   PROJECTS
   ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  perspective: 1200px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(193,123,90,0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 2;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.09);
}

.project-img-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--off-white);
}
.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}
.project-card:hover .project-img-wrap img { transform: scale(1.05); }

.project-hover {
  position: absolute;
  inset: 0;
  background: rgba(13,13,13,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  backdrop-filter: blur(2px);
}
.project-card:hover .project-hover { opacity: 1; }
.project-hover span {
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}
.project-hover span:hover { background: white; color: var(--ink); }

.project-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-type {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.project-links {
  display: flex;
  gap: 12px;
}
.project-links a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.project-links a:hover { color: var(--accent); }

.project-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.project-body p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.65;
  flex: 1;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.stack li {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
  background: var(--off-white);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 6px;
}


/* =====================
   EDUCATION
   ===================== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
}

.edu-col-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.edu-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edu-year {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.edu-item h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 4px;
}
.edu-item p {
  font-size: 0.84rem;
  color: var(--ink-soft);
}
.edu-item em {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-style: italic;
}


/* =====================
   CONTACT
   ===================== */
.contact {
  background: var(--ink);
  padding: var(--section-py) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 96px);
  align-items: start;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 18px 0 20px;
}

.contact-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.75;
}

.contact-right { padding-top: 4px; }

.contact-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border-dark);
  color: var(--white);
  transition: padding-left 0.25s var(--ease);
}
.contact-row:first-child { border-top: 1px solid var(--border-dark); }
a.contact-row:hover { padding-left: 8px; }

.contact-key {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.contact-val {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
}
.contact-val .arrow { color: var(--accent); }

.contact-social {
  display: flex;
  gap: 20px;
}
.contact-social a {
  color: var(--white);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
}
.contact-social a:hover { color: var(--accent); }


/* =====================
   FOOTER
   ===================== */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 22px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-inner p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.28);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.28);
  transition: color 0.2s;
}
.footer-links a:hover { color: white; }


/* =====================
   SCROLL ANIMATIONS
   ===================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.18s; }
[data-reveal][data-delay="3"] { transition-delay: 0.26s; }

/* Hero entrance */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow     { animation: heroIn 0.7s var(--ease) 0.05s both; }
.hero-name        { animation: heroIn 0.85s var(--ease) 0.2s  both; }
.hero-tagline     { animation: heroIn 0.7s var(--ease) 0.38s both; }
.hero-actions     { animation: heroIn 0.7s var(--ease) 0.52s both; }
.hero-socials     { animation: heroIn 0.65s var(--ease) 0.64s both; }
.hero-photo       { animation: heroIn 0.95s var(--ease) 0.28s both; }
.hero-scroll-hint { animation: heroIn 0.7s var(--ease) 0.88s both; }


/* =====================
   SPARKLES + BG GLOW
   ===================== */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  line-height: 1;
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  animation: sparklePop 0.65s ease-out forwards;
  user-select: none;
  will-change: transform, opacity;
}

@keyframes sparklePop {
  0%   { transform: translate(-50%, -50%) scale(0)   rotate(0deg);   opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(1.4) rotate(55deg);  opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0)   rotate(110deg); opacity: 0; }
}

#bgCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  mix-blend-mode: multiply;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero-name, .hero-tagline,
  .hero-actions, .hero-socials, .hero-photo, .hero-scroll-hint {
    animation: none;
  }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}


/* =====================
   RESPONSIVE — 1024px
   ===================== */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 320px;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .edu-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .edu-grid .edu-col:last-child {
    grid-column: 1 / -1;
  }
  .about-grid {
    grid-template-columns: 1fr 260px;
  }
}


/* =====================
   RESPONSIVE — 768px
   ===================== */
@media (max-width: 768px) {
  :root { --section-py: 72px; }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 56px;
    padding-bottom: 72px;
    text-align: center;
  }
  .hero-photo {
    order: -1;
    max-width: 240px;
    margin: 0 auto;
  }
  .photo-wrap { aspect-ratio: 1/1; border-radius: 50%; }
  .photo-wrap::before { border-radius: 50%; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-socials { justify-content: center; }
  .hero-scroll-hint { display: none; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-photo { display: none; }
  .about-stats { gap: 28px; }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .skill-group--wide { grid-column: auto; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 28px 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .edu-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .edu-grid .edu-col:last-child { grid-column: auto; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}


/* =====================
   RESPONSIVE — 480px
   ===================== */
@media (max-width: 480px) {
  .hero-name { font-size: 2.8rem; }

  .btn {
    padding: 12px 22px;
    font-size: 0.82rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .about-stats {
    flex-direction: column;
    gap: 22px;
  }
  .about-stats .stat { text-align: left; }

  .heading { margin-bottom: 36px; }
}
