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

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-focus-ring-color: transparent;
  outline: none;
}

:root {
  --scrollbar-thumb-color: black;

  /* --color-accent-100: #f59e0b;
  --color-accent-200: #d97706; */

  --color-accent-100: rgba(249, 176, 44, 0.85);
  --color-accent-200: rgba(240, 126, 34, 0.85);

  --foreground: 0 0% 3.9%;
  --muted-foreground: 240 5% 64.9%;
}

/* Dark mode override */
@media (prefers-color-scheme: dark) {
  :root {
    --scrollbar-thumb-color: white;
    /* --color-accent-100: #b45309;
    --color-accent-200: #78350f; */

    /* --foreground: 0 0% 98%; */
    /* --muted-foreground: 240 5% 84.9%; */
  }
}

html,
body {
  width: 100dvw;
  height: 100dvh;
  color: var(--foreground);
}

html {
  background-color: black;
  overflow: hidden;
}

body {
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-color) transparent;
  opacity: 1;
}

/* 
 * HOME BODY
 */
body.home {
  --scrollPercentage: 0;
  --angle: 135deg; /* default starting angle */

  background: radial-gradient(
    circle at var(--scrollPercentage) 0%,
    rgba(255, 255, 196, 1) 0%,
    rgba(255, 97, 100, 1) 50%,
    rgba(176, 0, 18, 1) 100%
  );

  background-attachment: fixed;
  transition: background 0.1s linear;
}

body.home .container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow-y: auto;
  position: relative;

  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 3px, transparent 0);
  background-size: 20px 20px;
  background-position: -5px -5px;
}

body.home .container::before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;

  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 3px, transparent 0);
  background-size: 10px 10px;
  background-position: -10px -10px;

  animation: opacity-pulse 3s infinite alternate;
}

@keyframes opacity-pulse {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

body.home::after {
  content: " ";
  position: fixed;
  left: 0;
  top: env(safe-area-inset-top);
  width: 100%;
  height: 100%;
  /* background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.2) 80%,
    rgba(0, 0, 0, 0.5) 100%
  ); */
  pointer-events: none;
  z-index: 1;
}

.container::-webkit-scrollbar {
  width: 4px;
}
.container::-webkit-scrollbar-track {
  background: transparent;
}
.container::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-color);
  border-radius: 4px;
}

/* 
 * HERO SECTION
 */
section.hero {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: end center;
  padding-bottom: 20vh;
  padding-inline: 10vw;
}

section.hero h1 {
  color: rgba(255, 255, 255, 0.45);
  -webkit-text-stroke: 1px white;
  font-size: 9vw;
  text-wrap: nowrap;
  cursor: default;
  user-select: none;
}
section.hero h1 span {
  display: inline-block;
  cursor: none;
  transition: transform 0.3s;
}

section.hero h1 span:hover {
  color: white;
}

section.hero h2 {
  font-family: monospace;
  text-shadow: 0px 2px rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.95);
  max-width: 70vw;

  cursor: default;
  user-select: none;
  font-size: 1.2rem;
  line-height: 2rem;
}
section.hero h2 path {
  filter: drop-shadow(0px 2px rgba(0, 0, 0, 0.5));
}
@media (width < 600px) {
  section.hero h2 {
    font-size: 1rem;
    line-height: 1.4rem;
  }
}

section.hero h2 a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  transition: letter-spacing 0.2s ease-in-out;
  user-select: none;
  line-height: 4rem;
  /* cursor: s-resize; */
}
section.hero h2:has(a:hover) span,
section.hero h2:has(a:focus-visible) span {
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 0px rgba(0, 0, 0, 0.5);
}

/* 
 * PROJECTS SECTION
 */
section.projects {
  width: 100%;
  height: 80%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-inline: auto;
  padding-top: 2rem;
  padding-inline: 10vw;
}

@media (min-width: 800px) {
  section.projects {
    /* grid-template-columns: 1fr 1fr; */
    /* grid-template-rows: 1fr 1fr 1fr; */
  }
}

.project-item {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  background-color: rgba(0, 0, 0, 0.5);
  position: relative;
}
.project-item:focus-visible {
  outline: 4px solid white;
  outline-offset: 4px;
}

.project-item picture,
.project-item img,
.project-item source {
  max-height: 300px;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-item span.title {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  transform: translate(-50%, -50%);
  font-weight: 900;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  user-select: none;
  font-family: monospace;
}
.project-item span.title > *:first-child,
.project-item span.title > *:last-child {
  display: none;
}

.project-item span.title:hover > *:first-child,
.project-item span.title:hover > *:last-child {
  display: inline;
}
.project-item span.title:hover {
  -webkit-text-stroke: 1px white;
  color: transparent;
}

.project-item span.info {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-family: monospace;
  cursor: default;
  user-select: none;
}

/* 
 * FOOTER
 */

footer {
  padding: 2rem;
  display: flex;
  position: relative;
  z-index: 2;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-family: monospace;
  cursor: default;
  background-color: rgba(16, 16, 16, 1);
  color: white;
}

footer .socials {
  display: flex;
  gap: 1rem;
}

footer .socials a {
  text-decoration: none;
  color: lightgray;
  position: relative;
}
footer .socials a:focus-visible::before {
  content: "↓";
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 0.4rem);
  left: 0;
  width: 100%;
  height: 100%;
  color: lightgray;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}

footer .legals a {
  text-decoration: none;
  color: lightgray;
}
footer .legals a:focus-visible,
footer .legals a:hover {
  text-decoration: underline;
}

/* 
 * ANIMATION
 */
@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
  }
}
.bounce {
  animation: bounce 0.6s ease;
  border-radius: 50%;
}

/* 
 * VIEW TRANSITION
 */
@view-transition {
  navigation: auto;
}

#chatapp-bg,
body.chat #bg {
  view-transition-name: chatapp-bg;
}

body.chat {
  overflow: hidden;
}

body.chat #bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
