:root {
  /* ───────── Frosted Mint ───────── */

  --frosted-mint-100: #edf9f0ff;
  /*Surface/light*/
  --frosted-mint-500: #d4f2dbff;
  /*Surface/background — OG*/
  --frosted-mint-600: #b8e0b1ff;
  /*Surface/hover*/
  --frosted-mint-700: #9cd089ff;
  /*Surface/active*/
  --frosted-mint-900: #7bbf6fff;
  /*Surface/pressed*/
  --semi-frosted-mint-500: rgba(212, 242, 219, 0.4);
  /*Surface/semi-transparent*/
  --semi-lime-cream-500: rgba(206, 247, 160, 0.4);
  /*Accent/semi-transparent*/
  --semi-rosy-taupe-500: rgba(186, 151, 144, 0.4);
  /*Muted/semi-transparent*/
  --semi-berry-blush-500: rgba(145, 77, 118, 0.4);
  /*Primary/semi-transparent*/
  --semi-wine-plum-500: rgba(105, 53, 63, 0.4);
  /*Dark/semi-transparent*/
  --semi-amber-500: rgba(201, 149, 59, 0.4);
  /*Expert/semi-transparent*/

  /* ───────── Lime Cream ───────── */

  --lime-cream-100: #e5fccaff;
  /*Accent/light*/
  --lime-cream-500: #cef7a0ff;
  /*Accent/highlight — OG*/
  --lime-cream-600: #b6eb7cff;
  /*Accent/hover*/
  --lime-cream-700: #9bdd5cff;
  /*Accent/active*/
  --lime-cream-900: #7fc042ff;
  /*Accent/pressed*/

  /* ───────── Rosy Taupe ───────── */

  --rosy-taupe-100: #d8c1bcff;
  /*Muted/light*/
  --rosy-taupe-500: #ba9790ff;
  /*Muted/support — OG*/
  --rosy-taupe-600: #a9827aff;
  /*Muted/hover*/
  --rosy-taupe-700: #966c64ff;
  /*Muted/active*/
  --rosy-taupe-900: #7d5650ff;
  /*Muted/pressed*/

  /* ───────── Berry Blush ───────── */

  --berry-blush-100: #b6789dff;
  /*Primary/light*/
  --berry-blush-500: #914d76ff;
  /*Primary/brand — OG*/
  --berry-blush-600: #7d4065ff;
  /*Primary/hover*/
  --berry-blush-700: #693454ff;
  /*Primary/active*/
  --berry-blush-900: #542843ff;
  /*Primary/pressed*/

  /* ───────── Wine Plum ───────── */

  --wine-plum-100: #87505bff;
  /*Dark/light*/
  --wine-plum-500: #69353fff;
  /*Dark/base — OG*/
  --wine-plum-600: #592c35ff;
  /*Dark/hover*/
  --wine-plum-700: #49242bff;
  /*Dark/active*/
  --wine-plum-900: #391b21ff;
  /*Dark/pressed*/

  /* ───────── Warm Amber ───────── */

  --amber-100: #e3c07aff;
  /*Expert/light*/
  --amber-500: #c9953bff;
  /*Expert/brand — OG*/
  --amber-600: #b88630ff;
  /*Expert/hover*/
  --amber-700: #a87826ff;
  /*Expert/active*/
  --amber-900: #8a621dff;
  /*Expert/pressed*/

  /* ───────── Font Weights ───────── */
  --weight-100: 100;
  --weight-200: 200;
  --weight-300: 300;
  --weight-400: 400;
  --weight-500: 500; /* OG */
  --weight-600: 600;
  --weight-700: 700;
  --weight-800: 800;
  --weight-900: 900;

  --extra-small-font-size: 0.75em;
  --small-font-size: 0.875em;
  --medium-font-size: 1em;
  --large-font-size: 1.25em;

  /* ──────────────────────────── Semantic aliases ──────────────────── */
  --Primary: var(--berry-blush-500);
  --Secondary: var(--wine-plum-500);
  --Tertiary: var(--amber-500);

  /* Interactive state: light mode darkens, dark mode lightens */
  --hover-brightness: 0.85;
  --active-brightness: 0.7;

  /* Theme colors (overridable by body.dark) */
  --body-text: var(--wine-plum-500);
  --body-bg: var(--frosted-mint-500);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: var(--body-text);
  font-family: Helvetica, Arial, sans-serif, "Times New Roman", Times, serif;
}

