/* -----------------------------------------
   Theme variables
   - Centralize colors & fonts for easy tweaks
   ----------------------------------------- */
:root {
  --color-accent: rgb(56,136,155);
  --color-main0: rgb(242,234,223);
  --color-main1: rgb(217,165,137);
  --color-main2: rgb(194,106,93);
  --color-main3: rgb(76,54,36);
  --color-main4: rgb(0,0,0);

  --brand-sans: "Montserrat"; /* Avenir-like */
  --ui-sans: "Inter"; /* Helvetica-like */
}

/* -----------------------------------------
   Base / Reset
   - Basic resets and typography defaults
   ----------------------------------------- */
html, body {
  margin: 0;
  font-family: var(--ui-sans), sans-serif;
  scroll-behavior: smooth;
}

:target {
  /* Adjust scroll offset for anchored sections */
  scroll-margin-top: 15vmin;
}
#contact:target {
  scroll-margin-top: 13vmin;
}

.project-container:target{
  scroll-margin-top: 11vmin;
}

.project-container-2:target {
  scroll-margin-top: 10vmin;
}

/* Basic text elements */
p, a {
  font-size: 1vmin;
  margin: 0;
  text-align: center;
  color: var(--color-main3);
}
a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1 {
  font-size: clamp(32px, 3vw, 64px);
  color: var(--color-accent);
  text-align: center;
  margin: 0;
}

/* -----------------------------------------
   Header & Navigation
   - Fixed header, responsive nav and menu icon
   ----------------------------------------- */
header {
  font-family: var(--ui-sans);
  font-weight: bold;
  background-color: var(--color-main2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 10vmin;
  gap: 1.2vmin;
  z-index: 10;
  overflow: visible;
  align-items: center;
  display: flex;
  justify-content: center;
}

nav {
  display: flex;
  justify-content: center;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
}

nav li {
  margin: 0 1vmin;
  padding: 1vmin 2vmin;
  background-color: var(--color-main1);
  border-radius: calc(min(20vh,15vw) * 0.1);
  cursor: pointer;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
nav li:hover {
  box-shadow: 0 0 10px var(--color-main1);
  transform: scale(1.05);
}

/* Nav links */
nav a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 3vmin;
}
nav a:hover { text-decoration: none; }

/* Menu icon for small screens */
.menu-icon {
  font-size: 10vmin;
  display: none;
  width: fit-content;
  height: auto;
  line-height: 1;
  aspect-ratio: 1/1;
  cursor: pointer;
  color: var(--color-accent);
  background-color: var(--color-main1);
  border-radius: calc(min(20vh,15vw) * 0.1);
  padding: 1.5vmin;
  position: relative;
  z-index: 50;
  transition: transform 0.2s, box-shadow 0.2s;
}

.menu-icon:hover,
.menu-icon.open {
  background-color: var(--color-main1);
  box-sizing: border-box;
  border-radius: calc(min(20vh,15vw) * 0.1);
  box-shadow: 0 0 10px var(--color-main1);
  transform: scale(1.05); /* scales from element center without affecting vertical centering */
  transform-origin: center center;
}

.menu-icon:hover::before,
.menu-icon.open::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 10px;
}

/* Responsive nav menu (mobile) */
@media (max-width: 768px) {
  header { height: 16vmin; }

  .menu-icon { display: block; }


  #nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    width: 100%;
    flex-direction: column;
    align-items: center;
    background-color: var(--color-main2);
    z-index: 40;
    padding: 8vmin 0;
  }

  #nav-menu.show {
    display: flex;
  }

  #nav-menu ul {
    flex-direction: column;
    gap: 2vmin;
  }

  #nav-menu li {
    text-align: center;
    width: 80vmin;
    padding: 2vmin;
  }
    #nav-menu a {
    display: block;
    width: 100%;
    font-size:inherit
  }
}

/* -----------------------------------------
   Home section
   - Hero layout and related components
   ----------------------------------------- */
#home {
  height: 100vmin;
  display: flex;
  flex-direction: column;
  background-color: var(--color-main0);
}

#home h1 {
  font-size: min(10vh, 8vw);
  color: var(--color-main3);
  text-align: right;
}

.home-header { height: 10vmin; }

.home-p-spacer{
  width:100%;
  height: min(2vh, 1vw);
  background-color: none;
  z-index: 100;
}

.home-title-container {
  height: 20.5vmin;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2vmin;
}
.home-subtitle-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.home-subtitle-container h2,
.home-subtitle-container p { margin: 0; }

.home-subtitle-container h2 {
  font-size: min(5vh, 2.5vw);
  font-weight: 100;
  color: var(--color-main3);
}

