/* ═══════════════════════════════════════════════════
   style.css — aLeap Portfolio
   Warm beige / tan / dark-brown aesthetic
   Font: Playfair Display (headings) + Poppins (body)
═══════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  /* Colors */
  --clr-bg:         #f5efe6;        /* warm off-white / beige */
  --clr-surface:    #ede3d4;        /* card surface */
  --clr-surface-2:  #e4d5be;        /* deeper card */
  --clr-tan:        #c8a882;        /* tan accent */
  --clr-tan-dark:   #a0714f;        /* darker tan */
  --clr-brown:      #6b3f1f;        /* medium brown */
  --clr-dark:       #3d1f00;        /* dark brown – primary text */
  --clr-muted:      #8c6a4a;        /* muted text */
  --clr-gold:       #c07c2b;        /* GPA badge accent */
  --clr-white:      #fffdf8;        /* near-white */

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(61,31,0,.08);
  --shadow-md: 0 6px 24px rgba(61,31,0,.12);
  --shadow-lg: 0 16px 48px rgba(61,31,0,.18);
  --shadow-card-hover: 0 20px 50px rgba(61,31,0,.22);

  /* Radii */
  --radius-sm:  8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --dur-fast:   180ms;
  --dur-mid:    320ms;
  --dur-slow:   520ms;

  /* Layout */
  --max-w: 1100px;
  --section-py: 80px;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--clr-bg);
  color: var(--clr-dark);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

button, [role="button"] { cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* ─── UTILITY: FADE-IN ON SCROLL ─── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%, #e8d4b4 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 80%, #d4b896 0%, transparent 55%),
    var(--clr-bg);
  padding: 100px 24px 80px;
}

/* Noise grain overlay */
.hero__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: .6;
}

/* Decorative blobs */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero__blob--1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #e0c49a55, transparent 70%);
  top: -120px; left: -100px;
}
.hero__blob--2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #c8a88244, transparent 70%);
  bottom: -80px; right: -80px;
}

.hero__container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  max-width: 640px;
}

/* Avatar */
.hero__avatar-wrap {
  position: relative;
}
.hero__avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--clr-white);
  box-shadow: var(--shadow-lg), 0 0 0 6px var(--clr-tan);
  transition: transform var(--dur-mid) var(--ease-out);
}
.hero__avatar:hover { transform: scale(1.04); }
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Eyebrow */
.hero__eyebrow {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--clr-tan-dark);
  background: rgba(200,168,130,.15);
  padding: 5px 14px;
  border-radius: 99px;
  display: inline-block;
}

/* Name */
.hero__name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--clr-dark);
  letter-spacing: -.01em;
}

/* GPA Badge */
.hero__gpa-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--clr-dark);
  color: var(--clr-white);
  padding: 8px 20px;
  border-radius: 99px;
  box-shadow: var(--shadow-md);
}
.hero__gpa-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--clr-tan);
}
.hero__gpa-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-gold);
}

/* Bio */
.hero__bio {
  font-size: 1rem;
  color: var(--clr-muted);
  font-weight: 400;
  max-width: 420px;
  line-height: 1.75;
}
.br-desktop { display: none; }
@media (min-width: 600px) { .br-desktop { display: block; } }

/* Socials in hero */
.hero__socials {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 4px;
}

/* ─── Social Icon ─── */
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--clr-white);
  border: 1.5px solid var(--clr-surface-2);
  color: var(--clr-dark);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast),
              color var(--dur-fast),
              box-shadow var(--dur-fast);
}
.social-icon svg { width: 18px; height: 18px; }
.social-icon:hover {
  transform: scale(1.15) translateY(-2px);
  background: var(--clr-dark);
  color: var(--clr-tan);
  box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════
   NAVIGATION TABS
═══════════════════════════════════════════════════ */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,239,230,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200,168,130,.3);
  padding: 0 24px;
}
.tab-nav__inner {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 4px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.tab-btn {
  position: relative;
  background: none;
  border: none;
  padding: 18px 28px;
  font-family: 'Poppins', sans-serif;
  font-size: .88rem;
  font-weight: 500;
  color: var(--clr-muted);
  letter-spacing: .04em;
  transition: color var(--dur-fast);
  z-index: 1;
}
.tab-btn:hover { color: var(--clr-dark); }
.tab-btn.active { color: var(--clr-dark); font-weight: 600; }

/* Animated underline indicator */
.tab-nav__indicator {
  position: absolute;
  bottom: 0;
  height: 2.5px;
  background: var(--clr-dark);
  border-radius: 2px;
  transition: left var(--dur-mid) var(--ease-out),
              width var(--dur-mid) var(--ease-out);
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT WRAPPER
═══════════════════════════════════════════════════ */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── SECTION BASE ─── */
.section {
  padding: var(--section-py) 0;
  scroll-margin-top: 64px; /* offset for sticky nav */
}
.section + .section {
  border-top: 1px solid rgba(200,168,130,.25);
}

.section__header {
  margin-bottom: 48px;
  text-align: center;
}
.section__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--clr-dark);
  line-height: 1.15;
  margin-bottom: 8px;
}
.section__subtitle {
  font-size: .9rem;
  color: var(--clr-muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════
   CARD GRID
═══════════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.card-grid--learning {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card-grid--hobbies {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ─── CARD SHARED STYLES ─── */
.project-card,
.learning-card,
.hobby-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
  outline: none;
}
.project-card:hover,
.learning-card:hover,
.hobby-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--shadow-card-hover);
}
.project-card:focus-visible,
.learning-card:focus-visible,
.hobby-card:focus-visible {
  outline: 2px solid var(--clr-brown);
  outline-offset: 3px;
}

/* Card image wrapper */
.card__img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.project-card:hover .card__img-wrap img,
.learning-card:hover .card__img-wrap img,
.hobby-card:hover .card__img-wrap img {
  transform: scale(1.06);
}

/* Card overlay */
.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(40,18,0,.82) 0%, rgba(40,18,0,.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  transition: background var(--dur-mid);
}
.project-card:hover .card__overlay,
.hobby-card:hover .card__overlay {
  background: linear-gradient(to top, rgba(40,18,0,.9) 0%, rgba(40,18,0,.35) 60%, transparent 100%);
}

.card__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--clr-white);
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

