/* =========================================================
   MODERN CSS RESET (2025)
   Inspired by Andy Bell / Josh Comeau
   ========================================================= */

/* 1. Use a more intuitive box model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Allow percentage-based heights */

html {
  box-sizing: border-box;
}
/* 4. Improve text rendering */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 7. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 8. Create a root stacking context */
#root,
#__next {
  isolation: isolate;
}

/* 9. Remove built-in form typography quirks */
button {
  background: none;
  border: none;
}

/* 10. Respect reduced motion preferences */
@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;
  }
}

/* End of RESET */

/* =======================================================================
   THEME VARIABLES — SINGLE SOURCE OF TRUTH
   ======================================================================= */

/* -------------------------------------------------
   DEFAULT = LIGHT THEME
   ------------------------------------------------- */
:root {
  --body-bg: #ffffff;
  --header-background: #f0f0f0; /* slightly darker */
  /* NAV */
  --nav-height: 70px;
  --nav-text: #ffffff; /* Each page has dark image at header */
  --nav-text-active: yellow;
  --nav-text-hover: #555;
  --nav-text-scrolled: #ffffff;
  --nav-bg-scrolled: transparent;
  --dropdown-bg: rgba(39, 32, 32, 0.95);
  --dropdown-text: #ffffff;
  --hamburger-bg: #ffffff;
  --page-bg: #ffffff;
  --section-bg: #ffffff;

  /* TYPOGRAPHY */
  --heading-color: #1a1a1a; /* headers */
  --accent-text: hsl(135, 35%, 7%);
  --accent-text-hover: hsla(157, 32%, 28%, 0.76);
  --body-text: #0b0a0a; /* paragraphs */
  --small-text: #1c1a1a; /* descriptions, meta */

  /* Footer Backgrounds */
  --footer-bg: #f9f9f9;
  --footer-text: #111;
  --footer-heading: #111;
  --footer-subtext: #201e1e;
  --footer-link: #111;
  --footer-link-hover: #201e1e;
  --footer-border: rgba(0, 0, 0, 0.1);

  /* UI */
  --submit-button: rgb(9, 44, 9);
  --submit-button-text: #fff;
  --submit-button-hover: rgba(8, 39, 11, 0.696);

  /* FORM SURFACE */
  --form-bg: #ffffff;
  --form-text: var(--body-text);
  --form-heading: var(--heading-color);
  --form-border: #cccccc;
  --form-input-bg: #fafafa;

  /* FORM ACCENT */
  --form-accent: #574fd2;
  --form-accent-soft: rgba(87, 79, 210, 0.15);

  /* ERRORS & SUCCESS */
  --error-bg: #ffe0e0;
  --error-border: #f5c2c2;
  --error-text: #a00;

  --success-bg: #e6f9ed;
  --success-border: #bde5c8;
  --success-text: #2d8a4e;

  /* SHADOWS */
  --form-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

  /* LOADER */
  --loader-bg: rgba(255, 255, 255, 0.85);
  --loader-spinner: #574fd2;
  --loader-spinner-track: #ddd;
}

/* -------------------------------------------------
   SYSTEM DARK MODE (ONLY IF NO MANUAL OVERRIDE)
   ------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  body:not(.light-theme) {
    --body-bg: #171616;
    --spinner-background: #343232;
    --spinner-text: #ffffff;
    --header-background: #030303; /* darker than body */
    /* NAV */
    --nav-text: #ffffff;
    --nav-text-hover: #dddddd;
    --nav-text-active: pink;
    --nav-text-scrolled: #ffffff;
    --nav-bg-scrolled: transparent;
    --dropdown-bg: rgba(23, 22, 22, 0.95);
    --dropdown-text: #ffffff;
    --hamburger-bg: #ffffff;
    --page-bg: #171616;
    --section-bg: #171616;

    /* TYPOGRAPHY */
    --heading-color: #e6e6e6;
    --accent-text: hsl(50, 30%, 57%);
    --accent-text-hover: hsla(49, 45%, 84%, 0.76);
    --body-text: #f8f3f3;
    --small-text: #efeaea;
    /* Footer Styling */
    --footer-bg: #171616;
    --footer-text: #e6e6e6;
    --footer-heading: #f1f1f1;
    --footer-subtext: #cfcfcf;
    --footer-link: #ffffff;
    --footer-link-hover: #ddd;
    --footer-border: rgba(255, 255, 255, 0.1);
    background-color: #171616;
    --form-heading: var(--heading-color);
    /* UI */
    --submit-button: rgb(214, 222, 214);
    --submit-button-text: #000;
    --submit-button-hover: rgba(178, 235, 184, 0.696);

    /* FORM SURFACE */
    --form-bg: #1e1d1d;
    --form-input-bg: #262525;
    --form-border: #3a3a3a;
    --form-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

    --loader-bg: rgba(0, 0, 0, 0.7);
    --loader-spinner-track: #444;
  }
}

