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

button {
  all: unset;
}

a {
  color: #2b802c;
}

[hidden] {
  display: none !important;
}

[data-section].is-entering {
  animation: section-enter 560ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

@keyframes section-enter {
  from {
    opacity: 0;
    transform: translateY(1.25rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@font-face {
  font-family: 'DIN Next Slab Pro';
  src: url('font/din-next-slab-pro.otf') format('opentype');
}

:root {
  --black: #0b0b0a;
  --panel: #171713;
  --cream: #f1ead8;
  --cream-dark: #8c8778;
  --muted: #a8a18f;
  --muted-dark: #4f4b42;
  --muted-gradient: linear-gradient(90deg, 
  var(--muted-dark), 
  var(--muted) 30%, 
  var(--muted) 70%, 
  var(--muted-dark));
  --cream-gradient: linear-gradient(90deg, 
  var(--cream-dark), 
  var(--cream) 30%, 
  var(--cream) 70%, 
  var(--cream-dark));
  --section-max-width: 72rem;
  --projects-max-width: 84rem;
  --chrome-height: clamp(5rem, 8vh, 8rem);
  --padding: clamp(1.25rem, 4vw, 4.5rem);
}

body {
  font-family: 'DIN Next Slab Pro', serif;
  color: var(--muted);
  background-color: var(--black);
  cursor: url('./imgs/mouse-cursor.png'), auto;
}


main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - (var(--chrome-height) * 2));
  min-height: 0;
  max-width: 88rem;
  padding: clamp(0.75rem, 2vh, 1.5rem) 0;
  overflow: hidden;
  margin: 0 auto;
}

/* Header Styles */
#header, #footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--chrome-height);
  min-height: var(--chrome-height);
  flex-shrink: 0;
  padding: 0 var(--padding);
  border-top: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  background-color: var(--panel);
  text-transform: uppercase;
  letter-spacing: 0.2rem;
}

#header button {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.2vw, 1.5rem);
}

#header button[data-target="home"] {
  justify-content: left;
  text-align: left;
}

#header button[data-target="contact"] {
  justify-content: right;
  text-align: right;
}

#header i {
  display: grid;
  align-self: center;
  width: clamp(0.7rem, 1vw, 1rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #2b802c;
  box-shadow: 0 0 0 0.3rem rgba(141, 187, 116, 0.1);
}

#header nav span {
  color: var(--muted);
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

#header .logo-box {
  display: grid;
  width: clamp(2.5rem, 4vw, 4rem);
  height: clamp(2.5rem, 4vw, 4rem);
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid var(--muted);
}

#header .logo-box b {
  transform: rotate(-45deg);
  color: var(--muted);
  font-family: 'Times New Roman';
  letter-spacing: 0.1rem;
  font-size: clamp(1.2rem, 1.7vw, 1.8rem);
}

#header p{
  color: var(--cream);
}

#header small {
  color: var(--muted);
  font-size: clamp(0.8rem, 1.1vw, 1.1rem);
}

#header nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 3.5rem);
}

#header nav button {
  position: relative;
  font-size: clamp(0.9rem, 1.4vw, 1.35rem);
  background: var(--muted-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  transition: scale 180ms ease-in-out, filter 180ms ease;
}

#header nav button:hover { 
  background: var(--cream-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  scale: 1.3;
}

#header nav button[aria-current="page"] { 
  background: var(--cream-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

#header nav button[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: -2px;
  height: 1px;
  background: var(--cream);
  content: "";
}

/* Home Styles */
#home {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: 2rem;
  width: min(100%, var(--section-max-width));
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 7vw, 6rem);
  border: 1px solid rgb(241 234 216 / 18%);
  border-radius: 1rem 1rem 0.35rem 0.35rem;
  background:
    linear-gradient(rgb(11 11 10 / 68%), rgb(11 11 10 / 88%)),
    url('./imgs/smoke2.gif') center / cover no-repeat,
    var(--panel);

  text-align: center;
}

#home::before,
#home::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}

#home::before {
  inset: 0.35rem;
  border: 1px solid rgb(241 234 216 / 12%);
  border-radius: 0.7rem 0.7rem 0.2rem 0.2rem;
}

