:root {
  --logo-beige: rgba(198, 160, 106, 0.9);
  --logo-grey: rgba(255, 255, 255, 0.35);
  --header-bg: rgba(23, 23, 23, 1);
  --header-shadow: 0 6px 20px rgba(0,0,0,0.65);

  --nav-gap: clamp(10px, 2vw, 40px);
  --nav-hit-y: clamp(7px, 1vw, 8px);
  --nav-hit-x: clamp(10px, 1.8vw, 20px);
  --nav-radius: 1px;

  --bracket-size: 12px;
  --bracket-stroke: 1px;
  --bracket-color: rgba(255,255,255,0.95);
  --bracket-active-color: var(--logo-grey);

  --transition-fast: 180ms;
  --transition-page: 220ms;

  --container-max: 1180px;
  --content-max: 980px;
  --section-x: clamp(18px, 4vw, 32px);
  --section-y: clamp(28px, 5vw, 56px);

  --dark-theme-text: rgba(255, 255, 255, 0.96);
  --dark-theme-text-soft: rgba(255, 255, 255, 0.78);
  --dark-theme-gold: rgba(198, 160, 106, 0.96);

  --light-theme-text: rgba(43, 36, 29, 0.94);
  --light-theme-text-soft: rgba(73, 63, 53, 0.78);
  --light-theme-text-muted: rgba(73, 63, 53, 0.56);
  --light-theme-gold: rgba(150, 116, 67, 0.98);

  --dark-surface-frame: rgba(8, 8, 8, 0.75);
  --dark-surface-frame-soft: rgba(8, 8, 8, 0.34);
  --dark-surface-card: rgba(255, 255, 255, 0.075);
  --dark-border-frame: rgba(255, 255, 255, 0.10);
  --dark-border-card: rgba(255, 255, 255, 0.12);
  --dark-frame-shadow: 0 20px 54px rgba(0, 0, 0, 0.30);
  --dark-card-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  --dark-decor-line: rgba(255, 255, 255, 0.88);
  --dark-decor-line-gold: rgba(198, 160, 106, 0.92);

  --light-surface-frame: rgba(255, 255, 255, 0.82);
  --light-surface-frame-soft: rgba(255, 255, 255, 0.82);
  --light-surface-card: rgba(255, 255, 255, 0.62);
  --light-border-frame: rgba(155, 123, 78, 0.24);
  --light-border-card: rgba(155, 123, 78, 0.20);
  --light-frame-shadow: 0 18px 46px rgba(76, 59, 40, 0.14);
  --light-card-shadow: 0 12px 30px rgba(76, 59, 40, 0.10);
  --light-decor-line: rgba(120, 95, 61, 0.32);
  --light-decor-line-gold: rgba(170, 132, 82, 0.68);
}

/* =========================
   THEME LIGHT
   ========================= */

body.theme-light {
  color: var(--light-theme-text-soft);
  --logo-beige: rgba(198, 160, 106, 0.96);
  --logo-grey: rgba(99, 89, 78, 0.45);
  --header-bg: rgba(246, 242, 236, 0.92);
  --header-shadow: 0 6px 20px rgba(52, 41, 27, 0.40);

  --bracket-color: rgba(92, 78, 60, 0.85);
  --bracket-active-color: rgba(92, 78, 60, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Athiti', sans-serif;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  color: var(--dark-theme-text-soft);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition:
    background-color 220ms ease,
    color 220ms ease;
}

a{
  color: inherit;
}



.wallPaper {
  background:
    radial-gradient(
      circle at 100% 100%,
      rgba(202,158,103,0.55) 0%,
      rgba(202,158,103,0.20) 25%,
      rgba(0,0,0,0) 40%
    ),
    radial-gradient(
      circle at 0% 40%,
      rgba(202,158,103,0.35) 0%,
      rgba(202,158,103,0.15) 10%,
      rgba(0,0,0,0) 20%
    ),
    linear-gradient(
      180deg,
      #191919 0%,
      #111111 30%,
      #0a0a0a 70%
    );
}

body.theme-light .wallPaper {
  background:
    radial-gradient(
      circle at 100% 100%,
      rgba(198,160,106,0.26) 0%,
      rgba(198,160,106,0.10) 22%,
      rgba(0,0,0,0) 42%
    ),
    radial-gradient(
      circle at 0% 35%,
      rgba(198,160,106,0.16) 0%,
      rgba(198,160,106,0.06) 12%,
      rgba(0,0,0,0) 24%
    ),
    linear-gradient(
      180deg,
      #f7f3ee 0%,
      #f1ece5 38%,
      #ebe5dd 100%
    );
}

.wallPaper::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.10'/%3E%3C/svg%3E");
  pointer-events:none;
}

body.theme-light .wallPaper::after {
  opacity: 0.25;
}

#wallPaper {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.page {
  flex: 1 0 auto;
  min-height: 0;
}

/* =========================
   FOOTER
   ========================= */

.siteFooter {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(14px, 2vw, 18px) 16px clamp(16px, 2.5vw, 24px);
  background: var(--header-bg);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  transition:
    background-color 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease;
}

body.theme-light .siteFooter {
  box-shadow: 0 -6px 20px rgba(76, 59, 40, 0.08);
}