/* -------------------------------------------------
   MANUAL DARK THEME (USER TOGGLE)
   ------------------------------------------------- */
body.dark-theme {
  --body-bg: #171616;
  --header-background: #030303; /* darker than body */
  /* NAV */
  --nav-text: #ffffff;
  --nav-text-active: yellow;
  --nav-text-hover: #dddddd;
  --nav-text-scrolled: #ffffff;
  --nav-bg-scrolled: transparent;
  --dropdown-bg: rgba(23, 22, 22, 0.95);
  --dropdown-text: #ffffff;
  --hamburger-bg: #ffffff;

  /* TYPOGRAPHY */
  --heading-color: #e6e6e6;
  --serving-heading: rgb(245, 203, 119);
  --body-text: #f8f3f3;
  --small-text: #efeaea;

  /* FOOTER */
  --footer-bg: #171616;
  --footer-text: #e6e6e6;
  --footer-heading: #f1f1f1;
  --footer-subtext: #cfcfcf;
  --footer-link: #ffffff;
  --footer-link-hover: #ddd;
  --footer-border: rgba(255, 255, 255, 0.1);
  /* UI */
  /* UI */
  --submit-button: rgb(214, 222, 214);
  --submit-button-text: #000;

  background-color: #171616;
}

/* -------------------------------------------------
   MANUAL LIGHT THEME (EXPLICIT OVERRIDE)
   ------------------------------------------------- */
body.light-theme {
  --body-bg: #ffffff;
  --header-background: #f0f0f0; /* slightly darker */
  /* NAV */
  --nav-text: #ffffff; /* Each page has dark image at header */
  --nav-text-active: pink;
  --nav-text-hover: #555;
  --nav-text-scrolled: #ffffff;
  --nav-bg-scrolled: transparent;
  --dropdown-bg: rgba(39, 32, 32, 0.95);
  --dropdown-text: #ffffff;
  --hamburger-bg: #ffffff;

  /* TYPOGRAPHY */
  --heading-color: #1a1a1a;
  --serving-heading: rgb(30, 9, 9);
  --body-text: #0b0a0a; /* paragraphs */
  --small-text: #1c1a1a; /* descriptions, meta */

  /* FOOTER */
  --footer-bg: #f9f9f9;
  --footer-text: #111;
  --footer-heading: #111;
  --footer-subtext: #201e1e;
  --footer-link: #111;
  --footer-link-hover: #201e1e;
  --footer-border: rgba(0, 0, 0, 0.1);
  /* UI */
  --submit-button: rgb(9, 44, 9);
  --submit-button-text: #fff;

  background-color: #ffffff;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading-color);
}
.overlay h1,
.overlay p {
  color: white;
}
p {
  color: var(--body-text);
}

small,
.meta,
.description {
  color: var(--small-text);
}
html {
  font-size: 16px; /* accessible root size */
}

body {
  font-family: system-ui, sans-serif;
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
  line-height: 1.6;
  line-height: 1.6;
  background-color: var(--body-bg);
  color: var(--body-text);
}
html,
body {
  overflow-x: hidden;
}
main {
  max-width: 1200px;
  margin: 3em auto 2em auto;
}
/* ------------  fully responsive typography system  START  --------------------- */

h1 {
  font-size: clamp(1.8rem, 2.5vw + 1rem, 2.4rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}
h2,
h3,
h4,
h5,
h6 {
  font-size: clamp(1.3rem, 2vw + 0.9rem, 2rem);
  line-height: 1.25;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

p {
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
  line-height: 1.6;
  margin-bottom: 1rem;
}

small {
  font-size: clamp(0.8rem, 0.3vw + 0.7rem, 0.9rem);
  line-height: 1.4;
}
/* ------------  fully responsive typography system  END  --------------------- */
.italic {
  font-style: italic;
}
.red {
  color: red;
}
.center {
  margin: auto;
  text-align: center;
}

/* =======================================================================
   NAVBAR BASE
   ======================================================================= */

.navbar-container {
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 5;
}
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  height: var(--nav-height); /* <-- use fixed height here */
  display: flex;
  align-items: center;
  transform: translateY(0);
  transition: transform 0.3s ease;
  z-index: 9999;
  background-color: transparent;
}

.navbar.hidden {
  transform: translateY(-100%);
}

/* Logo / Company name */
.company-name {
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1;
  padding: 0;
  color: var(--nav-text);
  transition: color 0.3s ease;
  cursor: pointer;
}
.company-name,
.company-name:visited,
.company-name:hover,
.company-name:active {
    color: #fff;
}


/* Group theme toggle + logo */
.brand-group {
  display: flex;
  align-items: center; /* vertical centering */
  gap: 1rem;
}
.logo {
  height: 60px; /* closer to nav text height */
  width: auto;
  display: block; /* removes inline-img baseline issues */
}
.hamburger-label {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
  font-weight: 500;
  color: var(--nav-text);
  transition: color 0.3s ease;
  line-height: 1.2;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none; /* 👈 prevents underline */
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--nav-text-hover);
  outline: none;
  text-decoration: underline;
}

