/* ============================================================
   ROYCE SJ PORTFOLIO — SHARED STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --bg: #E5FFD1;
  --text-dark: #1a1a1a;
  --text-mid: #333;
  --text-muted: #666;
  --nav-bg: #2D3E2F;
  --border: #000;

  --evelyn-color:   #2D3E2F;
  --foundling-color:#4A0404;
  --diafano-color:  #002147;
  --academia-color: #B58B00;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ============================================================
   NAVIGATION
   ============================================================ */

nav {
  background-color: var(--nav-bg);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.nav-brand {
  font-family: 'Lora', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.78);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: color 0.18s;
}

.nav-links a:hover,
.nav-links a.active { color: #fff; }

/* Hamburger button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.28s;
}

/* Mobile nav */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem 0;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  }

  .nav-links.open { display: flex; }

  .nav-links li a {
    display: block;
    padding: 0.8rem 5%;
    font-size: 1rem;
  }
}

/* ============================================================
   MAIN + FOOTER
   ============================================================ */

main { flex: 1; }

footer {
  background-color: var(--nav-bg);
  color: rgba(255,255,255,0.6);
  padding: 36px 5% 20px;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr fit-content(100%) 1fr;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: 1;
}

.footer-brand {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.footer-links {
  display: flex;
  gap: 1.6rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  padding: 0 2rem;
}

.footer-links a {
  color: rgba(255,255,255,0.72);
  font-size: 0.85rem;
  transition: color 0.18s;
  text-decoration: none;
}

.footer-links a:hover { color: #fff; }

.footer-linkedin {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: opacity 0.18s;
  width: fit-content;
  margin-left: auto;
}

.footer-linkedin:hover { opacity: 0.55; }

.footer-linkedin svg { display: block; opacity: 0.7; }

.footer-tagline {
  margin: 0;
  font-size: 0.83rem;
  font-style: italic;
  color: rgba(255,255,255,0.68);
  letter-spacing: 0.3px;
}

.footer-copy {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

/* ============================================================
   HOME — HERO
   ============================================================ */

.hero {
  background-color: var(--bg);
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 40px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3% 0 7%;
  gap: 48px;
}

.hero-text {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-text h1 {
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text-dark);
  text-align: center;
}

.hero-text p {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--text-mid);
  text-align: center;
}

.hero-image-wrap {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 520 / 580;
}

.hero-image-frame .bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.hero-image-frame .portrait {
  position: absolute;
  width: 80%;
  height: 92%;
  top: 4%;
  left: 10%;
  object-fit: cover;
  border-radius: 6px;
}

/* Tablet */
@media (max-width: 960px) {
  .hero {
    min-height: auto;
    padding: 50px 5%;
  }

  .hero-inner {
    flex-direction: column;
    gap: 36px;
    padding: 0 5%;
  }

  .hero-text {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .hero-image-wrap {
    width: 100%;
  }

  .hero-image-frame {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.6rem; }
  .hero-text p  { font-size: 0.97rem; }
  .hero-image-frame { max-width: 300px; }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-wrap {
  display: flex;
  align-items: center;
  gap: 110px;
  flex-wrap: wrap;
  padding: 40px 6% 60px;
  max-width: 1150px;
  margin: 0 auto;
}

.about-text {
  flex: 1.2;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: flex-start;
  margin-top: 8px;
}

.about-text h2 {
  font-family: 'Lora', serif;
  font-size: 1.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.about-text p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-mid);
  text-align: center;
  margin: 0;
}

.about-photo-wrap {
  flex: 1;
  min-width: 260px;
  display: flex;
  justify-content: flex-end;
  align-self: flex-start;
  margin-top: 32px;
}

.about-photo-wrap img {
  width: 445px;
  max-width: 100%;
  height: 510px;
  object-fit: cover;
  object-position: 35% 40%;
  border: 2px solid #000;
  border-radius: 4px;
}

@media (max-width: 720px) {
  .about-wrap {
    flex-direction: column-reverse;
    gap: 28px;
    padding: 44px 5%;
  }
  .about-photo-wrap {
    justify-content: center;
    padding-right: 0;
  }
  .about-photo-wrap img {
    width: 100%;
    max-width: 340px;
    height: 360px;
    margin: 0 auto;
  }
  .about-text h2 { font-size: 1.6rem; }
}

/* ============================================================
   PAGE TITLES (Resume & Projects)
   ============================================================ */

.page-title {
  font-family: 'Lora', serif;
  font-size: 2.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  margin: 0 0 36px 0;
  letter-spacing: 0.2px;
}

/* ============================================================
   RESUME PAGE
   ============================================================ */

.resume-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 5%;
  gap: 26px;
}

.resume-frame {
  width: 100%;
  max-width: 820px;
  background: white;
  border: 1px solid #000;
  box-shadow: 0 4px 22px rgba(0,0,0,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.resume-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.resume-download-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 2px;
  transition: color 0.18s, border-color 0.18s;
}

.resume-download-link:hover {
  color: var(--text-dark);
  border-color: var(--text-dark);
}

/* ============================================================
   PROJECTS PAGE
   ============================================================ */

.projects-page {
  padding: 60px 0 70px 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.projects-page > .page-title {
  padding: 0 5%;
}

/* Accordion */
details.project-accordion { width: 100%; }

details.project-accordion summary {
  list-style: none;
  cursor: pointer;
  outline: none;
  padding: 0 4%;
}
details.project-accordion summary::-webkit-details-marker { display: none; }

.proj-header-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 28px;
  height: 86px;
  border-radius: 50px;
  border: 3px solid #000;
  max-width: 880px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  transition: opacity 0.18s;
}

.proj-header-pill:hover { opacity: 0.88; }

.proj-header-pill h2 {
  font-family: 'Lora', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.3px;
  text-align: center;
}

.proj-chevron {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  transition: transform 0.28s;
  flex-shrink: 0;
}

details[open] .proj-chevron { transform: rotate(180deg); }

/* Project body */
.proj-body { padding: 40px 0 16px 0; }

/* Intro row */
.proj-intro {
  display: flex;
  align-items: flex-start;
  gap: 80px;
  max-width: 980px;
  margin: 0 auto 0 auto;
  padding: 0 5%;
  flex-wrap: wrap;
}

.proj-intro-text {
  flex: 1.2;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proj-intro-text h3 {
  font-family: 'Lora', serif;
  font-size: 1.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.proj-intro-text p {
  font-size: 0.99rem;
  line-height: 1.72;
  text-align: center;
  color: var(--text-mid);
  margin: 0;
}

.proj-intro-img {
  flex: 0 0 280px;
  text-align: center;
}

.proj-intro-img img {
  width: 100%;
  max-width: 300px;
  border: 2px solid #000;
  height: auto;
  margin: 0 auto;
}

.proj-intro-img p {
  margin-top: 8px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Divider — full width */
.proj-divider {
  height: 10px;
  width: 100%;
  margin: 38px 0;
}

/* Metrics */
.metrics-section { margin-bottom: 38px; }

.metrics-title {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 28px;
  letter-spacing: 0.1px;
}

.metrics-grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 5%;
}

.metric-item {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  width: 78px;
  height: 78px;
  border: 2px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.32);
  flex-shrink: 0;
}

.metric-icon img { width: 38px; height: 38px; }

.metric-item p {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-dark);
}

/* Content cards */
.cards-section { margin-bottom: 16px; padding: 0 5%; max-width: 1100px; margin-left: auto; margin-right: auto; }

.cards-title {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 24px;
  letter-spacing: 0.1px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.card {
  border-radius: 18px;
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-img-wrap {
  width: 100%;
  height: 230px;
  border: 2px solid #000;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-label {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.card-btn {
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.75);
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 0.87rem;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  margin-top: auto;
  display: inline-block;
  text-align: center;
  transition: background 0.18s;
}

.card-btn:hover { background: rgba(255,255,255,0.18); }

/* View more — JS-driven, button always at bottom */
.view-more-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 5%;
  display: flex;
  flex-direction: column;
}

.view-more-content {
  margin-top: 18px;
}

.view-more-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

button.view-more-btn {
  color: #fff;
  border: 2px solid #000;
  padding: 8px 26px;
  border-radius: 50px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.18s;
}

button.view-more-btn:hover { opacity: 0.82; }

/* Footer responsive */
@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-links {
    grid-column: 1;
    justify-content: flex-start;
  }
  .footer-linkedin {
    grid-column: 1;
    justify-content: flex-start;
  }
}

/* ============================================================
   RESPONSIVE — PROJECTS
   ============================================================ */

@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }

  .proj-header-pill h2 { font-size: 1.55rem; }
}

@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }

  .proj-header-pill {
    height: auto;
    padding: 18px 22px;
    border-radius: 24px;
  }

  .proj-header-pill h2 { font-size: 1.3rem; }

  .proj-intro {
    flex-direction: column;
    gap: 20px;
  }

  .proj-intro-img { flex: none; width: 100%; }

  .proj-intro-img img { max-width: 240px; }

  .metrics-grid { gap: 18px; }

  .metric-item { min-width: 120px; }
}