/* ─── GLOBAL ─────────────────────────────────────────────── */
html { scroll-behavior: smooth; overflow-y: scroll; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: #62A8E5;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── HERO / LANDING ─────────────────────────────────────── */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 15px;
  line-height: 1;
}

.subtitle { color: #fff; font-size: 1.2rem; margin-bottom: 20px; font-weight: 450; }

/* ─── SOCIAL / NAV LINKS ─────────────────────────────────── */
.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.social-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: normal;     /* match the LinkedIn link weight exactly */
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.social-links a:hover { opacity: 0.6; }

/* ─── PHOTOGRAPHY SECTION ────────────────────────────────── */
.photography-section {
  padding: 100px 20px;
  background-color: #62A8E5;
  transition: opacity 0.5s ease;
}

.hidden { display: none; opacity: 0; }

.container { max-width: 1000px; margin: 0 auto; }

.section-title {
  font-size: 2rem;
  margin-bottom: 50px;
  border-bottom: 1px solid #fff;
  padding-bottom: 10px;
}

.folder { margin-bottom: 60px; }
.folder h3 {
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.item {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: pointer;
  background: #62A8E5;
}
.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.item:hover img { transform: scale(1.05); }

.footer-nav { text-align: center; margin-top: 50px; }
.footer-nav a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #fff;
  padding: 12px 0;
  width: 180px;
  text-align: center;
  transition: border-color 0.6s ease, color 0.6s ease, background 0.6s ease;
}
.footer-nav a:hover {
  border-color: #fff;
  background: #fff;
  color: #62A8E5;
}

/* ─── PHOTO LIGHTBOX MODAL ───────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-box {
  max-width: 85%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-box img { max-width: 100%; max-height: 75vh; }
.modal-text {
  margin-top: 25px;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
  max-width: 700px;
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  opacity: 0.75;
}
.close-btn:hover { opacity: 1; }

/* ─── PHOTO LIGHTBOX: NAV BUTTONS ──────────────────────────── */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
  padding: 20px;
  user-select: none;
}
.modal-nav:hover { opacity: 1; }
.modal-prev { left: 20px; }
/* Fixed width so the → and ⏭ icons share the same horizontal center */
.modal-next { right: 20px; width: 72px; text-align: center; }

.next-section-btn {
  position: absolute;
  top: calc(50% + 44px);
  right: 20px;
  width: 72px;          /* matches .modal-next so icons stay centered */
  text-align: center;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
  user-select: none;
}
.next-section-btn.visible { opacity: 0.3; pointer-events: auto; }
.next-section-btn.visible:hover { opacity: 1; }

.prev-section-btn {
  position: absolute;
  top: calc(50% + 44px);
  left: 20px;
  width: 72px;
  text-align: center;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
  user-select: none;
}
.prev-section-btn.visible { opacity: 0.3; pointer-events: auto; }
.prev-section-btn.visible:hover { opacity: 1; }

/* ─── TIC-TAC-TOE EASTER EGG ─────────────────────────────── */
#tictactoe-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#tictactoe-overlay.hidden {
  display: none;
}

.ttt-container { text-align: center; position: relative; }
#ttt-message { color: #fff; margin-bottom: 20px; font-weight: 400; letter-spacing: 1px;}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 2px;
  background-color: #fff; 
  border: 2px solid #fff;
}

.cell {
  background-color: #62A8E5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cell:hover { background-color: #7eb8e8; }

.footer-nav-btn {
  /* Take the button out of the normal document flow so it doesn't push the board */
  position: absolute;
  bottom: -70px; /* Hangs it 70px below the game container */
  left: 50%;
  transform: translateX(-50%); /* Keeps it perfectly centered */
  
  /* Your original styling below */
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  padding: 10px 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: 0.3s;
  white-space: nowrap;
}

.footer-nav-btn:hover { 
  background: #fff; 
  color: #62A8E5; 
}

/* ─── DHARMA INITIATIVE OVERRIDE ─────────────────────────── */

body.dharma-mode {
  background-color: #050505 !important;
  color: #1fd11f !important;
  font-family: "Courier New", Courier, monospace !important;
  color-scheme: dark !important; 
}

body.dharma-mode .hero h1,
body.dharma-mode .subtitle,
body.dharma-mode .folder h3,
body.dharma-mode .social-links a,
body.dharma-mode .section-title,
body.dharma-mode .footer-nav a,
body.dharma-mode .footer-nav-btn,
body.dharma-mode #ttt-message,
body.dharma-mode #modalText,
body.dharma-mode .close-btn,
body.dharma-mode .modal-nav,
body.dharma-mode #dharmaInput,   
body.dharma-mode #numberEntryContainer label {
  color: #1fd11f !important;
  font-family: "Courier New", Courier, monospace !important;
  border-color: #1fd11f !important;
  font-weight: bold !important;
}