.footerInner {
  position: relative;
  width: min(100%, var(--container-max));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: rgba(255,255,255,0.86);
  text-shadow: 0 2px 10px rgba(0,0,0,0.42);
  padding-right: 120px;
  transition: color 220ms ease, text-shadow 220ms ease;
}

body.theme-light .footerInner {
  color: rgba(63, 53, 43, 0.88);
  text-shadow: none;
}

.footerTop p {
  margin: 6px 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.65;
}

.footerNav {
  width: 100%;
  display: flex;
  justify-content: center;
}

.footerLinks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
  padding: 0;
}

.footerLinks li {
  list-style: none;
}

.footerLinks a {
  position: relative;
  display: inline-block;
  padding: 7px 12px;
  text-decoration: none;
  font-size: clamp(11px, 1.3vw, 13px);
  color: #aaa;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--nav-radius);
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--transition-fast) ease,
    background-color var(--transition-fast) ease,
    box-shadow var(--transition-fast) ease,
    opacity var(--transition-fast) ease;
}

body.theme-light .footerLinks a {
  color: rgba(83, 72, 61, 0.88);
}

.footerLinks a:hover,
.footerLinks a:focus-visible {
  color: #1a1a1a;
  background-color: var(--logo-beige);
  box-shadow:
    0 3px 7px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.18);
}

body.theme-light .footerLinks a:hover,
body.theme-light .footerLinks a:focus-visible {
  color: var(--light-theme-text);
  box-shadow:
    0 3px 10px rgba(88, 69, 44, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.08);
}

.footerLinks a:focus-visible {
  outline: none;
}

/* =========================
   SWITCH THEME
   ========================= */

.themeSwitchWrap {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  z-index: 3;
}

.themeSwitch {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: rgba(255,255,255,0.72);
  font-family: 'Mulish', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 180ms ease, color 220ms ease;
}

.themeSwitch::before,
.themeSwitch::after {
  position: absolute;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 4;
}

.themeSwitch::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(270px, calc(100vw - 40px));
  padding: 9px 12px;
  border: 1px solid rgba(198, 160, 106, 0.38);
  border-radius: 8px;
  background: rgba(22, 21, 20, 0.92);
  color: rgba(246, 242, 236, 0.94);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: left;
  text-transform: none;
  transform: translateY(6px);
  white-space: normal;
}

.themeSwitch::before {
  content: "";
  bottom: calc(100% + 7px);
  right: 22px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(198, 160, 106, 0.38);
  border-bottom: 1px solid rgba(198, 160, 106, 0.38);
  background: rgba(22, 21, 20, 0.92);
  transform: translateY(6px) rotate(45deg);
}

.themeSwitch:hover::after,
.themeSwitch:focus-visible::after,
.themeSwitch:active::after {
  opacity: 1;
  transform: translateY(0);
}

.themeSwitch:hover::before,
.themeSwitch:focus-visible::before,
.themeSwitch:active::before {
  opacity: 1;
  transform: translateY(0) rotate(45deg);
}

.themeSwitch:hover {
  opacity: 0.9;
}

.themeSwitch:focus-visible {
  outline: none;
}

body.theme-light .themeSwitch {
  color: rgba(78, 66, 54, 0.76);
}

body.theme-light .themeSwitch::after {
  border-color: rgba(155, 123, 78, 0.30);
  background: rgba(255,255,255,0.92);
  color: rgba(43, 36, 29, 0.92);
  box-shadow:
    0 14px 30px rgba(76, 59, 40, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.78);
}

body.theme-light .themeSwitch::before {
  border-color: rgba(155, 123, 78, 0.30);
  background: rgba(255,255,255,0.92);
}

.themeSwitch__label {
  opacity: 0.62;
  transition: opacity 180ms ease, color 180ms ease;
}

.themeSwitch__track {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.36),
    0 2px 8px rgba(0,0,0,0.18);
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

body.theme-light .themeSwitch__track {
  background: rgba(198, 160, 106, 0.18);
  border-color: rgba(198, 160, 106, 0.32);
  box-shadow:
    inset 0 2px 6px rgba(90, 69, 43, 0.10),
    0 2px 8px rgba(90, 69, 43, 0.06);
}

.themeSwitch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.80) 45%, rgba(210,210,210,0.72) 100%);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.65);
  transform: translateX(0);
  transition:
    transform 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

body.theme-light .themeSwitch__thumb {
  transform: translateX(20px);
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,1) 0%, rgba(244,238,226,1) 45%, rgba(214,189,146,0.95) 100%);
  box-shadow:
    0 2px 6px rgba(104, 79, 50, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.75);
}

body:not(.theme-light) .themeSwitch__label--dark,
body.theme-light .themeSwitch__label--light {
  opacity: 1;
}

/* =========================
   LIGHT THEME HELPERS FOR NAV
   ========================= */

body.theme-light .mainNav a {
  color: rgba(74, 63, 52, 0.88);
}

body.theme-light .mainNav a:hover,
body.theme-light .mainNav a.active,
body.theme-light .mainNav a.nav-pressed {
  color: var(--light-theme-text);
}

body.theme-light .mainNav a:hover {
  box-shadow:
    0 3px 7px rgba(93, 71, 42, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.08);
}

body.theme-light .mainNav a.active,
body.theme-light .mainNav a.nav-pressed {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.24);
}