#home::after {
  right: 8%;
  bottom: -0.45rem;
  left: 8%;
  height: 0.5rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 55%);
  filter: blur(0.5rem);
}

#home > * {
  position: relative;
  z-index: 1;
}

#about,
#projects,
#contact {
  position: relative;
  isolation: isolate;
  width: min(100%, var(--section-max-width));
  padding: clamp(1rem, 3vh, 2.5rem) clamp(1.5rem, 5vw, 5rem);
  border: 1px solid rgb(241 234 216 / 18%);
  border-radius: 1rem 1rem 0.35rem 0.35rem;
  background:
    linear-gradient(rgb(11 11 10 / 68%), rgb(11 11 10 / 88%)),
    url('./imgs/smoke2.gif') center / cover no-repeat,
    var(--panel);
}

#projects {
  width: min(100%, var(--projects-max-width));
}

#about::before,
#about::after,
#projects::before,
#projects::after,
#contact::before,
#contact::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}

#about::before,
#projects::before,
#contact::before {
  inset: 0.35rem;
  border: 1px solid rgb(241 234 216 / 12%);
  border-radius: 0.7rem 0.7rem 0.2rem 0.2rem;
  box-shadow: inset 0 0 1.5rem rgb(0 0 0 / 65%);
}

#about::after,
#projects::after,
#contact::after {
  right: 8%;
  bottom: -0.45rem;
  left: 8%;
  height: 0.5rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 55%);
  filter: blur(0.5rem);
}

#about > *,
#projects > *,
#contact > * {
  position: relative;
  z-index: 1;
}

#home .ornament {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

#home .ornament span {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--muted));
}

#home .ornament span:last-child {
  background: linear-gradient(90deg, var(--muted), transparent);
}

#home header, 
#about header, 
#projects header p, 
#contact header {
  letter-spacing: 0.2rem;
  text-transform: uppercase;
}

#home header b {
  padding: 0 1rem;
  font-size: 1.5rem;
}

#home h1 {
  color: var(--cream);
  font-size: 7rem;
  font-weight: lighter;
  line-height: 0.8;
}

#home h1 em, 
#about h2 em,
#projects header em,
#contact h2 em {
  color: var(--muted);
  font-style: italic;
}

#home p, 
#about p,
#projects aside p, 
#contact p {
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1.5;
}

#home nav {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 1rem;
}

#home nav button {
  --button-padding-x: 1.5rem;
  --hover-transform: translate(-0.75rem, -0.35rem) scale(1.05);
  position: relative;
  isolation: isolate;
  overflow: visible;
  z-index: 1;
  width: 100%;
  padding: 1.5rem;
  font: inherit;
  text-align: center;
  font-size: 1.7rem;
  color: transparent;
  background: var(--muted-gradient) top / 100% 2px no-repeat,
    var(--muted-gradient) bottom / 100% 2px no-repeat,
    var(--panel);
}

/* Moving highlight */
#home nav button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      transparent,
      var(--cream-dark) 20%,
      var(--cream-dark) 80%,
      transparent) top / 100% 2px no-repeat,
    linear-gradient(90deg,
      transparent,
      var(--cream-dark) 20%,
      var(--cream-dark) 80%,
      transparent) bottom / 100% 2px no-repeat,
    url("./imgs/smoke.gif") center / cover no-repeat,
    var(--panel);
  opacity: 0;
  transform: none;
  transform-origin: bottom right;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

/* Text above the highlight */
#home nav .button-label {
  position: relative;
  z-index: 3;
  isolation: isolate;
  display: block;
  width: 100%;
  background: var(--muted-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;  
  transform: none;
  transform-origin: bottom right;
  transition:
    transform 180ms ease,
    color 180ms ease;
}

#home nav button:hover,
#home nav button:focus-visible {
  z-index: 2;
}

#home nav button:hover::before,
#home nav button:focus-visible::before {
  opacity: 1;
  transform: var(--hover-transform);
  box-shadow: 0 0.6rem 1.2rem rgb(0 0 0 / 45%);
}

#home nav button:hover .button-label,
#home nav button:focus-visible .button-label {
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  color: var(--muted);
  transform: var(--hover-transform);
}

