/* Reset and base styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #f4f7fa, #eef2f9);
  color: #1c1e21;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0056b3;
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  padding: 1rem 2rem 3rem;
  margin: 0 auto;
  width: 100%;
}

/* Navigation */
nav {
  background-color: #1e1e2f;
  padding: 1rem 2rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
}
nav ul {
  list-style: none;
  display: flex;
}
nav ul li {
  margin-left: 1.5rem;
}
nav ul li a {
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
}

/* Header */
header {
  text-align: center;
  padding: 4rem 2rem 2rem;
  background: linear-gradient(135deg, #5f6cff, #00d4ff);
  color: #fff;
  box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.2);
}
header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}
header p {
  font-size: 1.2rem;
  font-weight: 300;
}
header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Section */
section {
  background: #ffffff;
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid #5f6cff;
  padding-bottom: 0.3rem;
}

/* Skills */
.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.skills-list li {
  background-color: #dee5ff;
  color: #3042ff;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(48, 66, 255, 0.3);
  transition: all 0.3s ease;
}
.skills-list li:hover {
  background-color: #5f6cff;
  color: #fff;
  box-shadow: 0 4px 10px rgba(95, 108, 255, 0.6);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: #f2f5ff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.12);
}
.project-title {
  font-size: 1.3rem;
  color: #1e1e2f;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.project-stack {
  font-size: 0.85rem;
  color: #5f6cff;
  font-weight: 600;
  margin-bottom: 1rem;
}
.project-desc {
  font-size: 0.95rem;
  color: #4a4a4a;
  flex-grow: 1;
}
.project-link {
  margin-top: 1.2rem;
  text-align: right;
}
.project-link a {
  font-weight: 700;
  color: #00a6ff;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}
.project-link a:hover {
  color: #007acc;
  text-decoration: underline;
}
.project-card:hover::after {
  content: "You are now reading the 3rd scenario.";
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
}


/* Badges */
.badges {
  margin-top: 1.2em;
  margin-bottom: 1em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.7em;
  justify-content: center;
}

/* Contact */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 1rem;
}
.contact-info a {
  color: #5f6cff;
  font-weight: 600;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  color: #777;
  margin-top: auto;
  background: #f0f2f5;
}
.heisenberg-name {
  display: inline-block;
  width: 180px; /* Lock to a safe width that fits both names */
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  line-height: 1.5; /* Adjust as needed */
  padding-top: 6px;  /* Slightly more top padding */
  padding-bottom: 6px; /* And bottom padding */

  font-family: 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #e0e0e0;
  background-color: #00008b;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.heisenberg-hover {
  font-family: 'Courier New', monospace;
  color: #9be4c3;
  background-color: #111;
  transform: scale(1.05);
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(155, 228, 195, 0.1);
}


/* Mobile Responsiveness */
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    background-color: #1e1e2f;
    position: absolute;
    right: 0;
    top: 60px;
    width: 200px;
    border-radius: 0 0 0 10px;
    padding: 1rem 0;
    display: none;
  }
  nav ul.active {
    display: flex;
  }
  nav ul li {
    margin: 0.5rem 1rem;
  }
  nav .menu-toggle {
    display: block;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
  }

  header h1 {
    font-size: 2rem;
  }
  header p {
    font-size: 1rem;
  }
  section h2 {
    font-size: 1.5rem;
  }
  .project-title {
    font-size: 1.1rem;
  }
  .project-desc {
    font-size: 0.9rem;
  }
  .project-link a {
    font-size: 0.9rem;
  }
}

@media (min-width: 601px) {
  nav .menu-toggle {
    display: none;
  }
}


.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  align-items: stretch;
}

.projects-grid img {
  width: 100%;
  height: 220px; /* Set a fixed height for all images */
  object-fit: cover; /* Crops images to fill box, maintaining aspect ratio */
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #eaeaea;
  display: block;
  margin: 0 auto;
  transition: box-shadow 0.3s, transform 0.2s;
}

