/* ===================
       Reset some default styles
    ====================== */

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

:root {
  /* =========================
         DELEVANA — BRAND
         ========================= */
  --color-mint: hsl(156.2, 71.6%, 66.9%);
  --color-mint-bright: hsl(152.4, 76%, 80.4%);
  --color-mint-dark: hsl(158.1, 64.4%, 51.6%);

  /* =========================
         DELEVANA — DARK NEUTRALS
         ========================= */
  --color-background: hsl(150, 20%, 3.9%);
  --color-surface: hsl(145.7, 17.9%, 7.6%);
  --color-surface-2: hsl(150, 17.9%, 11%);
  --color-border: hsl(152, 16.5%, 17.8%);

  /* =========================
         DELEVANA — TEXT
         ========================= */
  --color-text: hsl(150, 16.7%, 95.3%);
  --color-text-muted: hsl(148, 8.9%, 66.9%);

  /* =========================
         RESPONSIVE TOKENS
         ========================= */
  --header-height: 76px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-pad: clamp(1rem, 3vw, 1.5rem);
  --radius: 5px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-height: 100dvh;

  font-family: "Arial", sans-serif;
  line-height: 1.6;
  background-color: var(--color-background);
  color: var(--color-text);

  /* keeps decorative glows / wide grids from creating a scrollbar */
  overflow-x: hidden;
}

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

section {
  min-height: 100dvh;
}

button {
  cursor: pointer;
  font: inherit;
}

/* ===================
       Header Styles
    ====================== */

header {
  position: relative;
  z-index: 50;

  width: 100%;
  min-height: var(--header-height);

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;

  padding: 0.75rem var(--gutter);

  color: var(--color-mint);
}

.header-left {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);

  min-width: 0; /* allows the heading to shrink instead of overflowing */
  color: var(--color-text);
  margin: 0;
}

.header-left .logo {
  flex-shrink: 0;
  width: clamp(36px, 8vw, 50px);

  background-color: #f3f5f2;
  padding: 5px;
  border: 2px solid var(--color-mint);
  box-shadow: 0 0 10px var(--color-mint);
}

.header-left h1 {
  font-size: clamp(1.15rem, 3.5vw, 2rem);
  line-height: 1.15;
  white-space: nowrap;
}

/* --- Primary navigation (desktop / tablet only) --- */

.nav-links {
  display: none; /* mobile-first: hidden by default */
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

/* --- Hamburger button (mobile only) --- */

.menu-button {
  position: relative;
  z-index: 60;

  display: block;

  background-color: transparent;
  color: var(--color-text-muted);
  border: none;

  font-size: 1.5rem;
  line-height: 1;

  /* comfortable 44px touch target */
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;

  transition: color 0.3s ease;
}

/* --- Slide-in menu panel --- */

.menu-bar {
  display: none;
}

.menu-bar.open {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;

  width: min(85vw, 250px);
  height: 100dvh;

  padding: calc(var(--header-height) + 1.5rem) 1.5rem 1.5rem;

  background-color: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.55);

  font-size: 1.05rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-bar a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

/* --- Shared link styles --- */

header a {
  position: relative;
  display: inline-block;

  text-decoration: none;
  color: var(--color-text);
  font-size: clamp(1rem, 1.6vw, 1.25rem);

  transition: color 0.3s ease;
}

header a::after {
  content: "";

  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -5px;
  height: 2px;

  background-color: var(--color-mint);

  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* ===================
       Header Animation Styles
    ====================== */

header a:hover,
.menu-button:hover,
.menu-bar a:hover {
  color: var(--color-mint);
}

header a:hover::after {
  transform: scaleX(1);
}

/* ===================
       Main Content Styles
    ====================== */

.main-nav {
  display: flex;
}

.main {
  padding: clamp(1rem, 3vw, 1.75rem);
}

.main-content {
  display: flex;
  flex-direction: column;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-mint);
}

p {
  margin: 1.25rem 0;
}

/* ===================
       Hero Section Styles
    ====================== */

.hero-section {
  min-height: 90dvh;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;

  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--color-mint);

  /* fluid left offset replaces the old fixed 10vw margin */
  padding-inline: clamp(1.25rem, 8vw, 9rem);
  padding-block: 2rem;

  cursor: default;
}

.hero-section h1 {
  font-size: clamp(2.75rem, 13vw, 10rem);
  line-height: 0.95;
  color: var(--color-text);
  overflow-wrap: break-word;
  max-width: 100%;
}

.experience {
  display: block;
  text-align: start;

  font-size: clamp(0.75rem, 3.5vw, 2rem);
  color: var(--color-mint);

  margin-left: 6px;
}

#view-work {
  display: inline-block;
  align-self: flex-start;

  text-decoration: none;
  color: var(--color-mint);
  background-color: var(--color-background);

  border: 0.5px solid var(--color-mint);
  border-radius: var(--radius);
  box-shadow: 0 0 0 var(--color-mint);

  font-size: clamp(1rem, 1.5vw, 1.25rem);
  padding: 0.75rem 1.5rem;

  margin-top: clamp(2rem, 9vw, 75px);

  transition:
    box-shadow 0.3s ease,
    background-color 0.3s ease;
}

/* ===================
       Hero Section Animation
    ====================== */

