/* ==========================================================================
   V3 Core Shared Styles — Impeccable Craft Floor Edition
   Self-hosted Syne + Instrument Serif + DM Sans, themed browser surfaces,
   accessible contrast (>= 4.5:1), >= 12px minimum UI scale, zero side-tabs.
   ========================================================================== */

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/syne-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/instrument-serif-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-latin.woff2") format("woff2");
}

:root {
  --c-bg: #f8f9fc;
  --c-ink: #0d1321;
  --c-muted: #475569; /* >= 7.0:1 contrast on #f8f9fc & #ffffff */
  --c-line: rgba(13, 19, 33, 0.13);
  --c-accent: #0044ff;
  --c-accent-2: #d95300;
  --c-accent-3: #c4006a;
  --c-font-display: "Syne", "PingFang SC", "Microsoft YaHei", sans-serif;
  --c-font-serif: "Instrument Serif", Georgia, "Songti SC", serif;
  --c-font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --c-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--c-font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}
button { font-family: inherit; }

/* ---------- Themed Browser Surfaces (Craft Floor) ---------- */
::selection {
  background: rgba(0, 68, 255, 0.18);
  color: #0d1321;
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #eef1f7; }
::-webkit-scrollbar-thumb {
  background: rgba(13, 19, 33, 0.24);
  border-radius: 999px;
  border: 2px solid #eef1f7;
}
::-webkit-scrollbar-thumb:hover { background: rgba(13, 19, 33, 0.45); }

.c-tabular { font-variant-numeric: tabular-nums; }
.c-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Lock body scroll while inside Z-Axis Intro Stage */
body.z-locked {
  overflow: hidden !important;
  height: 100vh;
}

/* ---------- Custom Dual Optical Cursor ---------- */
@media (pointer: fine) {
  body.c-cursor-on,
  body.c-cursor-on a,
  body.c-cursor-on button {
    cursor: none !important;
  }
}
.c-cursor-dot,
.c-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-120px, -120px, 0);
}
.c-cursor-dot {
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--c-accent);
}
.c-cursor-ring {
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 999px;
  border: 1.5px solid rgba(13, 19, 33, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--c-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              margin 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.c-cursor-ring.is-pill {
  width: 96px; height: 34px;
  margin: -17px 0 0 -48px;
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(13, 19, 33, 0.22);
}
@media (pointer: coarse) {
  .c-cursor-dot, .c-cursor-ring { display: none !important; }
}

/* ---------- Dynamic Island Top Navigation ---------- */
.c-island-Dock {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8800;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(13, 19, 33, 0.92);
  color: #f8fafc;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(13, 19, 33, 0.18);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: calc(100vw - 24px);
}
.c-island-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  flex-shrink: 0;
}
.c-island-label {
  font-family: var(--c-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.c-island-div {
  width: 1px; height: 14px;
  background: rgba(255, 255, 255, 0.2);
}
.c-island-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.c-island-links a,
.c-island-btn {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.85);
  background: transparent;
  border: none;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.c-island-links a:hover,
.c-island-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}
.c-island-links a.active {
  background: #ffffff;
  color: #0d1321;
  font-weight: 700;
}

/* ---------- Directional Ripple Fill Button ---------- */
.c-dir-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--c-ink);
  background: #ffffff;
  color: var(--c-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 6px 18px rgba(13, 19, 33, 0.08);
  transition: color 0.28s ease, border-color 0.28s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.c-dir-btn .c-dir-ripple {
  position: absolute;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--c-accent);
  transform: scale(0);
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
  pointer-events: none;
}
.c-dir-btn:hover {
  color: #ffffff;
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 68, 255, 0.2);
}
.c-dir-btn:hover .c-dir-ripple {
  transform: scale(28);
}

/* ---------- Five-Blade Cinema Shutter Curtain ---------- */
.c-curtain {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.c-blade {
  background: #0d1321;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.42s cubic-bezier(0.76, 0, 0.24, 1);
}
.c-curtain.closing .c-blade { transform: scaleY(1); transform-origin: bottom; }
.c-curtain.opening .c-blade { transform: scaleY(0); transform-origin: top; }

@media (max-width: 640px) {
  .c-island-label { display: none; }
  .c-island-Dock { padding: 6px 12px; gap: 6px; }
}
