/* ========================================
   KEATON PRIEST - CLICK-THROUGH PORTFOLIO
   Greyscale + Blue Accent
   ======================================== */

:root {
  --black: #0a0a0a;
  --gray-900: #111;
  --gray-800: #1a1a1a;
  --gray-700: #2a2a2a;
  --gray-600: #3a3a3a;
  --gray-500: #555;
  --gray-400: #888;
  --gray-300: #aaa;
  --gray-200: #ccc;
  --white: #f0f0f0;
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --blue-glow: rgba(59, 130, 246, 0.25);
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--black);
  font-family: var(--font-body);
  color: var(--gray-300);
}

/* ---- FOREST BACKGROUND ---- */
.forest-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--black);
}

.forest-canvas {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
}

#forest-far { z-index: 1; opacity: 0.9; }
#forest-mid { z-index: 2; opacity: 0.95; }
#forest-close { z-index: 3; opacity: 1; }

/* Ensure all pages sit above forest */
.page, .page-dots {
  z-index: 10;
}

/* ---- PAGE SYSTEM ---- */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(60px);
  z-index: 10;
  background: rgba(10, 10, 10, 0.5);
}

.page.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 10;
}

.page.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}

.page.exit-right {
  opacity: 0;
  transform: translateX(60px);
}

/* ---- PAGE DOTS ---- */
.page-dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-500);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.dot:hover {
  border-color: var(--blue);
}

.dot.active {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}

/* ---- LANDING PAGE ---- */
#page-landing {
  justify-content: center;
  align-items: center;
  background: rgba(10, 10, 10, 0.15);
}

/* ---- LANDING SPLIT LAYOUT ---- */
.landing-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  position: relative;
  z-index: 2;
  padding: 0 40px;
  max-width: 950px;
  width: 100%;
}

.landing-left {
  flex: 1;
  text-align: left;
}

.landing-left .label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--blue);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.3s forwards;
}

.landing-left h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--white);
  line-height: 1;
  letter-spacing: -2px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}

.landing-line {
  width: 50px;
  height: 2px;
  background: var(--blue);
  margin: 20px 0;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.7s forwards;
}

.landing-left .sub {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--gray-400);
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.9s forwards;
}

.landing-right {
  flex-shrink: 0;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.profile-frame {
  width: 340px;
  height: 430px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--blue);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2), 0 20px 50px rgba(0,0,0,0.5);
  position: relative;
}

.profile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  image-rendering: auto;
  filter: grayscale(60%) contrast(1.05) brightness(1.05);
  transition: filter 0.5s ease;
}

.profile-frame:hover img {
  filter: grayscale(20%) contrast(1.02) brightness(1.05);
}

@media (max-width: 768px) {
  .landing-split {
    flex-direction: column-reverse;
    gap: 30px;
    text-align: center;
  }

  .landing-left {
    text-align: center;
  }

  .landing-line {
    margin: 20px auto;
  }

  .profile-frame {
    width: 200px;
    height: 250px;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Next button on landing */
.next-btn {
  position: absolute;
  bottom: 40px;
  right: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.2s forwards;
  position: absolute;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.next-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.next-btn:hover::before {
  left: 100%;
}

.next-btn:hover {
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.next-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- INNER PAGES ---- */
.page-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 32px;
}

.tag {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--blue);
}

.page-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--white);
  margin-top: 6px;
}

.blue-heading {
  color: var(--blue) !important;
  font-size: clamp(2rem, 4vw, 3rem) !important;
}

.blue-subheading {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--blue);
  margin-top: 32px;
  margin-bottom: 16px;
}

/* Animate children on page entry */
.page.active .page-header,
.page.active .card,
.page.active .job,
.page.active .edu,
.page.active .contact-sub,
.page.active .contact-links,
.page.active .dl-btn {
  animation: fadeUp 0.6s ease backwards;
}

.page.active .page-header { animation-delay: 0.1s; }
.page.active .card:nth-child(1),
.page.active .job:nth-child(1) { animation-delay: 0.2s; }
.page.active .card:nth-child(2),
.page.active .job:nth-child(2) { animation-delay: 0.3s; }
.page.active .card:nth-child(3),
.page.active .job:nth-child(3) { animation-delay: 0.4s; }
.page.active .edu:nth-child(1) { animation-delay: 0.5s; }
.page.active .edu:nth-child(2) { animation-delay: 0.55s; }
.page.active .contact-sub { animation-delay: 0.2s; }
.page.active .contact-links { animation-delay: 0.3s; }
.page.active .dl-btn { animation-delay: 0.4s; }