body.dharma-mode .social-links a:hover,
body.dharma-mode .footer-nav a:hover,
body.dharma-mode .footer-nav-btn:hover,
body.dharma-mode .close-btn:hover,
body.dharma-mode .modal-nav:hover {
  background: #1fd11f !important;
  color: #050505 !important;
}

body.dharma-mode .item img,
body.dharma-mode #modalImg {
  filter: grayscale(100%) sepia(100%) hue-rotate(80deg) saturate(400%) contrast(150%) !important;
}

body.dharma-mode .photography-section,
body.dharma-mode .item,
body.dharma-mode .modal {
  background-color: #050505 !important;
}

body.dharma-mode .ttt-board {
  background-color: #1fd11f !important; 
  border-color: #1fd11f !important;
}
body.dharma-mode .cell {
  background-color: #050505 !important; 
  color: #1fd11f !important; 
}
body.dharma-mode .cell:hover {
  background-color: #1fd11f !important;
  color: #050505 !important;
}

body.dharma-mode::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  z-index: 9999;
  background-size: 100% 4px;
  pointer-events: none;
}

/* ─── NEW: FLIP CLOCK & INPUT STYLES ─── */
.dharma-hidden { display: none !important; }

.flip-clock {
  position: absolute;
  top: 60px; /* This is our new invisible center line */
  left: 50%;
  transform: translate(-50%, -50%); /* Centers it exactly on the X and Y axis */
  z-index: 2500;
  display: flex;
  gap: 5px;
}

#numberEntryContainer {
  position: absolute;
  top: 60px; /* Shares the exact same center line as the clock */
  left: 40px;
  transform: translateY(-50%); /* Centers it perfectly on the Y axis */
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 10px;
}

#dharmaInput {
  background: #050505;
  border: 1px solid #1fd11f;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 1.2rem;
  box-shadow: 0 0 10px rgba(31, 209, 31, 0.5); 
}
#dharmaInput:focus {
  outline: none;
  box-shadow: 0 0 20px rgba(31, 209, 31, 1);
}

.flip-card {
  position: relative;
  width: 35px;       /* Shrunk down from 50px */
  height: 56px;      /* Shrunk down from 80px */
  font-size: 2.2rem; /* Shrunk down from 3rem */
  background-color: #222;
  border: 1px solid #050505;
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  user-select: none;
  perspective: 300px; /* CRITICAL: Enables the 3D flipping effect */
}

