:root{
  --bg:#050507;
  --bg2:#010102;

  --ivory:#f2efe7;
  --muted:#c7c1b4;

  /* Deep stone base */
  --stoneA:#24252a;
  --stoneB:#17181c;
  --stoneC:#2f3037;

  /* Subtle accent tints (vivid yet subdued) */
  --c-modewheel:#c43f3f;
  --c-about:#c98a35;
  --c-theory:#c8bb2f;
  --c-harmonics:#3ea565;
  --c-spheres:#2f78c8;
  --c-shop:#5b49c6;
  --c-contact:#a147c6;

  --railW: 252px;
  --btnH: 60px;

  --radius: 16px;
  --radiusInner: 12px;
  --frameW: 3px;
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html, body{
  height:100%;
  margin:0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.04), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,.02), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 85%);
  font-family: "Cormorant Garamond", Garamond, "Palatino Linotype", Palatino, serif;
}

a{ color:inherit; text-decoration:none; }
a:focus, button:focus{ outline: 2px solid rgba(255,255,255,.30); outline-offset: 3px; }

.page{ min-height:100vh; display:flex; }

/* ===== Stone + Frame (refined, no crosshatch) ===== */
.stone{
  /* subtle marbling using large soft gradients */
  background:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,.05), rgba(255,255,255,0) 52%),
    radial-gradient(circle at 70% 78%, rgba(0,0,0,.55), rgba(0,0,0,0) 58%),
    radial-gradient(circle at 65% 30%, rgba(255,255,255,.02), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, var(--stoneA), var(--stoneB));
}

.frame-outer{
  position:relative;
  border-radius: var(--radius);
  border: var(--frameW) solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.06),
    inset 0 -12px 20px rgba(0,0,0,.65),
    0 18px 36px rgba(0,0,0,.48);
  overflow:hidden;
}

/* corner ornaments (rune-like cuts) */
.frame-outer::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.75;
  background:
    /* top-left */
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,0) 26%) top left / 40px 40px no-repeat,
    linear-gradient(315deg, rgba(0,0,0,.55), rgba(0,0,0,0) 26%) top left / 40px 40px no-repeat,
    /* top-right */
    linear-gradient(225deg, rgba(255,255,255,.10), rgba(255,255,255,0) 26%) top right / 40px 40px no-repeat,
    linear-gradient(45deg, rgba(0,0,0,.55), rgba(0,0,0,0) 26%) top right / 40px 40px no-repeat,
    /* bottom-left */
    linear-gradient(45deg, rgba(255,255,255,.08), rgba(255,255,255,0) 26%) bottom left / 40px 40px no-repeat,
    linear-gradient(135deg, rgba(0,0,0,.60), rgba(0,0,0,0) 26%) bottom left / 40px 40px no-repeat,
    /* bottom-right */
    linear-gradient(315deg, rgba(255,255,255,.08), rgba(255,255,255,0) 26%) bottom right / 40px 40px no-repeat,
    linear-gradient(225deg, rgba(0,0,0,.60), rgba(0,0,0,0) 26%) bottom right / 40px 40px no-repeat;
}

/* inner bevel (inlay edge) — kept tight to preserve space */
.frame-outer::after{
  content:"";
  position:absolute;
  inset: 8px;
  border-radius: var(--radiusInner);
  border: 2px solid rgba(0,0,0,.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 2px 0 rgba(255,255,255,.025),
    inset 0 -3px 10px rgba(0,0,0,.60);
  pointer-events:none;
}

/* inlaid panel */
.inlay{
  position:relative;
  border-radius: var(--radiusInner);
  background:
    radial-gradient(circle at 50% 25%, rgba(255,255,255,.04), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.55));
  border: 2px solid rgba(255,255,255,.05);
  box-shadow:
    inset 0 10px 20px rgba(0,0,0,.70),
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* ===== Desktop rail ===== */
.rail{
  width: var(--railW);
  flex: 0 0 var(--railW);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display:none;
  border-right: 4px solid rgba(255,255,255,.08);
  box-shadow: 14px 0 28px rgba(0,0,0,.45);
}

.brand{
  text-align:center;
  margin: 6px 6px 14px;
}
.brand .title{
  font-size: 34px;
  letter-spacing: .01em;
  text-shadow: 0 2px 0 rgba(0,0,0,.60), 0 18px 30px rgba(0,0,0,.35);
}
.brand .subtitle{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ===== Nav buttons: full-color stone tint, refined frame ===== */
.navbtn{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height: var(--btnH);
  width: 100%;
  margin: 0 0 10px;
  padding: 0 14px;
  border:0;
  cursor:pointer;
  border-radius: var(--radius);
  color: var(--ivory);
  font-size: 20px;
  letter-spacing: .01em;
  user-select:none;
}

/* button slab (tinted stone) */
.navbtn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: var(--radius);
  /* accent tint across entire slab */
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.05), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.55), rgba(0,0,0,0) 60%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 28%, var(--stoneC)),
      color-mix(in srgb, var(--accent) 18%, var(--stoneB)));
  border: 3px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.06),
    inset 0 -10px 18px rgba(0,0,0,.70),
    0 14px 28px rgba(0,0,0,.48);
  pointer-events:none;
}