html,
body {
  height: 100%;
  overflow: auto;
  overscroll-behavior: none;
}

body {
  background: var(--body-bg);
  transition: background-color 0.3s ease;
}

html[data-theme-mode="Dark"] {
  --body-text: var(--frosted-mint-100);
  --body-bg: #1a1a2e;
  --hover-brightness: 1.15;
  --active-brightness: 1.3;
}

section {
  position: relative;
}

/* ───────── Tilt ───────── */
.tilt {
  transform: perspective(800px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* ───────── Glass Surface ───────── */
.glass {
  background-color: rgba(255, 255, 255, 0.06);
  /* Subtle surface micro-texture (scratches/smudges) */
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.008) 2px,
      rgba(255, 255, 255, 0.008) 3px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 5px,
      rgba(255, 255, 255, 0.005) 5px,
      rgba(255, 255, 255, 0.005) 6px
    );
  backdrop-filter: blur(13px) saturate(180%);
  -webkit-backdrop-filter: blur(13px) saturate(180%);
  /* Edge thickness — varied borders simulate light catching different edges */
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  /* Primary + secondary specular highlights */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;

    background:
      /* Main highlight — brighter, tighter */
      radial-gradient(
        ellipse 60% 35% at 22% 8%,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.15) 40%,
        transparent 70%
      ),
      /* Secondary bounce light (bottom-right rim) */
      radial-gradient(
          ellipse 30% 20% at 72% 90%,
          rgba(255, 255, 255, 0.12) 0%,
          transparent 60%
        );
  }

  /* Inner pane — separated highlight for double-pane depth */
  &::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    );
    pointer-events: none;
    z-index: -1;
  }

  > * {
    position: relative;
    z-index: 1;
  }
}

/* ───────── Cross-document View Transitions ───────── */
@view-transition {
  navigation: auto;
}

/* Keep nav perfectly stationary */
::view-transition-group(nav) {
  animation-duration: 0s;
}

::view-transition-old(nav) {
  animation-duration: 0s;
}

::view-transition-new(nav) {
  animation-duration: 0s;
}

/* Slide the page content instead of fade */
@keyframes slide-out-left {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-20%);
    opacity: 0;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(20%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

::view-transition-old(root) {
  animation: slide-out-left 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

::view-transition-new(root) {
  animation: slide-in-right 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ───────── Navigation ───────── */
nav {
  view-transition-name: nav;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  display: flex;
  justify-content: center;
  gap: 1.8em;
  padding: 1em;

  div {
    isolation: isolate;
    /* prevent backdrop-filter blur from bleeding into button content */
    border: 1px solid var(--wine-plum-500);
    border-radius: 5px;
    background-color: var(--semi-frosted-mint-500);
    /* Keep base anchored so scale doesn't drift bottom-left */
    transform-origin: bottom left;
    transition:
      transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
      background-color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
      box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);

    &:hover {
      background-color: var(--lime-cream-500);
      transform: scale(1.1) translate(5px, -5px);
      box-shadow:
        -2px 2px 0 var(--frosted-mint-600),
        -4px 4px 0 var(--frosted-mint-700),
        -6px 6px 0 var(--frosted-mint-900);
    }

    a {
      text-decoration: none;
      color: var(--body-text);
      font-size: 1.2em;
      font-weight: var(--weight-300);
      display: flex;
      align-items: center;
      gap: 0.4em;
      padding: 0.5em 1em;

      i {
        font-size: 0.9em;
      }
    }
  }
}

/* ───────── Main Layout ───────── */
main {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
}

/* ───────── Footer ───────── */
footer {
  text-align: center;
  padding: 1.5em 1em;
  background-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(13px) saturate(180%);
  -webkit-backdrop-filter: blur(13px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  margin-top: 2em;

  p {
    font-size: var(--small-font-size);
    font-weight: var(--weight-300);
    color: var(--rosy-taupe-600);
    letter-spacing: 0.5px;
  }
}
