/* =========================
   THEME & GLOBAL BASELINE
   ========================= */
:root {
  --color-bg-dark: #333;
  --color-text: #111;
  --color-text-invert: #fff;
  --color-text-subtle: #f2f2f2;
  --color-border: rgba(0, 0, 0, .08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --footer-h: 46px;
  /* footer height + body padding */
  --nav-h: 40px;
  /* default navbar height (JS can override) */
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(0, 120, 255, .8);
  outline-offset: 2px;
}

@media (prefers-reduced-motion:reduce) {
  * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================
   NAVBAR (all pages)
   ========================= */
.navbar {
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background-color: var(--color-bg-dark);
  color: var(--color-text-invert);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  /* hairline divider */
}

.navbar a {
  display: block;
  color: var(--color-text-subtle);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

.navbar a:hover,
.navbar a:focus-visible {
  background: #ddd;
  color: #000;
}

/* Hamburger */
.hamburger-menu {
  display: none;
}

@media (max-width:768px) {
  .hamburger-menu {
    display: block;
  }

  .menu-icon {
    display: block;
    font-size: 30px;
    cursor: pointer;
    margin-left: 10px;
  }

  .navbar a {
    display: none;
  }

  .menu.show {
    display: block;
  }
}

.menu {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  width: 150px;
  background: rgba(0, 0, 0, 0.8);
  z-index: 5;
  text-align: center;
  padding: 5px 0;
  border-bottom: 2px solid grey;
  border-right: 2px solid grey;
  border-bottom-right-radius: 10px;
}

.menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu li {
  padding: 10px 15px;
}

.menu a {
  color: var(--color-text-subtle);
  text-decoration: none;
  display: block;
  padding: 10px 15px;
}

.menu a:hover {
  background: #ddd;
  color: #000;
}

/* =========================
   FOOTER (fixed) + overlap fix
   ========================= */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--footer-h);
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 12px;
  color: #fff;
  padding: 0 20px;
}

/* make room so content isn’t hidden under the fixed footer */
body {
  padding-bottom: var(--footer-h);
}

/* =========================
   LANDING PAGE
   ========================= */
body.index {
  background: url("/img/index_background.webp") center / cover no-repeat;
}

.landing_page_button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.landing_page_button a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 10vw;
  height: 10vw;
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  text-decoration: none;
  font-weight: bold;
  transition: background-color .3s, color .3s;
}

.landing_page_button a:hover,
.landing_page_button a:focus {
  animation: pulsate 1.5s infinite;
  background: #f2f2f2;
  color: #000;
}

/* =========================
   HOME PAGE
   ========================= */
body.home {
  background: url("/img/home_background.webp") center / cover no-repeat;
}

#first_left_sidePanel p,
#second_left_sidePanel p,
#third_left_sidePanel p,
#fourth_left_sidePanel p {
  opacity: 0;
  animation: fadeIn 1s forwards;
  text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black,
    2px 2px 5px rgba(0, 0, 0, .5);
}

#first_left_sidePanel,
#second_left_sidePanel,
#third_left_sidePanel,
#fourth_left_sidePanel {
  position: fixed;
  left: 0;
  height: 8%;
  width: 100px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 25px;
  font-weight: bold;
  text-align: center;
  line-height: 1.5;
}

#first_left_sidePanel {
  top: 20%;
  animation: slideOutFirst 2.75s forwards;
}

#second_left_sidePanel {
  top: 40%;
  animation: slideOutSecond 2.5s forwards;
}

#third_left_sidePanel {
  top: 60%;
  animation: slideOutThird 2.25s forwards;
}

#fourth_left_sidePanel {
  top: 80%;
  animation: slideOutFourth 2s forwards;
}

#first_left_sidePanel p {
  animation-delay: 2.5s;
}

#second_left_sidePanel p {
  animation-delay: 3.25s;
}

#third_left_sidePanel p {
  animation-delay: 4s;
}

#fourth_left_sidePanel p {
  animation-delay: 4.75s;
}

.earth-container {
  position: relative;
  width: 30vw;
  height: auto;
  float: right;
  margin-right: 15vw;
  margin-top: 15vh;
}

.earth-image {
  width: 100%;
  animation: earthZoom 4s;
}