.home-social-links,
.home-social-links a {
  font-size: min(2vh, 1vw);
  color: var(--color-accent);
  text-decoration: none;
  transition: .2s;
}
.home-social-links a:hover {
  text-decoration: underline;
}

.home-content {
  display: flex;
  gap: 5vmin;
  height: 45vmin;
  background-color: var(--color-main1);
  box-sizing: border-box;
  border-top: min(20px, 1.5vw) solid var(--color-main2);
  border-bottom: min(20px, 1.5vw) solid var(--color-main2);
  padding-left: min(12.5vh, 5vw);
  padding-right: min(12.5vh, 5vw);
  justify-content: center;
  align-items: center;
}

.home-image {
  height: 48vmin;
  aspect-ratio: 1/1;
  border-radius: 50%;
  box-sizing: border-box;
  border: min(20px, 1.5vw) solid var(--color-main2);
  background-color: var(--color-main2);
  z-index: 1;
}

.home-text { max-width: 120vh; }
.home-text p {
  font-size: min(3vh, 1.8vw);
  text-align: justify;
  hyphens: auto;
}

.home-applications-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding-top: min(2.5vh, 1vw);
  z-index: 0;
}
.home-applications {
  height: min(10vh, 5vw);
  width: min(10vh, 5vw);
  border-radius: 25%;
  box-sizing: border-box;
  border: 1vmin solid var(--color-main2);
  background-color: var(--color-main2);
  z-index: 1;
  transition-duration: 0.2s;
}

/* Projects preview in home */
.home-projects-container {
  height: 27vmin;
  z-index: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}
.home-projects-outline {
  width: min(120vh, 90vw);
  height: auto;
  border-radius: calc(min(20vh,15vw) * 0.1);
  background-color: var(--color-main2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0.8vmin solid var(--color-main2);
}
.home-projects-image {
  height: min(20vh, 15vw);
  width: min(20vh, 15vw);
  border-radius: calc(min(20vh,15vw) * 0.1);
  box-sizing: border-box;
  border: 1.5vmin solid var(--color-main2);
  background-color: var(--color-main2);
  z-index: 1;
  transition-duration: .2s;
}
.home-projects-image:hover {
  transform: scale(1.15);
  border-radius: calc(min(20vh,15vw) * 0.1 * 1.25);
  z-index: 2;
}

@media (max-width: 768px) {
  .home-header {
    height: 18vmin;
  }

  .home-title-container {
    flex-direction: column;
    height: auto;
    gap:0;
  }

  #home h1 {
    font-size: 5vmin;
  }

  .home-subtitle-container {
    padding: 1vw;
  }
  
  .home-subtitle-container h2 {
  font-size: 3vmin;
  }

  .home-social-links,
  .home-social-links a {
    font-size: 2vmin;
  }
}

/* -----------------------------------------
   Projects section
   - Grid/video layout and responsive fallbacks
   ----------------------------------------- */
#projects { background-color: var(--color-main0); }
#projects h1 { padding-top: 5vmin; margin-bottom: 5vmin; }

.project-container {
  display: flex;
  flex-direction: column;
  margin: 2vmin auto;
  justify-content: center;
  align-items: center;
  width: 80vw;
  background-color: var(--color-main2);
  box-sizing: border-box;
  border-right: 2vmin solid var(--color-main2);
  border-left: 2vmin solid var(--color-main2);
  border-top: 1.5vmin solid var(--color-main2);
  border-bottom: 1.5vmin solid var(--color-main2);
  border-radius: calc(min(20vh,15vw) * 0.1 * 1.25);
}

.project-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "images video";
  gap: 1vmin;
  aspect-ratio: 32/9;
  background-color: var(--color-main2);
}

/* Images grid inside project */
.project-images {
  grid-area: images;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1vmin;
  justify-items: center;
  align-items: center;
}
.project-images img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  border-radius: calc(min(20vh,15vw) * 0.1);
}

/* Video / media area */
.project-video {
  grid-area: video;
  display: flex;
  justify-content: center;
  align-items: center;
}
.project-video iframe {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  box-sizing: border-box;
  border: -1.5vmin solid var(--color-main2);
  border-radius: calc(min(20vh,15vw) * 0.1);
}

.project-image-header {
  aspect-ratio: 16/9;
  justify-content: center;
  align-items: center;
}

.project-image-header img {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  box-sizing: border-box;
  border-radius: calc(min(20vh, 15vw)*0.1);
}

.project-image-header a {
  display: block;      /* make the <a> respect the container size */
  width: 100%;
  height: 100%;
}

