/* ===================== Base tokens ===================== */
:root {
  --page-bg: #EDD4B2;
  --nav-bg: #b5937d;
  --home-block: #D0A98F;
  --home-sublock: #D0A98F;
  --footer-bg: #453F3C;
  --text-color: #000000;
  --text-hover: var(--footer-bg);
  --footer-height: 5%;

  /* Semantic extras */
  --divider-color: var(--footer-bg);
  --topbar-bg: rgba(0, 0, 0, 0.25);

  /* Section/background helpers */
}

/* ===================== Page themes (override only variables) ===================== */
body.home-page {
  /* (Same as defaults, here for clarity / future tweaks) */
  --page-bg: #EDD4B2;
  --nav-bg: #b5937d;
  --home-block: #D0A98F;
  --home-sublock: #D0A98F;

  --text-color: #000000;
  --nav-text-color: #1b1b1b;
  
  --text-hover: #7a5a7d;
  --divider-color: #453F3C;
  --topbar-bg: rgba(2, 43, 58.25);

  --body-bg-colour: #e1ded9;
  --body-colour: #ffffff;

  --code-text: #7a5a7d;
}

body.about-page {
  /* (Same as defaults, here for clarity / future tweaks) */
  --page-bg: #EDD4B2;
  --nav-bg: #b5937d;
  --home-block: #D0A98F;
  --home-sublock: #D0A98F;
  --text-color: #000000;
  --text-hover: var(--footer-bg);
  --divider-color: #453F3C;
  --topbar-bg: rgba(0, 0, 0, 0.25);
  --body-bg-image: none;
}

body.blog-page {
  --page-bg: #1e1e1e;
  --nav-bg: #2a2a2a;
  --home-block: #333333;
  --home-sublock: #444444;
  --text-color: #000000;
  --text-hover: #cccccc;
  --divider-color: #3d3d3d;
  --topbar-bg: rgba(0, 0, 0, 0.35);
  --body-bg-image: none;
}


/* ===================== Base layout ===================== */

html {
  display: flex;
  position: relative;
  min-height: 100vh;
  font-size: 14px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;

  flex-direction: column;
}

/* ------------Default view -------------- */

.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ----------------------------- */
@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  display: flex;
  color: var(--text-color);
  background: var(--body-bg-image, var(--page-bg));
  background-color: var(--body-bg-colour);
  background-repeat: repeat;
  
  font-family: 'Fira Code', monospace;

  /* pull page theme in */
}

/* =====================  ===================== */


/* ===================== Motion prefs ===================== */
@keyframes zoomout {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===================== Top bar / Nav ===================== */

.top-bar {
  position: fixed;
  display: flex;
  flex-direction: row;
  justify-items: center;
  text-align: center;
  width: 100%;
  height: 6vh;
  z-index: 9999;
}

.heart-box{
  width: 60px;
  height: 50px;
  display: flex;
  align-items: center;
}

.heart{
  opacity: 0;
  transition: opacity 1s ease-in-out;
  font-size: 32px;
  color: red;
  pointer-events: none; /* important: hover is on the box, not the heart */
}

.heart-box:hover .heart{
  opacity: 1;
}

.nav {
  display: flex;
  width: 30%;

  align-items: center;
  justify-content: left;
  color: var(--nav-text-color);
  margin-left: 5%;
  padding-left: 2%;
  border-bottom: var(--nav-text-color) solid 2px;
}

.navbar-list {
  display: flex;
  align-items: center;
  justify-content: left;
  flex-direction: row;
  height: auto;
  gap: 2rem;
  padding: 0 0;
  margin: 0;
  list-style: none;
}

.navbar-icon, .contacts-icon {
  width: 50px; 
  height: 50px;
  border-radius: 1em;
  object-fit: contain;
}

.link, .link:active {
  color: var(--nav-text-color);
  text-decoration: none;
  position: relative;
}

.link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.4rem;   /* space under text */
  width: 5px;        /* dot size */
  height: 5px;
  border-radius: 50%;  /* make it a dot */
  background: var(--nav-text-color);
  transform: translateX(-50%);  /* center the dot */
  transition: all 0.3s ease;
}

.link:hover::after {
  width: 90%;       /* expand to underline */
  height: 2px;       /* flatten */
  border-radius: 0;  /* no more round edges */
  left: 0;           /* align left */
  background: var(--nav-text-color);
  transform: none;
}

.link:hover, .navbar-icon:hover {
  color: var(--nav-text-color);
}

/* ===================== Layout blocks ===================== */
.portfolio-container {
  display: flex;
  flex-direction: column;
  margin: 10vh 0 0 0;
  width: 100%;
  min-height: 90vh;   /* allow it to expand */
  height: auto;       /* let content decide height */
}

.inner-box {
  display: flex;
  justify-content: space-between;
  width: 90%;
  height: 100%;
  margin: 0 auto;
  align-items: flex-start;
}