/* inner frame + rune corners (compact) */
.navbtn::after{
  content:"";
  position:absolute;
  inset: 8px;
  border-radius: var(--radiusInner);
  border: 2px solid rgba(0,0,0,.65);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 2px 0 rgba(255,255,255,.03),
    inset 0 -3px 10px rgba(0,0,0,.62);
  background:
    /* faint runic notches near top */
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, rgba(255,255,255,0) 1px 14px) top / 100% 6px no-repeat,
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.50));
  pointer-events:none;
}

.navbtn .label{
  position:relative;
  z-index:2;
  text-shadow: 0 -1px 0 rgba(0,0,0,.70), 0 1px 0 rgba(255,255,255,.08);
}

/* current page: slightly brighter border, no glow */
.navbtn.is-current::before{
  border-color: rgba(255,255,255,.16);
}

/* hover: heavy lift */
.navbtn:hover::before{ box-shadow:
    inset 0 2px 0 rgba(255,255,255,.07),
    inset 0 -10px 18px rgba(0,0,0,.70),
    0 18px 34px rgba(0,0,0,.56);
}
.navbtn:active{ transform: translateY(1px); }
.navbtn:active::before{
  box-shadow:
    inset 0 3px 12px rgba(0,0,0,.80),
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 24px rgba(0,0,0,.50);
}

/* ===== Mobile topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  padding: 14px 12px 12px;
  border-bottom: 4px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 26px rgba(0,0,0,.45);
}

.topbar .brand .title{ font-size: 30px; }
.topbar .brand .subtitle{ font-size: 12px; }

.mobile-nav{
  width: min(760px, 100%);
  display:grid;
  gap: 10px;
}
.mobile-nav .row{
  display:grid;
  gap: 10px;
  justify-content:center;
}
.mobile-nav .row.top{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mobile-nav .row.bottom{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mobile-nav .navbtn{
  height: 58px;
  font-size: 16px;
  margin: 0;
}

/* ===== Content ===== */
.content{
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  flex-direction:column;
}
.main{
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
}

/* Wheel stage */
#wheel-stage{
  width: 100%;
  min-height: calc(100vh - 44px);
  height: auto;
  border-radius: 18px;
  overflow: hidden;
}
#wheel-stage .inlay{
  position: relative;
  inset: auto;
  padding: 18px;
  display: block;
  text-align: center;
}

#wheel-stage h1{
  margin: 0 0 10px;
  font-size: 34px;
}
#wheel-stage p{
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

/* Standard page card */
.card{
  max-width: 980px;
  margin: 0 auto;
  padding: 0; /* inlay handles padding */
  border-radius: 18px;
}
.card .inlay{
  padding: 20px;
}
.card h1{
  margin: 0 0 10px;
  font-size: 38px;
  text-shadow: 0 2px 0 rgba(0,0,0,.65);
}
.card p{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}
.card .note{
  font-size: 13px;
  color: rgba(255,255,255,.70);
}

.footer{
  padding: 14px 18px 20px;
  color: rgba(255,255,255,.60);
  font-size: 12px;
  text-align:center;
}

/* ===== Responsive ===== */
@media (min-width: 900px){
  .rail{ display:block; }
  .topbar{ display:none; }
  .content{ width: calc(100vw - var(--railW)); }
}

@media (max-width: 420px){
  .mobile-nav .navbtn{ font-size: 14px; }
}



/* === Mobile layout adjustments === */
@media (max-width: 820px) {
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 8px 10px;
    position: relative; /* for absolutely-positioned drawer */
  }

  .mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-header .title { font-size: 18px; }
  .mobile-header .subtitle { font-size: 12px; opacity: 0.85; }

  .hamburger {
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.25);
    color: inherit;
  }

  /* Drawer is hidden by default (do not override the [hidden] attribute) */
  .mobile-drawer[hidden] { display: none !important; }

  /* When opened, show as an overlay so it doesn't push the wheel down */
  .mobile-drawer {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.62);
    display: grid;
    gap: 8px;
    z-index: 60;
  }

  .mobile-drawer a{
    text-decoration:none;
    color: inherit;
  }

/* Remove frames/inlays on mobile */
  .frame-outer,
  .stone.frame-outer,
  #wheel-stage.frame-outer,
  .inlay {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  /* Fully flatten the Mode Wheel stage on small screens (avoid subtle texture warping at edges) */
  #wheel-stage{
    border-radius: 0 !important;
    overflow: visible !important;
    min-height: auto !important;
  }
  #wheel-stage.stone{
    background: transparent !important;
  }

  /* Make drawer buttons more opaque and more clearly tinted by their accent */
  .mobile-drawer .navbtn{
    margin: 0;
    height: auto;
    min-height: 44px;
  }

  .mobile-drawer .navbtn::before{
    background:
      radial-gradient(circle at 18% 28%, rgba(255,255,255,.06), rgba(255,255,255,0) 52%),
      radial-gradient(circle at 70% 78%, rgba(0,0,0,.62), rgba(0,0,0,0) 58%),
      linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 72%, var(--stoneC)),
        color-mix(in srgb, var(--accent) 55%, var(--stoneB)));
    border: 3px solid rgba(255,255,255,.24);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,.07),
      inset 0 -10px 18px rgba(0,0,0,.72),
      0 10px 20px rgba(0,0,0,.50);
  }

  .mobile-drawer .navbtn::after{
    background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.55));
    border: 2px solid rgba(0,0,0,.70);
  }

  /* Remove subtle texture warping/frame effects on mobile by flattening card/wheel wrappers */
  #wheel-stage,
  .card{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .main{
    padding: 0 10px 18px !important;
  }

}