.satellite-image {
  position: absolute;
  top: 0%;
  left: 5%;
  width: 25%;
  height: auto;
  transform: scale(.01);
  animation: satelliteZoom 8s linear forwards 3s;
}

/* =========================
   ABOUT PAGE
   ========================= */
body.about {
  background: url("/img/home_background.webp") center / cover fixed no-repeat;
}

.about-welcome-panel,
.about-description-panel {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: var(--radius);
  padding: 20px;
  margin: 50px auto 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.about-panels-container {
  padding-bottom: 75px;
}

.about-description-panel h1 {
  font-size: 28px;
}

.about-description-panel p {
  font-size: 18px;
}

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

/* responsive widths for about panels */
@media (max-width:480px) {
  .about-welcome-panel {
    max-width: 80%
  }

  .about-description-panel {
    max-width: 80%
  }
}

@media (min-width:481px) and (max-width:1080px) {
  .about-welcome-panel {
    max-width: 60%
  }

  .about-description-panel {
    max-width: 75%
  }
}

@media (min-width:1081px) and (max-width:1440px) {
  .about-welcome-panel {
    max-width: 60%
  }

  .about-description-panel {
    max-width: 90%
  }
}

@media (min-width:1441px) and (max-width:1920px) {
  .about-welcome-panel {
    max-width: 25%
  }

  .about-description-panel {
    max-width: 40%
  }
}

@media (min-width:1921px) {
  .about-welcome-panel {
    max-width: 70%
  }

  .about-description-panel {
    max-width: 70%
  }
}

/* =========================
   PROJECTS PAGE
   ========================= */
body.projects {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
  background: url("/img/home_background.webp") center / cover fixed no-repeat;
}

.main-content,
.centered-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 30px;
  padding-bottom: 10px;
}

/* Panels Container — keep grid */
.panels-container {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 15px;
  width: 80vw;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  justify-items: center;
}

/* Base panel */
.panel {
  backdrop-filter: blur(50px);
  border-radius: var(--radius);
  border: 3px solid var(--glass-border);
  box-shadow: 0 8px 10px rgba(0, 0, 0, .2), 0 16px 24px rgba(0, 0, 0, .2);
  aspect-ratio: 1;
  position: relative;
  min-width: 100px;
  max-width: 200px;
  transform: translateZ(0) scale(1);
  transition: transform .5s ease;
  will-change: transform;
}

.panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.panel-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.panel:hover {
  transform: translateZ(0) scale(1.15);
}

/* Label-bar variant */
.panel-with-label {
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
}

.panel-with-label img {
  width: 100%;
  height: auto;
  display: block;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.panel-label {
  background: #fff;
  color: var(--color-text);
  font-size: .95rem;
  padding: 10px 12px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.panel-link:hover .panel-label {
  background: #f7f7f7;
}

/* Responsive grid */
@media (max-width:480px) {
  .panels-container {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 10px;
  }

  .panel {
    max-width: 150px;
  }

  .main-content,
  .centered-container {
    padding-top: 10px;
    padding-bottom: 40px;
  }
}

@media (min-width:481px) and (max-width:1024px) {
  .panels-container {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .panel {
    max-width: 200px;
  }

  .main-content,
  .centered-container {
    padding-top: 30px;
    padding-bottom: 20px;
  }
}

@media (min-width:1025px) {
  .panels-container {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }
}

/* Device-specific ranges (kept) */
@media (min-width:540px) and (max-width:720px) {
  .panels-container {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 20px;
    justify-content: center;
  }

  .panel {
    max-width: 150px;
  }

  .main-content,
  .centered-container {
    padding-top: 30px;
    padding-bottom: 20px;
  }
}

@media (min-width:721px) and (max-width:1440px) {
  .panels-container {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 20px;
    justify-content: center;
  }

  .panel {
    max-width: 200px;
  }

  .main-content,
  .centered-container {
    padding-top: 30px;
    padding-bottom: 20px;
  }
}

/* =========================
   CONTACT PAGE
   ========================= */
body.contact {
  background: rgba(0, 0, 0, 0.05);
  animation: fadeIn 1.5s ease-in-out;
}

body.contact .navbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 29px;
  margin: 0;
  position: relative;
  width: 100%;
}

.contact-iframe-text {
  color: #fff;
  position: relative;
  font-size: 24px;
  font-weight: bold;
}

.contact-iframe-text::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  transition: opacity .5s ease-in-out;
  opacity: 0;
}

.form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100vh - 29px);
  padding: 20px;
  box-sizing: border-box;
}