#home nav .button-label::before {
  content: "";
  position: absolute;
  inset: -0.12em calc(-1 * var(--button-padding-x, 0px));
  width: auto;
  max-width: none;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgb(0 0 0 / 70%),
    rgb(0 0 0 / 70%),
    transparent
  );
  filter: blur(0.2rem);
  opacity: 0;
  transition: opacity 180ms ease;
}

#home nav button:hover .button-label::before,
#home nav button:focus-visible .button-label::before {
  opacity: 1;
}

/* About Me Styles */
#about {
  display: flex;
  gap: 5rem;
}

#about article {
  padding: 1rem;
  border-radius: 0.5rem;
}

#about figure {
  position: relative;
  width: min(100%, 30rem);
  aspect-ratio: 4 / 5.3;
  justify-self: center;
  padding: 0.8rem;
}

#about figure::before,
#about figure::after {
  content: "";
  position: absolute;
  width: 55%;
  height: 45%;
  pointer-events: none;
}

#about figure::before {
  top: 0;
  left: 0;
  border-top: 1px solid var(--muted);
  border-left: 1px solid var(--muted);
}

#about figure::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
}

#about figure img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

#about figcaption {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
}

#about h2, 
#projects header h2, 
#contact h2 {
  color: var(--cream);
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: lighter;
  line-height: 0.9;
}

#about aside {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--muted);
}

#about aside h3 {
  color: var(--cream);
  font-weight: lighter;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
}

#about aside ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  list-style: none;
}

#about aside li {
  color: var(--cream);
}

#about aside li span {
  margin-right: 0.6rem;
  color: var(--muted);
}

.home-button {
  --button-padding-x: 1rem;
  margin-top: 1rem;
  text-align: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
  border: 0;
  background: linear-gradient(90deg,
    var(--muted-dark),
    var(--muted) 30%,
    var(--muted) 70%,
    var(--muted-dark)) top / 100% 2px no-repeat,
    linear-gradient(90deg,
    var(--muted-dark),
    var(--muted) 30%,
    var(--muted) 70%,
    var(--muted-dark)) bottom / 100% 2px no-repeat,
    var(--panel);
  color: var(--muted);
  transition: color 180ms ease, background 180ms ease;
}

.home-button:hover,
.home-button:focus-visible {
  background: linear-gradient(90deg,
    var(--cream-dark),
    var(--cream) 30%,
    var(--cream) 70%,
    var(--cream-dark)) top / 100% 2px no-repeat,
    linear-gradient(90deg,
    var(--cream-dark),
    var(--cream) 30%,
    var(--cream) 70%,
    var(--cream-dark)) bottom / 100% 2px no-repeat,
    var(--panel);
  color: var(--cream);
}

/* Projects Styles */
#projects {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

#projects header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#projects nav,
.arrow-buttons {
  display: flex;
  gap: 1rem;
}

#projects nav button,
.arrow-buttons button {
  display: grid;
  width: 3rem;
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  background: var(--muted-gradient) top / 100% 1px no-repeat,
    var(--muted-gradient) bottom / 100% 1px no-repeat,
    var(--panel);
}

#projects article {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

#project-visual {
  overflow: hidden;
  border: 1px solid var(--muted);
  width: clamp(24rem, 42vw, 36rem);
  max-height: 45vh;
  flex: 0 1 clamp(24rem, 42vw, 36rem);
  aspect-ratio: 4 / 3;
  background: var(--panel);
}

#project-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#projects aside {
  flex: 1 1 0;
  padding: 1rem;
  border-radius: 0.5rem;
}

#projects aside h3 {
  color: var(--cream);
  font-size: clamp(3rem, 4vw, 4rem);
  font-weight: 400;
}

#projects aside p {
  white-space: pre-line;
}

#project-tags {
  display: flex;
  gap: 1rem;
  list-style: none;
}

#project-tags li {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--cream);
  background: var(--panel);
  color: var(--cream);
  text-transform: uppercase;
}

.project-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

#projects .project-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#projects a {
  display: flex;
  align-items: center;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--cream);
  color: var(--cream);
  font-size: 1.3rem;
  font-style: italic;
}