/* ---- ABOUT CARDS ---- */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  border: 1px solid var(--gray-700);
  border-radius: 6px;
  padding: 24px 20px;
  background: var(--gray-800);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 20px var(--blue-dim);
}

.card h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  margin-bottom: 8px;
}

.card p {
  font-size: 0.82rem;
  color: var(--gray-400);
  line-height: 1.6;
}

.edu-row {
  display: flex;
  gap: 14px;
}

.edu {
  border: 1px solid var(--gray-700);
  border-radius: 6px;
  padding: 16px 20px;
  flex: 1;
  background: var(--gray-800);
}

.edu strong {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--white);
}

.edu span {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ---- JOBS ---- */
.jobs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job {
  border: 1px solid var(--gray-700);
  border-radius: 6px;
  padding: 22px 24px;
  background: var(--gray-800);
  transition: all 0.3s ease;
  position: relative;
}

.job::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  border-radius: 6px 0 0 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.job:hover {
  border-color: var(--blue);
}

.job:hover::before {
  opacity: 1;
}

.job-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.job h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
}

.job .company {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 600;
}

.job .date {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--gray-500);
  letter-spacing: 1px;
}

.job ul {
  list-style: none;
}

.job li {
  padding-left: 14px;
  margin-bottom: 3px;
  font-size: 0.82rem;
  color: var(--gray-400);
  position: relative;
}

.job li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.72rem;
}

/* ---- CONTACT ---- */
.contact-inner {
  align-items: center;
  text-align: center;
}

.contact-sub {
  color: var(--gray-500);
  font-size: 0.9rem;
  max-width: 420px;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--gray-300);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

a.contact-link:hover {
  color: var(--blue);
}

.contact-link svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex-shrink: 0;
}

/* Icon wrappers */
.icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gray-700);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gray-800);
}

/* Phone ringing animation */
.icon-ring svg {
  animation: phoneRing 2s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes phoneRing {
  0%, 100% { transform: rotate(0deg); }
  5% { transform: rotate(15deg); }
  10% { transform: rotate(-13deg); }
  15% { transform: rotate(12deg); }
  20% { transform: rotate(-10deg); }
  25% { transform: rotate(8deg); }
  30% { transform: rotate(-5deg); }
  35% { transform: rotate(0deg); }
}

/* Email slide-in animation */
.icon-seal svg {
  animation: mailSlide 3s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes mailSlide {
  0% { transform: translateX(-18px) scale(0.7); opacity: 0.2; }
  25% { transform: translateX(0) scale(1); opacity: 1; }
  85% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* Pin drop animation */
.icon-pin svg {
  animation: pinDrop 2.5s ease-in-out infinite;
}

@keyframes pinDrop {
  0%, 100% { transform: translateY(0); }
  15% { transform: translateY(-6px); }
  30% { transform: translateY(0); }
  35% { transform: translateY(-2px); }
  40% { transform: translateY(0); }
}

.dl-btn {
  display: inline-block;
  padding: 16px 40px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.dl-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.dl-btn:hover::before {
  left: 100%;
}

.dl-btn:hover {
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

/* ---- PAGE NAV (bottom bar) ---- */
.page-nav {
  display: flex;
  justify-content: space-between;
  padding: 16px 40px;
  border-top: 1px solid var(--gray-800);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.nav-btn:hover::before {
  left: 100%;
}

.nav-btn:hover {
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- KEYBOARD HINT ---- */
.key-hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: var(--font-heading);
  font-size: 0.55rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-600);
  opacity: 0;
  animation: fadeUp 1s ease 2s forwards;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .page-inner {
    padding: 24px 18px;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .blue-heading {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
  }

  .blue-subheading {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    margin-top: 18px;
    margin-bottom: 10px;
  }

  .cards-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .card {
    padding: 16px 14px;
  }

  .card h3 {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .card p {
    font-size: 0.75rem;
    line-height: 1.5;
  }

  .edu-row {
    flex-direction: column;
    gap: 10px;
  }

  .edu {
    padding: 12px 14px;
  }

  .edu strong {
    font-size: 0.75rem;
  }

  .edu span {
    font-size: 0.7rem;
  }

  .page-dots {
    right: 12px;
  }

  .next-btn {
    bottom: 24px;
    right: 24px;
  }

  .page-nav {
    padding: 10px 16px;
  }

  .nav-btn {
    padding: 10px 14px;
    font-size: 0.62rem;
  }

  .job {
    padding: 14px 16px;
  }

  .job h3 {
    font-size: 0.85rem;
  }

  .job li {
    font-size: 0.75rem;
  }

  .jobs {
    gap: 10px;
  }

  .landing-content h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .contact-sub {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .dl-btn {
    padding: 12px 28px;
    font-size: 0.7rem;
  }
}