/* =======================================================================
   NAVBAR SCROLLED STATE
   ======================================================================= */
.navbar.scrolled {
  background-color: var(--nav-bg-scrolled);
}

.navbar.scrolled .company-name,
.navbar.scrolled .nav-item {
  color: var(--nav-text-scrolled);
}

/* =======================================================================
   NAV LINKS LAYOUT
   ======================================================================= */
.nav-links {
  padding-top: 10px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

/* =======================================================================
   HAMBURGER (MOBILE)
   ======================================================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3;
  align-items: center;
}

.hamburger span {
  height: 2px;
  width: 100%;
  background: var(--hamburger-bg);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    background 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform-origin: center;
  transform: rotate(45deg) translate(9px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform-origin: center;
  transform: rotate(-45deg) translate(9px, -6px);
}

/* Update hamburger colors on scroll */
.navbar.scrolled .hamburger span {
  background: var(--hamburger-bg);
}

/* =======================================================================
   MOBILE NAV
   ======================================================================= */
@media (max-width: 768px) {
  .navbar {
    width: 100%;
    padding: 1rem 1.5rem;
    justify-content: space-between;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  /* Hamburger button layout */
  .hamburger-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Hamburger button: ICON ONLY */
  .hamburger {
    display: flex;
    flex-direction: column; /* ← vertical bars */
    justify-content: space-between; /* vertical stacking */
    width: 30px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    align-items: center;
    line-height: 0; /* prevent extra spacing */
  }

  /* Show label only on mobile */
  .hamburger-label {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--hamburger-bg);
    line-height: 1;
    margin: 0;
  }
  .hamburger-bars {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px; /* crucial to see 3 bars */
  }

  /* Bars inside button */
  .hamburger-bars span {
    height: 3px;
    width: 100%;
    background: var(--hamburger-bg);
    border-radius: 2px;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  /* Active hamburger transforms */
  .hamburger.active .hamburger-bars span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger.active .hamburger-bars span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .hamburger-bars span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -9px);
  }
  /* Mobile dropdown */
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    flex-direction: column;
    background: var(--dropdown-bg);
    width: 300px;
    padding: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .nav-links.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .logo {
    height: 50px;
    width: auto;
  }
}

.theme-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--nav-text);
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--nav-text-hover);
  transform: scale(1.1);
  outline: none;
}

.theme-icon {
  display: inline-block;
  line-height: 1;
}
@media (min-width: 768px) {
  .theme-toggle {
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 50%;
    background-color: transparent;
    transition:
      background-color 0.3s ease,
      transform 0.3s ease;
  }

  .theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.2);
  }

  .theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  .theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
  }
}
/* ============================================================
   INDEX PAGE — DESKTOP ONLY NAV COLOR OVERRIDE
   ============================================================ */
@media (min-width: 769px) {
  /* Nav links */
  body.index .nav-item {
    color: white;
  }

  body.index .nav-item:hover,
  body.index .nav-item:focus-visible {
    color: #ddd;
  }
  body.index .navbar.scrolling-up .nav-item {
    color: white;
  }

  body.index .navbar.scrolling-up .nav-item:hover {
    color: #ddd;
  }
}
/* ============================================================
   INDEX PAGE — MOBILE HAMBURGER COLOR OVERRIDE
   ============================================================ */
@media (max-width: 768px) {
  /* White label text */
  body.index .hamburger-label {
    color: white;
  }

  /* White bars */
  body.index .hamburger-bars span {
    background: white;
  }
  body.index .navbar.scrolling-up .hamburger-label {
    color: white;
  }
  body.index .navbar.scrolling-up .hamburger-bars span {
    background: white;
  }
}
/* End of Mobile Navigation */
.hero-base {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.hero-image {
  height: 100vh;
}

.hero-base.home {
  background-attachment: fixed;
}

@media (max-width: 768px) {
  .hero-base.home {
    background-attachment: scroll;
  }
}

.hero-image-portfolio,
.hero-image-pricing,
.hero-image-contact {
  height: 30vh;
}

.hero-text,
.hero-portfolio-text,
.hero-pricing-text,
.hero-contact-text {
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
}

.hero-text {
  top: 50%;
}

.hero-portfolio-text,
.hero-pricing-text,
.hero-contact-text {
  top: 70%;
}

.hero-text h1 {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  color: #ffffff;
}

.hero-text p {
  font-size: 1.2rem;
  max-width: 80vw;
  margin: 0 auto;
  color: #ffffff;
  padding: 0;
}

@media (max-width: 45em) {
  .hero-text h1 {
    font-size: 1.3rem;
    color: #ffffff;
  }

  .hero-text p {
    font-size: 1.1rem;
    color: #ffffff;
  }
}