.blog-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.blog-header {
  margin: 10vh auto 0;
  width: 80%;
  text-align: center;
  border-bottom: 2px solid var(--divider-color);
}

.blog {
  height: 33%;
  width: 33%;
  margin: 0;
  border: 2px solid var(--divider-color);
}

#about, #blog, #project{
  height: 100vh;
  width: 100%;
  margin: 0;
}

#home {
  display: flex;
  flex-direction: column;
  background-image: var(--home-bg-image);
  background-size: 100px auto;
  background-repeat: repeat;
  background-position: top left;
  margin: 0;
  height: 100vh;
  width: 100%;
}

/* ===================== Profile / contacts ===================== */
.me-info {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  height: fit-content;  
}

.me-info::before {
  content: "";
  position: absolute;
  left: 5%;
  bottom: 10%;   /* space under text */
  width: 40%;        /* dot size */
  height: 2.5px;
  background: black;
}

.me-info::after {
  content: "";
  position: absolute;
  left: 5%;
  bottom: 10%;   /* space under text */
  width: 2.25px;        /* dot size */
  height: 40%;
  background: black;
}

.me-text {
  font-weight: bold;
  display: flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 0;
}

.comment {
  color: var(--code-text);
  margin: 0;
}

.contacts-list {
  margin: 0.5rem 0;
  display: flex;
  gap: 1rem;
  border-radius: 1rem;
}

.contacts-icon {
  width: 2rem;
  height: 2rem;
  transition: filter 0.2s;
}

.contacts-icon:hover {
  color:  var(--text-hover)
}

/* ===================== Terminal ===================== */
.terminal {
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: large;
  color: var(--code-text);
  width: fit-content;
  max-width: 100%;
}

.command {
  overflow: hidden;
  border-right: 0.15em solid var(--code-text);
  height: fit-content;
  width: fit-content;
}

.output {
  font-family: 'Courier New', Courier, monospace;
  color: var(--code-text);
  margin: 0.5rem 0;
  white-space: nowrap;
}


/* ===================== Snake ===================== */
.snake-box,
.terminal-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: fit-content;
  gap: 1rem;
}

.display {
  position: relative;
  width: 50%;
  height: 100%;
  margin: 0;
}

.display::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;   /* space under text */
  width: 40%;        /* dot size */
  height: 2.5px;
  background: black;
}

.display::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;   /* space under text */
  width: 2.25px;        /* dot size */
  height: 40%;
  background: black;
}

#game-board {
  border: 1px solid rgba(13, 13, 13, 0.5);
  position: relative;
}

.snake-part {
  width: 20px;
  height: 20px;
  background-color: rgb(0, 0, 0);
  position: absolute;
}

#food {
  width: 20px;
  height: 20px;
  background-color: rgb(128, 24, 4);
  position: absolute;
  border-radius: 0.5em;
}

.game-hover {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-color);
  z-index: 1;
  pointer-events: none;
}

.snake-input {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.snake-input input {
  border-radius: 10px;
  border: 2px solid var(--text-color);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: 0.3s ease;
}

.invalid-name input {
  border: 2px solid red;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0 2rem;
}

/* ------------- PORTFOLIO -----------------*/

.port-box {
  display: flex;
  flex-direction: column;
  width: 90%;
  height: 100%;
  margin: 0 auto;
}

.project-header {
  flex: 0 0 30%;
  width: 10%;
  
  justify-items: left; /* text align*/
  align-items: center; 
}

.project-holder {
  flex: 1 1 30%;
  width: min-content;

}

/* ===================== Animations ===================== */
@keyframes blink { 50% { opacity: 1; } }

@keyframes typewriter {
  from { max-width: 0; }
  to   { max-width: 100%; }
}

@keyframes blinkingCursor {
  from { border-right-color: rgba(0, 0, 0, 0.75); }
  to { border-right-color: transparent; }
}

@keyframes moveUpDown {
  0% { bottom: 0; }
  100% { bottom: 1rem; }
}

.hidden {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  transform: translateY(0.4rem);
}

.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== Misc ===================== */
.next-page {
  display: flex;
  margin: 5vh auto;
  width: 30px;
  height: 30px;
  animation: moveUpDown 2s ease-in-out infinite;

  filter: invert(100%)
}

.animationUpDown {
  position: relative;
  animation: moveUpDown 2.5s ease-in-out infinite alternate;
}

.hover, .text-hover { transition: all 1s ease; }
.hover:hover { transform: scale(1.2); color: var(--text-hover);}
.text-hover:hover { font-size: 2rem; }

.cursor {
  border-right: 2px solid rgba(255, 255, 255, .75);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.typewriter-animation {
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  border-right: 2px solid rgba(255, 255, 255, .75);
  animation:
    typewriter 2s steps(45) 1s 1 normal both,
    blinkingCursor 550ms steps(45) infinite normal;
}

/* OTHERS */

.colour {
  display: flex;
  flex: 1 1 auto;
  height: 100vh;

  justify-content: center;
  align-items: center;
}