.projects-grid img:hover {
  box-shadow: 0 6px 18px rgba(124,201,176,0.23);
  transform: translateY(-4px) scale(1.03);
}
.img-tile {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 12px;
  background: #eaeaea;
}
.img-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Light pastel poetic style with CSS Grid layout for poems */
.poem {
  width: 90%;
  max-width: 1000px;
  margin: 2.5rem auto;
  padding: 1.8rem 2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f9f9f9 0%, #e8f0f2 100%);
  box-shadow: 0 5px 15px rgba(0,0,0,0.07);
  border-left: 5px solid #7cc9b0;
  font-family: 'Courier New', monospace;
  color: #222;
  line-height: 1.7;

  display: grid;
  grid-template-columns: 1fr 1.4fr;
grid-template-areas:
  "media text"
  "overflow overflow";
  gap: 1.8rem;
  align-items: start;

  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.poem:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* Grid areas */
.poem__media {
  grid-area: media;
  margin: 0;
}

.poem__media img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.poem__media figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
  font-style: italic;
  text-align: center;
}

.poem__text {
  grid-area: text;
}

.poem__text h2 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.8em;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #2c2c2c;
  margin-bottom: 0.5em;
}

.poem__text pre {
  white-space: pre-wrap;
  font-size: 1rem;
  font-style: italic;
  color: #444;
  letter-spacing: 0.02em;
  margin: 0;
}

.poem__overflow {
  grid-area: overflow;
}

.poem__overflow pre {
  white-space: pre-wrap;
  font-size: 1rem;
  font-style: italic;
  color: #444;
  letter-spacing: 0.02em;
  margin: 0;
  margin-top: 0.8rem;
}



/* Enhanced hover effect for images */
.poem:hover .poem__media img {
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  transform: translateY(-3px);
}

/* Responsive design */
@media (max-width: 700px) {
  .poem {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "text"
      "overflow";
  }
  .poem__media img {
    max-height: 280px;
    object-fit: cover;
  }
  .poem__text h2 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #2c2c2c;
  margin-bottom: 0.5em;
}
  .poem__text pre,
  .poem__overflow pre {
    font-size: 0.9rem;
    line-height: 1.9;
  }
}



/* Back link styles (keep these unchanged) */
a.back {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #7cc9b0;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin: 2.5rem auto 0;
  width: max-content;
  text-align: center;
}

a.back:hover {
  background-color: #67b299;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

a.back:active {
  transform: scale(0.98);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

a.back:focus {
  outline: 3px solid #7cc9b0;
  outline-offset: 3px;
}

@media screen and (max-width: 480px) {
  a.back {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

footer nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #ffffffdd;
  text-align: center;
  padding: 1rem 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}
/* Prevent any horizontal overflow */
html, body {
  overflow-x: hidden;
}

/* Ensure all images behave as block-level, fluid elements */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Contain any fixed footer/nav so it doesn't push page height */
footer nav {
  box-sizing: border-box;
  /* make sure it's always on top */
  z-index: 200;
}

#story p.preformatted {
  white-space: pre-line;
  line-height: 1.6;
  font-size: 1rem;
  color: #333;
}



/* ==== CLEANED UP IMAGE GALLERY STYLES ==== */

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: #fffdfc;
  font-family: 'Segoe UI', sans-serif;
  text-align: center;
}

.gallery-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #444;
}

.gallery-quote {
  font-style: italic;
  color: #777;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.gallery-quote span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #aaa;
}

/* ==== GRID LAYOUT ==== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  animation: fadeIn 0.8s ease-in;
}

.gallery-grid figure {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #f8f8f8;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.gallery-grid img.loaded {
  opacity: 1;
}

.gallery-grid figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

/* ==== RESPONSIVE ==== */

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ==== BACK BUTTON ==== */

.back-button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  background-color: #f3e8ff;
  color: #5a189a;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(90, 24, 154, 0.2);
  font-weight: bold;
  transition: background 0.2s ease;
}

.back-button:hover {
  background-color: #e0c9ff;
}

/* ==== ANIMATION ==== */

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