#contact-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 300px;
}

#contact-form label {
  width: 100%;
  text-align: left;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#contact-form textarea {
  height: 50px;
  max-width: 100%;
  resize: vertical;
}

#contact-form button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: #333;
  color: #fff;
  cursor: pointer;
}

/* =========================
   PROJECT SHELL (iframe wrapper)
   ========================= */
.project-shell {
  width: 100%;
  max-width: 1200px;
  margin: 10px auto 20px;
  padding: 0 20px;
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.project-toolbar a {
  background: rgba(255, 255, 255, .85);
  color: #111;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  text-decoration: none;
}

.project-toolbar a:hover,
.project-toolbar a:focus-visible {
  background: #fff;
}

.project-frame {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 10px rgba(0, 0, 0, .2), 0 16px 24px rgba(0, 0, 0, .2);
}

/* CSS-only minimum height fallback if JS is disabled */
@supports (height: 100dvh) {
  .project-frame {
    min-height: calc(100dvh - var(--footer-h) - var(--nav-h) - 40px);
  }

  /* ~40px toolbar/margins */
}

/* =========================
   SHELL WIDE MODE (per-link)
   ========================= */
.shell-wide .project-shell {
  max-width: none;
  padding: 0;
}

.shell-wide .project-frame {
  border-radius: 0;
}

.shell-wide .project-toolbar {
  margin: 10px 20px;
}

.shell-wide .main-content,
.shell-wide .centered-container {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* =========================
   SHELL BARE MODE (full-bleed iframe, no toolbar)
   ========================= */
.shell-bare .project-toolbar {
  display: none;
}

.shell-bare .project-shell {
  max-width: none;
  padding: 0;
  margin: 0;
}

.shell-bare .main-content,
.shell-bare .centered-container {
  width: 100%;
  padding: 0;
  margin: 0;
}

.shell-bare .project-frame {
  border-radius: 0;
  box-shadow: none;
}

/* Full-viewport frame for bare mode (thicker) */
.shell-bare::before {
  content: "";
  position: fixed;
  top: var(--nav-h, 40px);
  bottom: var(--footer-h-js, var(--footer-h));
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
  /* above iframe, below navbar/footer */
  border: 2px solid rgba(255, 255, 255, .28);
  /* thicker light outer line */
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, .18) inset,
    /* thicker inner counter-line */
    0 0 0 1px rgba(0, 0, 0, .04);
  /* faint outside halo for contrast */
}


/* =========================
   ANIMATIONS
   ========================= */
@keyframes pulsate {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.5);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideOutFirst {
  0% {
    width: 0;
    padding: 0;
  }

  100% {
    width: 150px;
    padding: 0 20px;
  }
}

@keyframes slideOutSecond {
  0% {
    width: 0;
    padding: 0;
  }

  100% {
    width: 200px;
    padding: 0 20px;
  }
}

@keyframes slideOutThird {
  0% {
    width: 0;
    padding: 0;
  }

  100% {
    width: 250px;
    padding: 0 20px;
  }
}

@keyframes slideOutFourth {
  0% {
    width: 0;
    padding: 0;
  }

  100% {
    width: 300px;
    padding: 0 20px;
  }
}

@keyframes earthZoom {
  0% {
    width: 1px;
    height: auto;
  }

  100% {
    width: 30vw;
    height: auto;
  }
}

@keyframes satelliteZoom {
  0% {
    transform: translate(0%, 0%) scale(.01);
  }

  50% {
    transform: translate(-50%, -50%) scale(.5);
  }

  75% {
    transform: translate(137.5%, 137.5%) scale(1.5);
  }

  100% {
    transform: translate(275%, 275%) scale(1);
  }
}

/* tap feedback for cards */
@keyframes pulse {
  0% {
    transform: scale(1)
  }

  25% {
    transform: scale(1.05)
  }

  50% {
    transform: scale(1.15)
  }

  75% {
    transform: scale(1.05)
  }

  100% {
    transform: scale(1)
  }
}

.panel:active {
  animation: pulse .5s ease;
}