/* ============================================
   Raz Portfolio - Notion-like Notebook Design
   Keeping Press Start 2P for lettering
   ============================================ */

:root {
  --paper: #f7f6f3;
  --paper-darker: #ebe9e4;
  --page-bg: #dedad4;
  --ink: #37352f;
  --ink-muted: #6b6b6b;
  --accent: #2383e2;
  --accent-hover: #0d6efd;
  --border: #e8e6e1;
  --notebook-line: rgba(55, 53, 47, 0.09);
  --header-bg: #ffffff;
  --shadow: rgba(15, 15, 15, 0.05);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

header, nav, ul, li {
  margin: 0;
  padding: 0;
}

body, html {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Press Start 2P', monospace;
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.6;
}

body, #myHeader {
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Dark mode */
body.dark-mode {
  --paper: #1e1e1e;
  --paper-darker: #2a2a2a;
  --page-bg: #111111;
  --ink: #ebebeb;
  --ink-muted: #9b9a97;
  --border: #373737;
  --header-bg: #252525;
}

/* Notebook page effect */
.notebook-page {
  min-height: calc(100vh - 60px);
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 70vh;
  position: relative;
  background: transparent;
  /* overflow: clip (NOT hidden) clips the right-sliding cards without
     creating a scroll container — so sticky header/sections still work */
  overflow-x: clip;
}

/* Subtle left margin line (notebook spine) */
@media (min-width: 768px) {
  .notebook-page::before {
    content: '';
    position: fixed;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    opacity: 0.5;
    pointer-events: none;
  }
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-space {
  margin-left: 0;
}

.logo {
  font-size: clamp(12px, 2.5vw, 16px);
  color: inherit;
  margin: 0;
  letter-spacing: -0.5px;
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger-menu {
  display: block;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  padding: 8px;
}

nav ul {
  display: none;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}

#navMenu.active {
  display: flex;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--header-bg);
  padding: 12px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Menu - Pill style (notebook tabs) */
.navItems, nav a {
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  display: block;
  transition: all 0.2s;
  border-radius: 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover, .navItems:hover {
  color: var(--accent);
  background: var(--paper-darker);
}

/* Dark mode button - bigger */
#light-btn {
  border-radius: 12px;
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  background: var(--border);
  cursor: pointer;
  padding: 12px 16px;
  min-width: 48px;
  min-height: 48px;
  border: 2px solid var(--border);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#light-btn:hover {
  background: var(--paper-darker);
  transform: scale(1.05);
}

/* Dark mode - keep buttons visible (don't blend into background) */
body.dark-mode #light-btn {
  background: var(--paper-darker);
  border-color: var(--ink-muted);
  color: var(--ink);
}

body.dark-mode #light-btn:hover {
  background: var(--ink-muted);
  color: var(--paper);
}

/* Typography */
h1 {
  font-size: clamp(14px, 3vw, 18px);
  margin: 0 0 16px;
  line-height: 1.8;
  color: inherit;
}

p {
  font-size: 10px;
  line-height: 2;
  margin: 0 0 12px;
  color: var(--ink-muted);
}

/* Page sections - card stacking effect */
.page-section {
  /* No min-height: auto height so the card is as tall as its content */
  padding: 48px 32px 52px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  /* Extra margin-bottom = scroll space between cards before they stack */
  margin-bottom: 60vh;
  /* Card styling */
  background: var(--paper);
  border-radius: 20px;
  border: 1px solid var(--border);
  /* Default shadow — JS overrides dynamically as cards approach stacking */
  box-shadow:
    0 4px 12px rgba(15, 15, 15, 0.06),
    0 16px 40px rgba(15, 15, 15, 0.08);
  /* Stacking transform */
  transform-origin: top center;
  will-change: transform, filter, box-shadow;
  /* Only transition transform + filter; box-shadow is set each frame by JS */
  transition: transform 0.15s ease, filter 0.15s ease;
}

.page-section:last-of-type {
  margin-bottom: 60px;
}

body.dark-mode .page-section {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Thin accent stripe at top of each card */
.page-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
  opacity: 0.4;
}

html {
  scroll-behavior: smooth;
}

/* Scroll-triggered reveal animation - more visible slide-up + fade */
.scroll-reveal {
  opacity: 0;
  transform: translateY(56px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Staggered reveal for content inside sections */
.scroll-reveal .grid-container,
.scroll-reveal .project-imgs-con,
.scroll-reveal .resume-embed-wrap {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.scroll-reveal.revealed .grid-container,
.scroll-reveal.revealed .project-imgs-con,
.scroll-reveal.revealed .resume-embed-wrap {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal h1 {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
}

.scroll-reveal.revealed h1 {
  opacity: 1;
  transform: translateY(0);
}

/* Welcome section visible immediately on load */
#welcome.scroll-reveal {
  transition-duration: 0.5s;
}

/* Grid & Layout */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0;
}

.content-1 {
  flex: 1;
}

/* Profile photo placeholder */
.profile-photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--paper-darker);
}