/* The horizontal split line */
.flip-card::after {
  content: '';
  position: absolute;
  left: 0; 
  width: 100%; 
  height: 2px;
  background-color: #050505;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.flip-card-number {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}

.flip-card-top { 
  top: 0; 
  line-height: 56px; /* Matches new card height */
  transform-origin: bottom; /* Puts the hinge at the bottom of the top half */
}

.flip-card-bottom { 
  bottom: 0; 
  line-height: 0; 
  transform-origin: top; /* Puts the hinge at the top of the bottom half */
}

/* ─── NEW: 3D ANIMATION CLASSES ─── */
.fold-top {
  animation: foldDown 0.15s ease-in forwards;
}
.fold-bottom {
  animation: unfoldDown 0.15s ease-out forwards;
}

@keyframes foldDown {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}
@keyframes unfoldDown {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* ─── DHARMA OVERRIDE FIXES ─── */
body.dharma-mode .flip-card {
  background-color: #050505 !important;
  border-color: #1fd11f !important; /* Subtle green border */
}
body.dharma-mode .flip-card-number {
  color: #1fd11f !important;
}

/* ─── DHARMA TIMER COLON ─── */
.dharma-colon {
  width: 35px;       /* Matches flip-card width */
  height: 56px;      /* Matches flip-card height */
  font-size: 2.2rem;
  line-height: 56px; /* Centers the colon vertically */
  font-weight: bold;
  text-align: center;
  background-color: #222;
  border: 1px solid #050505;
  border-radius: 4px;
}

body.dharma-mode .dharma-colon {
  color: #1fd11f !important;
  background-color: #050505 !important;
  border-color: #1fd11f !important; /* Adds the matching green border */
}

/* ─── ENDGAME IMPLOSION SEQUENCE ─── */

/* NEW: The violent screen shake applied to the whole site */
body.system-failure {
  animation: systemShake 0.15s infinite;
}

/* Defines exactly how the screen jerks around */
@keyframes systemShake {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-0.5deg); }
  20% { transform: translate(-3px, 0px) rotate(0.5deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(0.5deg); }
  50% { transform: translate(-1px, 2px) rotate(-0.5deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-0.5deg); }
  80% { transform: translate(-1px, -1px) rotate(0.5deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-0.5deg); }
}

/* Turns the clock numbers into angry red symbols */
body.system-failure .flip-card-number,
body.system-failure .dharma-colon {
  color: #ff0000 !important;
}

#whiteoutFlash {
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%;
  background-color: #fff; 
  z-index: 10000; 
  opacity: 0; 
  pointer-events: none;
  clip-path: circle(0% at 50% 50%); 
  transition: opacity 0.15s ease-in, clip-path 0.15s ease-in; 
}

#whiteoutFlash.implode {
  opacity: 1; 
  pointer-events: all;
  clip-path: circle(150% at 50% 50%);
}

#whiteoutFlash.awaken {
  opacity: 0; 
  pointer-events: none;
  clip-path: circle(150% at 50% 50%);
  transition: opacity 3s ease-out; 
}

/* ─── WPM TESTER EASTER EGG (MAIN THEME) ───────────────── */
#wpm-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9); /* Matches Tic-Tac-Toe background */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#wpm-overlay.hidden {
  display: none;
}

.wpm-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4); /* Faded white for un-typed words */
  margin-bottom: 20px;
  font-family: inherit; /* Matches main site font */
}

.wpm-words span {
  transition: color 0.1s;
}

/* Highlights the word you are currently typing */
.wpm-words span.active {
  color: #fff;
  text-decoration: underline;
}

/* Turns your main site blue when typed correctly */
.wpm-words span.correct {
  color: #62A8E5; 
}

/* Turns red if you make a mistake */
.wpm-words span.incorrect {
  color: #ff4d4d; 
}

/* Hides the actual input box so it looks like Monkeytype */
.wpm-hidden-input {
  opacity: 0;
  position: absolute;
  top: -9999px;
}

.wpm-results {
  color: #fff;
  font-size: 1.5rem;
  min-height: 40px;
  margin-top: 20px;
}

/* ─── WPM TESTER EASTER EGG (MAIN THEME & DHARMA OVERRIDES) ───────────────── */
#wpm-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9); 
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#wpm-overlay.hidden { display: none; }

/* Header Layout */
.wpm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
}

#wpm-message {
  color: #fff;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 0; 
}

/* Word Count Selector */
.wpm-word-selector {
  display: flex;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 8px;
  font-family: inherit;
}

