/* =========================================================
   STYLE.CSS — shared styles for index.html and project.html
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,600;0,700;0,800;1,700;1,800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #f2f2ec;
  --fg: #0a0a0a;
  --muted: #888;
  --line: #d8d8d2;
  --line-strong: #0a0a0a;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  /* Neue Haas Grotesk-like stack: Inter loaded above as free fallback */
  font-family: 'Neue Haas Grotesk Display Pro', 'Neue Haas Grotesk', 'Helvetica Neue', Inter, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;       /* tighter kerning */
  font-feature-settings: "ss01", "ss02";
}
a { color: inherit; text-decoration: none; }

/* ===== INDEX PAGE (ragdoll) ===== */
body.index { height: 100%; overflow: hidden; cursor: none; user-select: none; -webkit-user-select: none; }
body.index canvas { display: block; touch-action: none; }

#brand {
  position: fixed; top: 22px; left: 24px;
  z-index: 20; pointer-events: none;
}
#brand img {
  display: block;
  width: 180px; height: auto;
  image-rendering: pixelated;
}
#tagline {
  margin-top: 8px;
  font-size: 11px;
  color: var(--fg);
  line-height: 1.5;
  font-weight: 500;
}

#projects-btn {
  position: fixed; top: 24px; right: 24px;
  z-index: 20;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: var(--fg); text-transform: uppercase;
  background: none;
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  cursor: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.05em;
}
#projects-btn:hover, #projects-btn.active { background: var(--fg); color: var(--bg); }

#reset-btn {
  position: fixed; top: 24px; right: 144px;
  z-index: 20;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: var(--fg); text-transform: uppercase;
  background: none;
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  cursor: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.05em;
}
#reset-btn:hover { background: var(--fg); color: var(--bg); }

#project-label {
  position: fixed; bottom: 24px; left: 24px;
  font-size: 12px; font-weight: 500; color: var(--fg);
  pointer-events: none; z-index: 20;
  opacity: 0; transition: opacity 0.15s;
  max-width: 70vw;
}
#instructions {
  position: fixed; bottom: 24px; right: 24px;
  font-size: 10px; color: var(--muted);
  pointer-events: none; z-index: 20;
  text-align: right; line-height: 1.6;
  text-transform: uppercase; letter-spacing: 0.05em;
}

#cursor {
  position: fixed; width: 14px; height: 14px;
  background: #000; border-radius: 50%;
  pointer-events: none; z-index: 200;
  transform: translate(-50%, -50%);
  transition: transform 0.08s, background 0.15s;
}
#cursor.grabbing { transform: translate(-50%, -50%) scale(2.2); }

/* Projects overlay — frosted glass, puppet visible behind */
#overlay {
  position: fixed; inset: 0;
  background: rgba(242, 242, 236, 0.10);
  backdrop-filter: blur(2px) saturate(1.05);
  -webkit-backdrop-filter: blur(2px) saturate(1.05);
  z-index: 50; display: none; overflow: hidden;
  flex-direction: column; justify-content: center;
  cursor: none;
}
#overlay.open { display: flex; }

#overlay-tickers {
  display: flex; flex-direction: column;
  justify-content: center; gap: 0;
  padding-top: 72px;
  overflow: hidden; width: 100%;
  pointer-events: none;   /* let clicks pass through to #overlay background */
}

/* Ticker rows */
.tk-row {
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: 6px 0;
}
.tk-row:last-child { border-bottom: 1px solid var(--line); }

.tk-inner {
  display: inline-flex; align-items: center;
  white-space: nowrap;
  animation: tk-left linear infinite;
  will-change: transform;
}
.tk-inner.tk-rev { animation-name: tk-right; }

@keyframes tk-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes tk-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0%); }
}

.tk-item {
  display: inline-flex; align-items: center;
  gap: 16px; margin-right: 64px;
  cursor: none;
}

.tk-dot {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #0a0a0a;
}

.tk-num {
  font-size: 40px; font-weight: 800; font-style: italic;
  color: var(--fg); line-height: 1; flex-shrink: 0;
}

.tk-wrap {
  display: flex; flex-direction: column; gap: 1px;
}

.tk-name {
  font-size: 42px; font-weight: 800; font-style: italic;
  color: #c2c2bb; line-height: 1; white-space: nowrap;
  letter-spacing: -0.02em;
}

.tk-sub {
  font-size: 10px; font-weight: 600; font-style: normal;
  color: #aaa; text-transform: uppercase;
  letter-spacing: 0.07em; white-space: nowrap;
}

#overlay-close {
  position: fixed; top: 24px; right: 24px;
  z-index: 60;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: var(--fg); text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  cursor: none;
  letter-spacing: 0.05em;
}
#overlay-close:hover { background: var(--fg); color: var(--bg); }

/* ===== PROJECT PAGE ===== */
body.project { padding: 28px 32px 64px; min-height: 100vh; }