.profile-photo-placeholder {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: var(--paper-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 8px;
  text-align: center;
  padding: 20px;
}

/* Footer / Social links */
footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.link-imgs-con {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.link-card:hover {
  transform: translateY(-2px);
}

.link-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
}

.link-card p {
  margin: 0;
  font-size: 8px;
}

/* Placeholder icon (SVG fallback) */
.icon-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--paper-darker);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--ink-muted);
}

/* Desktop */
@media (min-width: 768px) {
  .hamburger-menu {
    display: none;
  }

  #navMenu {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
  }

  nav ul {
    display: flex;
    flex-direction: row;
    gap: 8px;
  }

  .navItems, nav a {
    font-size: 11px;
    padding: 10px 16px;
  }

  .grid-container {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .grid-container.two-col .content-1 {
    flex: 1;
    min-width: 300px;
  }

  .grid-container.two-col .content-2 {
    flex: 0 0 auto;
  }

  .profile-photo, .profile-photo-placeholder {
    max-width: 320px;
  }
}

@media (min-width: 800px) {
  .notebook-page {
    padding: 40px 60px 80px;
  }

  .content-1 {
    padding-top: 0;
  }
}

/* Resume button */
.resume-button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper) !important;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 8px;
  font-family: inherit;
  margin-top: 16px;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.resume-button:hover {
  opacity: 0.85;
}

body.dark-mode .resume-button {
  background: var(--ink) !important;
  color: var(--paper) !important;
  border: 2px solid var(--ink);
}

body.dark-mode .resume-button-outline {
  background: transparent !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink-muted);
}

body.dark-mode .resume-button-outline:hover {
  border-color: var(--ink);
  color: var(--ink) !important;
  background: rgba(235, 235, 235, 0.08) !important;
}

/* Resume placeholder */
.resume-placeholder {
  padding: 40px 24px;
  text-align: center;
  background: var(--paper-darker);
  border-radius: 12px;
  border: 2px dashed var(--border);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.resume-placeholder p {
  margin: 0;
  max-width: 400px;
}

/* Projects */
.project-imgs-con {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 24px;
}

@media (min-width: 600px) {
  .project-imgs-con {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.project-card p {
  margin: 0;
  text-align: center;
  font-size: 8px;
}

.project-img-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--paper-darker);
  transition: border-color 0.2s, transform 0.2s;
}

.project-card a:hover .project-img-wrap {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Full image display - no cropping (for Hangman) */
.project-img-wrap.project-img-full {
  aspect-ratio: auto;
  min-height: 200px;
}

.project-img-wrap.project-img-full .project-img {
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: 400px;
}

.project-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--ink-muted);
  background: linear-gradient(135deg, var(--paper-darker) 0%, var(--border) 100%);
}

/* About page adjustments */
.about-content p {
  max-width: 560px;
}

.about-subhead {
  font-size: 10px;
  margin: 20px 0 8px;
  color: var(--ink);
  font-family: 'Press Start 2P', monospace;
}

.se-label {
  font-size: 10px;
  margin-top: 16px;
  color: var(--ink-muted);
}

/* Resume section — full-card PDF */
.resume-section {
  padding-bottom: 48px;
}

.resume-embed-wrap {
  width: 100%;
  max-width: 100%;
  margin: 20px 0 0;
  height: 80vh;
  min-height: 560px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--paper-darker);
}

.resume-pdf {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Resume page arrows - theme-matched pager */
.resume-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 16px 0 8px;
}

.resume-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--paper-darker);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 0.2s;
}

.resume-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--paper);
  transform: scale(1.08);
}

.resume-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.resume-page-num {
  font-size: 10px;
  color: var(--ink-muted);
  min-width: 48px;
  text-align: center;
}

body.dark-mode .resume-arrow {
  background: var(--paper-darker);
  border-color: var(--ink-muted);
  color: var(--ink);
}

body.dark-mode .resume-arrow:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink-muted);
  color: var(--paper);
}

.resume-download {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0 0 !important;
}

.resume-button-outline {
  background: transparent !important;
  color: var(--ink) !important;
  border: 2px solid var(--border);
}

.resume-button-outline:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* ============================================
   ALTERNATE MENU STYLES - uncomment to use
   ============================================ */

/* Option B: Underline tabs - clean minimal
.navItems, nav a {
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: transparent !important;
}
.navItems:hover, nav a:hover {
  border-bottom-color: var(--accent);
  background: transparent !important;
}
*/

/* Option C: Notebook tab - folded corner
.navItems, nav a {
  background: var(--paper-darker) !important;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
}
.navItems:hover, nav a:hover {
  background: var(--paper) !important;
  color: var(--accent);
}
*/

/* Option D: Solid pill - bold accent
.navItems, nav a {
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 24px;
}
.navItems:hover, nav a:hover {
  background: var(--accent);
  color: var(--paper) !important;
}
*/

/* ── Scroll progress bar ───────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Active nav indicator ──────────────────────────────────────── */
.navItems.nav-active {
  color: var(--accent);
  background: var(--paper-darker);
}

@media (min-width: 800px) {
  .page-section {
    padding: 56px 52px 60px;
  }
}
