:root {
  --bg: #050505;
  --graphite: #0c0c0c;
  --accent: #f0f0f0;
  --ivory: #f5f5f0;
  --dim: #262626;
  --online: #00ff41;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--accent);
  font-family: 'Courier New', monospace;
  margin: 0;
  overflow-x: hidden;
}

body::after {
  content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: url('https://grainy-gradients.vercel.app/noise.svg');
  opacity: 0.08; pointer-events: none; z-index: 100;
}

.ui-header {
  padding: 40px; display: flex; justify-content: space-between;
  position: absolute; width: 100%; top: 0; z-index: 10;
}

.sys-info { display: flex; align-items: center; font-size: 10px; letter-spacing: 2px; }
.dot { width: 4px; height: 4px; background: var(--online); border-radius: 50%; margin-right: 10px; box-shadow: 0 0 5px var(--online); }
.lang-static { font-size: 10px; color: var(--dim); }

.ui-main { padding: 160px 40px 60px; }

.hero-nav {
  display: flex;
  flex-direction: column;
  margin-bottom: 100px;
}

.nav-item {
  font-size: clamp(40px, 11vw, 150px);
  line-height: 0.85;
  font-weight: 900;
  letter-spacing: -6px;
  text-decoration: none;
  color: var(--accent);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  align-items: flex-start;
  position: relative;
  width: fit-content;
}

.nav-label {
  font-size: 14px;
  letter-spacing: 2px;
  margin-right: 20px;
  margin-top: 15px;
  color: var(--dim);
  font-weight: normal;
}

.nav-item:hover {
  color: var(--ivory);
  padding-left: 20px;
  text-shadow: 0 0 15px rgba(245, 245, 240, 0.3), 0 0 30px rgba(245, 245, 240, 0.1);
}

.nav-item:hover .nav-label { color: var(--online); }

.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.grid-item {
  aspect-ratio: 3/4; background: var(--graphite);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}

.grid-item img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.45; filter: grayscale(1); transition: opacity 0.4s ease;
}

.grid-item:hover img { opacity: 0.85; }

.ui-footer {
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  border-top: none;
}

.marquee {
  display: flex;
  width: 100%;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: scroll 40s linear infinite;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.33%); }
}

.marquee-item {
  padding: 0 50px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.footer-center { text-align: center; flex-grow: 1; padding: 0 40px; }
.f-row-top { font-size: 9px; color: #151515; margin-bottom: 12px; letter-spacing: 2px; }

.ivory-glow-text {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.5px;
  transition: all 0.4s ease;
  cursor: text;
  user-select: all;
}

.ivory-glow-text:hover {
  color: var(--ivory);
  text-shadow: 0 0 5px rgba(245, 245, 240, 0.5), 0 0 10px rgba(245, 245, 240, 0.2);
}

.f-row-bottom {
  font-size: 10px; color: var(--dim);
  word-break: break-all; max-width: 700px; margin: 0 auto;
}

.footer-right { text-align: right; min-width: 200px; }
.mail-link { color: var(--dim); text-decoration: none; font-size: 11px; transition: color 0.3s; }
.mail-link:hover { color: var(--accent); }

.overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 5, 5, 0.95);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.overlay.active { opacity: 1; pointer-events: all; }

.overlay-content {
  width: 90%; max-width: 600px; height: 70vh;
  background: var(--graphite); border: 1px solid #1a1a1a;
  padding: 60px; position: relative;
  display: flex; flex-direction: column;
}

.about-text-wrapper { overflow-y: auto; padding-right: 20px; }
.about-text-wrapper::-webkit-scrollbar { width: 2px; }
.about-text-wrapper::-webkit-scrollbar-thumb { background: var(--dim); }

.close-btn {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none; color: var(--dim);
  font-family: inherit; cursor: pointer; font-size: 10px;
}

.book-viewport {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  background: var(--bg);
}

.book-page {
  min-width: 100vw;
  height: 100vh;
  display: flex;
  border-right: 1px solid #111;
}

.book-page.has-lock .muscle-path {
  pointer-events: all !important;
}

.page-media-half {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px;
  background: transparent;
}

.page-media-half img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.8;

  border: 1px solid var(--dim);
  padding: 10px;
  transition: all 0.4s ease;
}

.page-media-half img:hover {
  border-color: var(--ivory);
  opacity: 1;
  box-shadow: 0 0 15px rgba(245, 245, 240, 0.1);
}

.page-text-half {
  flex: 1;
  height: 100%;
  padding: 100px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #111;
  position: relative;
}

.text-content-wrapper {
  max-width: 500px;
  margin: 0 auto;
}

.page-content {
  margin-top: 30px;
  font-size: 13px;
  line-height: 1.8;
  color: #666;
  text-align: justify;
}

.page-num {
  position: absolute;
  bottom: 40px;
  right: 40px;
  color: #1a1a1a;
  font-size: 10px;
  letter-spacing: 2px;
}

.zoom-lens {
  position: fixed;
  width: 150px;
  height: 150px;
  border: 1px solid var(--ivory);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.2);
  transition: opacity 0.2s ease;
  background-color: var(--bg);
}

.zoom-lens.active {
  opacity: 1;
}

.page-media-half img {
  cursor: crosshair;
}

.anatomy-link.locked {
  color: #ff4444 !important;
  border-bottom: 1px solid #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.muscle-path.locked {
  opacity: 1 !important;
  stroke: #ff4444 !important;
  fill: rgba(255, 68, 68, 0.25) !important;
  stroke-dasharray: none;
}