.wpm-option {
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.wpm-option:hover { color: #fff; }
.wpm-option.active {
  color: #62A8E5; 
  font-weight: bold;
}

/* Words Display */
.wpm-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px; 
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 20px;
  font-family: inherit; 
}

.wpm-word {
  display: flex;
  border-bottom: 3px solid transparent; 
  padding-bottom: 2px;
}

.wpm-word.active { border-bottom: 3px solid #fff; }
.wpm-word span { color: rgba(255, 255, 255, 0.4); transition: color 0.1s; }
.wpm-word span.correct { color: #62A8E5; }
.wpm-word span.incorrect { color: #ff4d4d; }

.wpm-hidden-input { opacity: 0; position: absolute; top: -9999px; }
.wpm-results { color: #fff; font-size: 1.5rem; min-height: 40px; margin-top: 20px; }

/* ─── DHARMA MODE OVERRIDES ───────────────── */
body.dharma-mode .wpm-words,
body.dharma-mode .wpm-word-selector,
body.dharma-mode #wpm-message,
body.dharma-mode .wpm-results,
body.dharma-mode #closeWpmBtn {
  font-family: "Courier New", Courier, monospace !important;
  color: #1fd11f !important;
}

body.dharma-mode .wpm-word span { color: rgba(31, 209, 31, 0.3) !important; }
body.dharma-mode .wpm-word.active { border-bottom: 3px solid #1fd11f !important; }
body.dharma-mode .wpm-word span.correct { color: #1fd11f !important; font-weight: bold; }
body.dharma-mode .wpm-word span.incorrect { color: #ff0000 !important; }

body.dharma-mode .wpm-word-selector { background: rgba(31, 209, 31, 0.1) !important; }
body.dharma-mode .wpm-option { color: rgba(31, 209, 31, 0.4) !important; }
body.dharma-mode .wpm-option:hover { color: #1fd11f !important; }
body.dharma-mode .wpm-option.active { color: #1fd11f !important; text-decoration: underline; }

/* ─── CUBE TIMER EASTER EGG ───────────────────────────── */
#cube-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#cube-overlay.hidden { display: none; }

.cube-scramble {
  font-size: 2.5rem;
  color: #62A8E5; 
  margin-bottom: 40px;
  letter-spacing: 3px;
  font-family: monospace;
  text-align: center;
}

.cube-timer {
  font-size: 8rem;
  color: #fff;
  font-family: monospace;
  font-variant-numeric: tabular-nums; 
  margin-bottom: 20px;
}

.cube-instructions {
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
}

/* Overrides for Dharma Mode */
body.dharma-mode .cube-scramble,
body.dharma-mode .cube-timer,
body.dharma-mode .cube-instructions {
  color: #1fd11f !important;
  font-family: "Courier New", Courier, monospace !important;
}

/* ─── INFO MENU (MOBILE ACCESS) ──────────────────────────── */
#infoMenuContainer {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#infoIcon {
  background: transparent; /* Removed the background circle */
  color: rgba(255, 255, 255, 0.15); /* Extremely faded, almost invisible */
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem; /* Smaller icon */
  cursor: pointer;
  transition: color 0.3s;
  margin-top: 10px;
}

#infoIcon:hover {
  color: rgba(255, 255, 255, 0.5); /* Slightly brighter when tapped/hovered */
}

#infoMenuPopup {
  background: #fff;
  color: #62A8E5;
  padding: 10px; /* Reduced padding */
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 6px; /* Tighter spacing between buttons */
  width: 160px; /* Noticeably narrower menu */
}

#infoMenuPopup h4 {
  margin-bottom: 4px;
  text-align: center;
  border-bottom: 1px solid #62A8E5;
  padding-bottom: 6px;
  font-size: 0.9rem; /* Smaller header font */
}

#infoMenuPopup button {
  background: transparent;
  border: 1px solid #62A8E5;
  color: #62A8E5;
  padding: 5px; /* Thinner buttons */
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem; /* Smaller button text */
  transition: 0.2s;
}

#infoMenuPopup button:hover {
  background: #62A8E5;
  color: #fff;
}

/* Dharma Mode Overrides for the Menu */
body.dharma-mode #infoMenuPopup {
  background: #050505 !important;
  color: #1fd11f !important;
  border: 1px solid #1fd11f;
}
body.dharma-mode #infoMenuPopup h4 { border-color: #1fd11f !important; }
body.dharma-mode #infoMenuPopup button { 
  border-color: #1fd11f !important; 
  color: #1fd11f !important; 
}
body.dharma-mode #infoMenuPopup button:hover {
  background: #1fd11f !important;
  color: #050505 !important;
}
body.dharma-mode #infoIcon { 
  color: rgba(31, 209, 31, 0.15) !important; /* Faded green */
  background: transparent !important;
}
body.dharma-mode #infoIcon:hover {
  color: rgba(31, 209, 31, 0.5) !important;
}