/* Project text block */
.project-text {
  width: 100%;
  border-top: 1.5vmin solid var(--color-main2);
  background-color: var(--color-main1);
  border-radius: 0 0 calc(min(15vh,10vw) * 0.1) calc(min(15vh,10vw) * 0.1);
  text-align: center;
}
.project-text h2 {
  font-size: min(8vh, 6vw);
  color: var(--color-main3);
  padding: 2vmin;
  margin: 0;
}
.project-text p, .project-text a {
  font-size: min(2.5vh, 2.5vw);
  margin: 1vmin 2vmin;
  hyphens: auto;
}

/* Responsive: stack visuals */
@media (max-width: 768px) {
  .project-container { width: 90vw; }
  .project-visuals {
    grid-template-columns: 1fr;
    grid-template-areas:
      "video"
      "images";
    aspect-ratio: 16/18;
  }
}

/* -----------------------------------------
   Two-column project cards (project-container-2)
   - Reusable card layout and responsive behavior
   ----------------------------------------- */
.project-container-2 {
  display: flex;
  gap: 2vmin;
  justify-content: center;
  align-items: stretch;
  width: 80vw;
  margin: auto;
  padding: 2vmin 0;
}

.project-visuals-2 {
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 2vmin solid var(--color-main2);
  background-color: var(--color-main2);
  border-radius: calc(min(20vh,15vw) * 0.1);
  overflow: hidden;
}

.project-images-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1vmin;
  padding: 1vmin;
}
.project-images-2 img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: calc(min(20vh,15vw) * 0.1);
}

/* Text block for new cards */
.project-text-2 {
  width: 100%;
  border-top: 1.5vmin solid var(--color-main2);
  background-color: var(--color-main1);
  border-radius: 0 0 calc(min(15vh,10vw) * 0.1) calc(min(15vh,10vw) * 0.1);
  text-align: center;
  flex-grow: 1;
}
.project-text-2 h2 {
  font-size: min(8vh, 6vw);
  color: var(--color-main3);
  padding: 2vmin;
  margin: 0;
}
.project-text-2 p, .project-text-2 a {
  margin: 1vmin 2vmin;
  font-size: min(2.5vh, 2.5vw);
  hyphens: auto;
}

/* Responsive behavior for project-container-2 */
@media (max-width: 1300px) {
  .project-container-2 { width: 80vw; }
  .project-images-2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .project-container-2 { flex-direction: column; width: 90vw; }
  .project-images-2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}

/* -----------------------------------------
   Contact section
   - Canvas + social icons layout with responsive rules
   ----------------------------------------- */
#contact {
  height: 93.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-main1);
  border-top: 1.5vmin solid var(--color-main2);
  border-bottom: 1.5vmin solid var(--color-main2);
  box-sizing: border-box;
  overflow: hidden;
}

#contact-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.contact-header {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

}
.contact-header a {
  text-align: center;
  font-size: 2vmin;
}

.contact-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

@media (max-width: 768px) {
  .contact-header h1 {
  text-align: center;
  font-size: 12vmin;
  }
  .contact-header a {
  text-align: center;
  font-size: 4vmin;
  }
}

/* Vertical stack of social icons */
.social-icons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
  height: 80%;
}
.social-icons img {
  width: min(10vw, 15vh);
  height: min(10vw, 15vh);
  object-fit: contain;
  transition: transform .2s, box-shadow .2s;
  background-color: white;
  border: 5px solid white;
  border-radius: 25%;
}
.social-icons a:hover img {
  transform: scale(1.2);
  box-shadow: 0 0 10px white;
}

/* Canvas sizing and wrapper */
.canvas-wrapper { display: flex; align-items: center; justify-content: center; }
canvas {
  aspect-ratio: 1/1;
  max-width: min(50vw, 70vh);
  max-height: min(50vw, 70vh);
  display: block;
  border-radius: 10%;
  box-sizing: border-box;
}

/* Contact responsive adjustments */
@media (max-width: 768px) {
  .contact-header { translate: 0 -3vh; }
  .contact-main { flex-direction: column; gap: 0; }

  .social-icons {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    height: auto;
  }
  .social-icons img {
    width: min(20vw, 8vh);
    height: min(20vw, 8vh);
  }

  canvas {
    max-width: min(80vw, 50vh);
    max-height: min(80vw, 50vh);
  }
}

/* -----------------------------------------
   Footer
   ----------------------------------------- */
footer {
  background-color: #130D13;
  color: #eee;
  text-align: center;
  padding: 20px;
}
footer p { margin: 0; font-size: 14px; }