.project header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 60px;
}
#back-btn {
  font-size: 12px; font-weight: 600;
  color: var(--fg); text-transform: uppercase;
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  letter-spacing: 0.05em;
}
#back-btn:hover { background: var(--fg); color: var(--bg); }

.proj-meta, .media-section, .next-project {
  display: grid; grid-template-columns: 200px 1fr; gap: 80px;
  margin-bottom: 60px;
}
.meta-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-top: 8px;
}
.meta-label small { display: block; color: #bbb; margin-top: 4px; font-size: 10px; }

.meta-content h1 {
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95; letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 28px;
  padding-left: 18px;
  border-left: 6px solid var(--fg);
}
.meta-content p {
  font-size: 15px; line-height: 1.6;
  color: #333; max-width: 720px;
}
.meta-tags {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tag {
  font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid #c0c0b8;
  color: #555;
  padding: 6px 10px;
  font-weight: 500;
}

/* Media */
.media-stack { display: flex; flex-direction: column; gap: 24px; }
.media-stack iframe,
.media-stack img {
  width: 100%; display: block;
  border: 1px solid var(--line);
  background: #e6e6df;
}
.media-stack iframe { aspect-ratio: 16 / 9; }
.video-placeholder, .image-placeholder {
  width: 100%; aspect-ratio: 16 / 9;
  background: #e6e6df;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  position: relative; font-weight: 500;
}
.image-placeholder { aspect-ratio: 4 / 3; }
.video-placeholder::before {
  content: ''; position: absolute;
  width: 64px; height: 64px;
  border: 1.5px solid #999;
  border-radius: 50%;
}
.video-placeholder::after {
  content: '';
  width: 0; height: 0;
  border-left: 16px solid #999;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 5px;
  z-index: 1;
}

.next-project {
  padding-top: 40px;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
}
.next-project a {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 600;
  line-height: 1; letter-spacing: -0.02em;
  color: var(--fg);
  transition: padding-left 0.2s, opacity 0.15s;
  display: inline-block;
}
.next-project a:hover { padding-left: 16px; opacity: 0.6; }

/* ===== PROJECT PHYSICS OVERLAY ===== */
#proj-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  background: rgba(5, 5, 5, 0.6);
}
#proj-overlay.open { display: block; }

#proj-canvas-wrap {
  position: absolute; inset: 0;
  z-index: 1;
}
#proj-canvas-wrap canvas {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  background: transparent !important;
}

#proj-header {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  pointer-events: none;
  padding: 28px 32px 70px;
  background: linear-gradient(to bottom, rgba(5,5,5,0.88) 45%, transparent 100%);
}
#proj-meta {
  font-size: 10px; color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px; font-style: normal; font-weight: 600;
}
#proj-title-el {
  font-size: clamp(26px, 5vw, 72px);
  color: #fff; font-weight: 800; font-style: italic;
  letter-spacing: -0.03em; line-height: 0.95;
  margin-bottom: 10px;
}
#proj-desc-el {
  font-size: 13px; color: rgba(255,255,255,0.58);
  font-weight: 400; font-style: normal;
  max-width: 560px; line-height: 1.55;
}
#proj-close-hint {
  position: absolute; bottom: 28px; right: 32px;
  z-index: 10; pointer-events: none;
  font-size: 10px; color: rgba(255,255,255,0.25);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  #proj-header { padding: 18px 20px 55px; }
  #proj-title-el { font-size: clamp(20px, 7vw, 40px); }
  #proj-desc-el { font-size: 11px; }
  #proj-close-hint { bottom: 16px; right: 20px; font-size: 9px; }
}

@media (max-width: 768px) {
  body.index { cursor: auto; }
  body.index #cursor { display: none; }
  body.index #overlay-list li,
  body.index #projects-btn,
  body.index #reset-btn,
  body.index #overlay-close { cursor: pointer; }

  #brand img { width: 130px; }
  #tagline { font-size: 9px; }
  #projects-btn, #reset-btn, #back-btn { font-size: 10px; padding: 8px 12px; }
  #reset-btn { right: 110px; }
  #project-label { font-size: 10px; bottom: 18px; left: 18px; }
  #instructions { font-size: 8px; bottom: 18px; right: 18px; }

  #overlay-tickers { padding-top: 60px; }
  .tk-dot { width: 32px; height: 32px; }
  .tk-num { font-size: 24px; }
  .tk-name { font-size: 26px; }
  .tk-sub { font-size: 8px; }
  .tk-item { gap: 10px; margin-right: 40px; }

  body.project { padding: 20px 20px 48px; }
  .project header { padding-bottom: 32px; margin-bottom: 32px; }
  .proj-meta, .media-section, .next-project {
    grid-template-columns: 1fr; gap: 18px; margin-bottom: 40px;
  }
  .meta-content h1 { font-size: 40px; padding-left: 12px; border-left-width: 4px; }
  .next-project a { font-size: 26px; }
}
