/* =========================================
   THEME VARIABLES
========================================= */
:root {
  --brand-dark: #215141;
  --brand-light: #dedbca;
  --brand-white: #ffffff;
  --brand-black: #111111;

  --page-bg: var(--brand-dark);
  --page-text: var(--brand-light);

  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --ink: var(--page-text);
  --muted: rgba(222, 219, 202, 0.78);

  --accent: var(--brand-light);
  --accent-ink: var(--brand-dark);
  --ring: rgba(222, 219, 202, 0.35);

  --border-color: rgba(222, 219, 202, 0.45);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

/* LIGHT MODE */
body.light {
  --page-bg: var(--brand-light);
  --page-text: var(--brand-dark);

  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --ink: var(--brand-dark);
  --muted: rgba(33, 81, 65, 0.78);

  --accent: var(--brand-dark);
  --accent-ink: var(--brand-light);
  --ring: rgba(33, 81, 65, 0.28);

  --border-color: rgba(33, 81, 65, 0.35);
  --shadow: 0 18px 45px rgba(33, 81, 65, 0.12);
}

/* DARK MODE */
body.dark {
  --page-bg: var(--brand-dark);
  --page-text: var(--brand-light);

  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --ink: var(--brand-light);
  --muted: rgba(222, 219, 202, 0.78);

  --accent: var(--brand-light);
  --accent-ink: var(--brand-dark);
  --ring: rgba(222, 219, 202, 0.35);

  --border-color: rgba(222, 219, 202, 0.45);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

/* =========================================
   GLOBAL STYLES
========================================= */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--page-bg);
  color: var(--page-text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  transition:
    background-color 0.35s ease,
    color 0.35s ease;
}

body {
  min-height: 100vh;
}

a {
  color: var(--page-text);
  text-decoration: none;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.containerHeader,
.container {
  width: 92%;
  max-width: 1120px;
  margin-inline: auto;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* =========================================
   HEADER / NAV
========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(33, 81, 65, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

body.light .header {
  background: rgba(222, 219, 202, 0.96);
}

.header-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo toggle"
    "hamburger hamburger"
    "nav nav";
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.8rem 0 0.7rem;
}

.brand {
  grid-area: logo;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 290px;
}

#logoImg {
  display: block;
  width: 100%;
  max-width: 290px;
  height: auto;
  transition: opacity 0.35s ease;
}

/* =========================================
   MODE SWITCH
========================================= */
.mode-select {
  grid-area: toggle;
  position: static;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: end;
  gap: 0.55rem;
  width: auto;
  height: auto;
  text-align: right;
  font-size: 0.75rem;
  z-index: 60;
}

#modeText {
  color: var(--page-text);
  line-height: 1.1;
}

.switch {
  position: relative;
  width: 55px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.55);
  transition:
    background-color 0.35s ease,
    transform 0.35s ease;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: var(--brand-white);
  transition:
    background-color 0.35s ease,
    transform 0.35s ease;
}

input:checked + .slider {
  background-color: var(--brand-black);
}

input:focus + .slider {
  box-shadow: 0 0 0 3px var(--ring);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* =========================================
   MOBILE MENU
========================================= */
.menu-toggle-wrap {
  grid-area: hamburger;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0;
}

.menu-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  z-index: 61;
}

.menu-toggle-bar {
  width: 22px;
  height: 2px;
  background-color: var(--page-text);
  border-radius: 999px;
  transition: background-color 0.35s ease;
}

.menu {
  grid-area: nav;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0 0;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

body.menu-open .menu {
  display: flex;
}

.menu a,
.nav-dropdown-toggle {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  color: var(--page-text);
  text-align: left;
}

.menu a:hover,
.nav-dropdown-toggle:hover {
  background: var(--surface);
  text-decoration: none;
}

.menu a[aria-current="page"] {
  background: var(--surface);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: transparent;
  border: none;
  font: inherit;
  cursor: pointer;
}

.nav-dropdown-menu {
  display: grid;
  gap: 0.25rem;
  padding: 0.25rem 0 0.25rem 0.75rem;
}

.nav-dropdown-menu a {
  font-weight: 500;
  font-size: 0.92rem;
}

/* =========================================
   BUTTONS
========================================= */
.btn-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 28px -18px var(--ring);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.cta:hover {
  opacity: 0.94;
  text-decoration: none;
  transform: translateY(-1px);
}

.cta.secondary {
  background: transparent;
  color: var(--page-text);
  border-color: var(--border-color);
  box-shadow: none;
}

/* =========================================
   HERO
========================================= */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero .container {
  max-width: 980px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 920px;
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 1.35rem + 4vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero h2 {
  margin: 1.5rem 0 0.35rem;
  font-size: clamp(1.35rem, 1rem + 1vw, 1.85rem);
  line-height: 1.15;
}

.hero p.lede {
  max-width: 72ch;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
}

/* =========================================
   SECTIONS
========================================= */
.section {
  padding: 2.75rem 0;
}

.section:nth-of-type(even) {
  background: rgba(255, 255, 255, 0.035);
}

body.light .section:nth-of-type(even) {
  background: rgba(255, 255, 255, 0.28);
}

.section h3 {
  margin-top: 0;
  font-size: clamp(1.35rem, 1.05rem + 1vw, 2rem);
  line-height: 1.15;
}

.section p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(0, 1fr);
}

/* =========================================
   CARDS
========================================= */
.card {
  background: var(--surface);
  color: var(--page-text);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.card p {
  margin-top: 0;
}

.card .cta {
  margin-top: 1rem;
}

/* =========================================
   LISTS / TEXT
========================================= */
.list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.65;
  color: var(--page-text);
}

.list li + li {
  margin-top: 0.35rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--surface-strong);
  border-radius: 0.4rem;
  color: var(--page-text);
  border: 1px solid var(--border-color);
}