/* Contact Styles */
#contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.contact-details {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--muted);
  justify-items: center;
}

.contact-details span {
  text-transform: uppercase;
}

.contact-details a {
  font-size: clamp(2rem, 3vw, 3rem);
}

.contact-details button {
  border-bottom: 1px solid var(--muted);
  color: var(--muted);
  text-transform: uppercase;
}


/* Footer Styles */
#footer > p {
  font-size: clamp(0.85rem, 1.2vw, 1.2rem);
}

#footer nav {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

#footer nav a {
  display: grid;
  place-items: center;
  width: clamp(2.5rem, 4vw, 4rem);
  aspect-ratio: 1;
}

#footer nav i {
  color: var(--muted);
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
}

.site-button {
  --hover-transform: translate(-0.75rem, -0.35rem) scale(1.05);
  position: relative;
  display: flex;
  justify-content: center;
  isolation: isolate;
  overflow: visible;
  z-index: 1;
  background: linear-gradient(90deg,
    var(--muted-dark),
    var(--muted) 10%,
    var(--muted) 90%,
    var(--muted-dark)) top / 100% 1px no-repeat,
    linear-gradient(90deg,
    var(--muted-dark),
    var(--muted) 10%,
    var(--muted) 90%,
    var(--muted-dark)) bottom / 100% 1px no-repeat,
    var(--panel);
  color: transparent;
}

.site-button::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      transparent,
      var(--cream-dark) 20%,
      var(--cream-dark) 80%,
      transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg,
      transparent,
      var(--cream-dark) 20%,
      var(--cream-dark) 80%,
      transparent) bottom / 100% 1px no-repeat,
    url("./imgs/smoke.gif") center / cover no-repeat,
    var(--panel);
  content: "";
  opacity: 0;
  transform: none;
  transform-origin: bottom right;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.site-button .button-label {
  position: relative;
  z-index: 3;
  isolation: isolate;
  display: block;
  width: 100%;
  background: linear-gradient(90deg,
    var(--muted-dark) 0%,
    var(--muted) 5%,
    var(--muted) 95%,
    var(--muted-dark) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  transform: none;
  transition: transform 180ms ease;
}

.site-button .button-label::before {
  position: absolute;
  z-index: -1;
  inset: -0.12em calc(-1 * var(--button-padding-x, 0px));
  max-width: none;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgb(0 0 0 / 70%),
    rgb(0 0 0 / 70%),
    transparent
  );
  border-radius: 50%;
  content: "";
  filter: blur(0.2rem);
  opacity: 0;
  transition: opacity 180ms ease;
}

.site-button:hover,
.site-button:focus-visible {
  z-index: 2;
}

.site-button[aria-selected="true"] {
  z-index: 2;
}

.site-button:hover::before,
.site-button:focus-visible::before {
  opacity: 1;
  transform: var(--hover-transform);
  box-shadow: 0 0.6rem 1.2rem rgb(0 0 0 / 45%);
}

.site-button[aria-selected="true"]::before {
  opacity: 1;
  transform: var(--hover-transform);
  box-shadow: 0 0.6rem 1.2rem rgb(0 0 0 / 45%);
}

.site-button:hover .button-label,
.site-button:focus-visible .button-label {
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  color: var(--muted);
  transform: var(--hover-transform);
}

.site-button[aria-selected="true"] .button-label {
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  color: var(--muted);
  transform: var(--hover-transform);
}

.site-button:hover .button-label::before,
.site-button:focus-visible .button-label::before {
  opacity: 1;
}

.site-button[aria-selected="true"] .button-label::before {
  opacity: 1;
}

@media (max-height: 800px) {
  #home,
  #about,
  #projects,
  #contact {
    gap: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  #home h1 {
    font-size: 5.5rem;
  }

  #home p,
  #about p,
  #projects aside p,
  #contact p {
    margin: 0.75rem 0;
    font-size: 1.1rem;
  }

  #about h2,
  #projects header h2,
  #contact h2 {
    font-size: 3.25rem;
  }

  #project-visual {
    max-height: 34vh;
  }
}