#view-work:hover {
  box-shadow: 0 0 10px var(--color-mint);
  background-color: var(--color-surface);
}

/* ===================
       About Us Section Styles
    ====================== */

.about-us {
  width: min(90%, 1400px);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--color-text);

  padding: clamp(1rem, 3vw, 1.5rem);
}

.about-us p {
  font-size: inherit;
  max-width: 65ch;
}

.about-us .introduction {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ===================
       Portfolio Section Styles
    ====================== */

.portfolio {
  width: 100%;

  display: flex;
  align-items: center;
  flex-direction: column;

  padding: var(--section-pad);
}

.portfolio-descriptior {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.portfolio-grid {
  width: 100%;
  min-height: 250px;

  display: grid;
  /* min() keeps the track from ever overflowing a narrow screen */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));

  background-color: var(--color-surface);
  gap: clamp(1rem, 2vw, 1.25rem);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.portfolio-item {
  position: relative;
  justify-self: center;

  width: 100%;
  max-width: 340px;

  background-color: var(--color-surface-2);

  padding: clamp(1rem, 2vw, 1.25rem);
}

.portfolio-item::after {
  content: "";

  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;

  background-color: var(--color-mint);

  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.portfolio-image-link {
  position: relative;
  display: block;
}

.portfolio-image-content {
  scale: 0.95;
  transition: scale 0.3s ease;
}

.portfolio-item .main-image {
  width: 100%;
  filter: blur(4px);
  transition: filter 0.3s ease;
}

.portfolio-item .image-logo {
  position: absolute;
  width: clamp(64px, 22%, 100px);

  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.portfolio-item-description a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

/* ===================
       Portfolio Section Animations
    ====================== */

.portfolio-image-content:hover {
  scale: 1;
}

.portfolio-item-description a:hover {
  color: var(--color-mint);
}

.portfolio-item:hover .main-image {
  filter: blur(0.5px);
}

.portfolio-item:hover::after {
  transform: scaleX(1);
}

/* ===================
       Services Section Styles
    ====================== */

.our-services {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  padding: var(--section-pad);
}

.services-flex {
  width: 100%;

  display: flex;
  flex-direction: column;

  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1rem, 4vw, 3rem);
}

.service-item {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 1.25rem;

  background-color: var(--color-surface);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.service-img {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.service-img img {
  width: min(100%, 250px);
}

.service-item::after {
  content: "";

  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;

  background-color: var(--color-mint);

  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* ===================
       Services Section Animation
    ====================== */

.service-item:hover::after {
  transform: scaleX(1);
}

/* ===================
   Contact Section Style
====================== */

.contact-us {
  width: min(90%, 1400px);
  min-height: fit-content;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  padding: var(--section-pad);
}

/* each row: link + handle side by side */
.contact-item {
  width: 100%;

  display: flex;
  align-items: baseline;
  gap: 0.75rem;

  padding: 0.5rem 0;
}

/* the link */
.contact-item a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 1.05rem;

  transition: color 0.3s ease;
  overflow-wrap: anywhere;
}

/* the @handle / username */
.contact-item span {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* ===================
   Contact Section Animation
====================== */

.contact-item a:hover {
  color: var(--color-mint);
}

/* =========================================================
       RESPONSIVE — TABLET  (≥ 640px)
       ========================================================= */

@media (min-width: 640px) {
  :root {
    --header-height: 84px;
  }

  .contact-item {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem 2rem;
  }

  .contact-info {
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    column-gap: 1rem;
  }

  .contact-info a {
    grid-column: 1;
  }

  .contact-info span {
    grid-column: 2;
  }

  .service-img img {
    width: min(100%, 300px);
  }
}

/* =========================================================
       RESPONSIVE — DESKTOP / LANDSCAPE TABLET  (≥ 768px)
       ========================================================= */

@media (min-width: 768px) {
  /* Swap hamburger for the inline nav */
  .nav-links {
    display: flex;
  }

  .menu-button,
  .menu-bar,
  .menu-bar.open {
    display: none;
  }

  /* Services go from stacked to side-by-side */
  .service-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .service-img {
    width: min(45%, 500px);
    justify-content: flex-end;
  }
}

/* =========================================================
       RESPONSIVE — LARGE DESKTOP  (≥ 1024px)
       ========================================================= */

@media (min-width: 1024px) {
  :root {
    --header-height: 90px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .portfolio-item {
    max-width: 360px;
  }

  .about-us,
  .contact-us {
    padding-inline: 2rem;
  }
}

/* =========================================================
       RESPONSIVE — VERY LARGE SCREENS  (≥ 1536px)
       ========================================================= */

@media (min-width: 1536px) {
  .hero-section {
    padding-inline: 10vw;
  }
}

/* =========================================================
       MOBILE-ONLY FINE TUNING  (≤ 480px)
       ========================================================= */

@media (max-width: 480px) {
  .header-left h1 {
    font-size: 1.15rem;
  }

  .hero-section {
    min-height: 85dvh;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .portfolio-item {
    max-width: 100%;
  }
}

/* =========================================================
       TOUCH DEVICES — disable hover-only flourishes
       ========================================================= */

@media (hover: none) {
  .portfolio-item .main-image {
    filter: blur(1px);
  }

  .portfolio-image-content {
    scale: 1;
  }
}

/* =========================================================
       ACCESSIBILITY — reduced motion
       ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