/* =========================================
   TABLES
========================================= */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

th,
td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

th {
  background: var(--surface);
}

tr:last-child td {
  border-bottom: none;
}

/* =========================================
   FORMS
========================================= */
.input,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--surface-strong);
  color: var(--page-text);
}

.input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

label {
  font-size: 0.9rem;
  color: var(--muted);
}

form .row {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

/* =========================================
   BLOCKQUOTE
========================================= */
blockquote {
  margin-left: 0;
  border-left: 4px solid var(--border-color);
  padding-left: 1rem;
  color: var(--muted);
}

/* =========================================
   FOOTER
========================================= */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer a {
  color: var(--page-text);
  font-weight: 700;
}

/* =========================================
   PORTFOLIO SUPPORT
========================================= */
.portfolio img {
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
========================================= */
@media (max-width: 639px) {
  .portfolio img {
    max-width: 50% !important;
  }

  #logoImg {
    max-width: 210px;
  }

  .brand {
    max-width: 210px;
  }

  .mode-select {
    font-size: 0.68rem;
    gap: 0.4rem;
  }

  .switch {
    width: 50px;
    height: 24px;
  }

  .slider:before {
    height: 17px;
    width: 17px;
  }

  input:checked + .slider:before {
    transform: translateX(25px);
  }
}

@media (min-width: 800px) {
  .header-grid {
    grid-template-columns: minmax(230px, 1fr) auto minmax(160px, 1fr);
    grid-template-areas: "logo nav toggle";
    gap: 1.5rem;
    padding: 0.85rem 0;
  }

  .brand {
    max-width: 340px;
  }

  #logoImg {
    max-width: 340px;
  }

  .menu-toggle-wrap {
    display: none;
  }

  .menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0;
    text-align: center;
  }

  .menu a,
  .nav-dropdown-toggle {
    width: auto;
    padding: 0.45rem 0.55rem;
    white-space: nowrap;
  }

  .nav-dropdown-menu {
      display: none;
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      min-width: 285px;
      padding: 0.75rem 0.55rem 0.55rem;
      background: var(--page-bg);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      box-shadow: var(--shadow);
      z-index: 70;
    }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
  }

  .nav-dropdown-menu a {
    text-align: left;
  }

  .mode-select {
    justify-self: end;
  }

  .hero {
    padding: 4.5rem 0 3rem;
  }

  .cta {
    width: auto;
    min-width: 180px;
  }

  form .row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}


/**portfolio pages **/

.portfolio-list {
  display: grid;
  gap: 1.5rem;
}

.portfolio h3 {
  text-align: center;
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem);
}

.portfolio > a {
  display: block;
  width: fit-content;
  margin: 0.75rem auto 1.25rem;
  color: var(--page-text);
  font-weight: 700;
  text-decoration: underline;
}

.portfolio-logo {
  display: block;
  width: 100%;
  max-width: 170px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
}

.portfolio-logo-dark {
  background: #000;
  padding: 0.75rem;
}

@media (min-width: 960px) {
  .menu {
    gap: 0.75rem;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    padding: 5.5rem 0 3.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .card {
    padding: 1.55rem;
  }
}

@media (min-width: 1180px) {
  .containerHeader {
    max-width: 1240px;
  }

  .header-grid {
    grid-template-columns: minmax(280px, 1fr) auto minmax(190px, 1fr);
  }

  .brand,
  #logoImg {
    max-width: 370px;
  }

  .menu {
    gap: 1rem;
  }
}