.card__hint {
  font-size: .75rem;
  color: rgba(255,253,248,.65);
  margin-top: 4px;
  font-weight: 400;
  transition: opacity var(--dur-fast);
}

/* ─── STATUS BADGE ─── */
/* Injected by JS on .project-card */
.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status-badge--completed {
  background: rgba(61,31,0,.75);
  color: var(--clr-tan);
  border: 1px solid rgba(200,168,130,.4);
}
.status-badge--ongoing {
  background: rgba(192,124,43,.85);
  color: #fff8ec;
  border: 1px solid rgba(255,220,150,.3);
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 36px 24px;
  font-size: .82rem;
  color: var(--clr-muted);
  border-top: 1px solid rgba(200,168,130,.25);
  letter-spacing: .04em;
}

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

/* Backdrop */
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,10,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  animation: backdropIn var(--dur-mid) var(--ease-out) both;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal box */
.modal__box {
  position: relative;
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn var(--dur-slow) var(--ease-out) both;
  max-width: 90vw;
  max-height: 90vh;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(32px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Image-only modal (Setup) */
.modal__box--image {
  width: min(900px, 90vw);
}
.modal__full-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 86vh;
  object-fit: contain;
}

/* Learning modal — flex column so image shrinks and link always shows */
.modal__box--learning {
  display: flex;
  flex-direction: column;
  width: min(900px, 90vw);
  max-height: 90vh;
}
.modal__box--learning .modal__full-img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: calc(90vh - 58px);
  object-fit: contain;
  display: block;
}
.modal__pdf-link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--clr-surface);
  color: var(--clr-brown);
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .03em;
  border-top: 1px solid rgba(200,168,130,.35);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: background var(--dur-fast), color var(--dur-fast);
  text-decoration: none;
  white-space: nowrap;
}
.modal__pdf-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.modal__pdf-link:hover {
  background: var(--clr-dark);
  color: var(--clr-tan);
}
.modal__pdf-link:hover svg {
  transform: translateY(-2px);
}

/* Gaming modal */
.modal__box--gaming {
  width: min(620px, 90vw);
  padding: 40px 36px 36px;
  overflow-y: auto;
}

.modal__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--clr-dark);
  margin-bottom: 28px;
  text-align: center;
}

/* Close button */
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,253,248,.9);
  border: 1.5px solid rgba(200,168,130,.4);
  color: var(--clr-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast), transform var(--dur-fast);
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.modal__close:hover { background: var(--clr-dark); color: var(--clr-white); transform: scale(1.08); }
.modal__close svg { width: 16px; height: 16px; }

/* ─── Game Grid (inside modal) ─── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.game-item {
  background: var(--clr-surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(200,168,130,.3);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.game-item:hover { background: var(--clr-surface-2); transform: translateX(2px); }

.game-item__icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.game-item__icon img { width: 100%; height: 100%; object-fit: cover; }

.game-item__name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--clr-dark);
  line-height: 1.2;
}
.game-item__desc {
  font-size: .75rem;
  color: var(--clr-muted);
  margin-top: 3px;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 768px) {
  :root { --section-py: 60px; }

  .hero { padding: 80px 20px 60px; }
  .hero__avatar { width: 120px; height: 120px; }
  .hero__name { font-size: 2.4rem; }

  .tab-btn { padding: 16px 18px; font-size: .82rem; }

  .card-grid,
  .card-grid--learning,
  .card-grid--hobbies {
    grid-template-columns: 1fr 1fr;
  }

  .modal__box--gaming { padding: 32px 24px 28px; }
  .game-grid { gap: 12px; }
}

/* Mobile */
@media (max-width: 480px) {
  :root { --section-py: 48px; }

  .hero { padding: 70px 16px 52px; }
  .hero__name { font-size: 2rem; }
  .hero__gpa-value { font-size: 1.3rem; }

  .tab-btn { padding: 14px 14px; font-size: .8rem; }

  .card-grid,
  .card-grid--learning,
  .card-grid--hobbies {
    grid-template-columns: 1fr;
  }

  .game-grid { grid-template-columns: 1fr; }

  .modal__box--gaming { padding: 28px 18px 22px; }
  .modal__box--image { max-height: 70vh; }
}