/* Creative Code Tilburg — first pass */

:root {
  --sidebar-w: clamp(220px, 22vw, 300px);
  --ink: #f2f0eb;
  --ink-dim: rgba(242, 240, 235, 0.65);
  --ink-mute: rgba(242, 240, 235, 0.4);
  --sidebar-bg: rgba(8, 8, 10, 0.72);
  --panel-bg: rgba(12, 12, 14, 0.92);
  --line: rgba(242, 240, 235, 0.14);
  --accent: #f2f0eb;
  --font-sans: "Roboto Mono", ui-monospace, monospace;
  --font-display: "Geom", "Roboto Mono", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050506;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* In-DOM for crawlers; off-screen for visitors (not display:none) */
.seo-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Background —— */

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #0a0a0c;
}

#glcanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#cables-root {
  position: absolute;
  inset: 0;
}

#cables-root iframe.cables-frame,
#cables-root canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* —— Background artist credit (bottom-right, over WebGL) —— */

.bg-credit {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  pointer-events: auto;
}

.bg-credit-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.bg-credit-link:hover {
  text-decoration: underline;
}

/* —— Play / pause —— */

.play-pause {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s;
}

.play-pause:hover {
  border-color: rgba(242, 240, 235, 0.35);
  background: rgba(8, 8, 10, 0.75);
}

.icon-pause,
.icon-play {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  position: relative;
}

.icon-pause::before,
.icon-pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 0.22rem;
  height: 100%;
  background: currentColor;
  border-radius: 1px;
}

.icon-pause::before {
  left: 0.12rem;
}

.icon-pause::after {
  right: 0.12rem;
}

.icon-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.42rem 0 0.42rem 0.72rem;
  border-color: transparent transparent transparent currentColor;
  background: none;
}

/* —— Shell layout —— */

.shell {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100%;
  min-height: 100dvh;
  pointer-events: none;
}

.shell > * {
  pointer-events: auto;
}

/* —— Left sidebar —— */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--sidebar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  height: 100%;
}

.sidebar-brand {
  margin-bottom: 2.5rem;
  /* Match .nav-btn horizontal padding so CCT / subtitle line up with button labels */
  padding: 0 0.75rem;
}

.sidebar-mark {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.sidebar-sub {
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-dim);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(242, 240, 235, 0.5);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: block;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: rgba(242, 240, 235, 0.08);
  color: #ffffff;
  outline: none;
  text-decoration: none;
}

.nav-btn.is-active {
  background: rgba(242, 240, 235, 0.1);
  color: #ffffff;
}

.sidebar-foot {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* —— Stage / CCT —— */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.5rem 1.75rem;
  pointer-events: none;
  text-align: left;
}

.cct-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(5.76rem, 17.28vw, 12.96rem);
  line-height: 0.85;
  letter-spacing: 0;
  color: rgba(242, 240, 235, 0.5);
  text-shadow: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cct-line {
  display: block;
  text-align: center;
}

/* —— Overlay panels —— */

.overlay {
  position: fixed;
  /* Leave the left sidebar free so nav clicks switch panels instead of only closing */
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w);
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 2rem 2rem 3rem;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  animation: panel-in 0.22s ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -0.5rem -0.5rem 0 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.panel-close:hover {
  color: var(--ink);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel p,
.panel li {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-dim);
}

.panel p {
  margin: 0 0 0.85rem;
}

.panel .lede {
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}

.panel .muted {
  color: var(--ink-mute);
  font-size: 0.88rem;
}

.cta-link {
  display: inline-block;
  margin: 0.35rem 0 0.75rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(242, 240, 235, 0.45);
  border-radius: 8px;
  background: rgba(242, 240, 235, 0.1);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.cta-link:hover {
  background: rgba(242, 240, 235, 0.18);
  border-color: var(--accent);
  text-decoration: none;
}

.panel ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
}

.link-list,
.event-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.link-list li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.event-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.event-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.event-title {
  color: var(--ink);
}

.event-status {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* —— Mobile / small screens —— */

@media (max-width: 720px) {
  :root {
    --sidebar-w: 0px;
  }

  html,
  body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .shell {
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
  }

  /* Compact top bar — brand + wrap nav, WebGL still full-bleed behind */
  .sidebar {
    position: relative;
    z-index: 60;
    width: 100%;
    height: auto;
    flex-shrink: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 0.65rem
      max(0.75rem, env(safe-area-inset-left));
    background: rgba(8, 8, 10, 0.82);
  }

  .sidebar-brand {
    margin-bottom: 0.55rem;
    padding: 0 0.35rem;
  }

  .sidebar-mark {
    font-size: 0.7rem;
  }

  .sidebar-sub {
    font-size: 0.72rem;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem;
    flex: 0;
  }

  .nav-btn {
    font-size: 0.78rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
  }

  .sidebar-foot {
    display: none;
  }

  .stage {
    flex: 1;
    min-height: 0;
    padding: 1rem max(1rem, env(safe-area-inset-right))
      max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem))
      max(1rem, env(safe-area-inset-left));
    justify-content: flex-end;
  }

  .cct-title {
    font-size: clamp(3.2rem, 18vw, 5.5rem);
  }

  /* Bottom sheet for content — leaves room for the top nav */
  .overlay {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: auto;
    align-items: flex-end;
  }

  .overlay-backdrop {
    background: rgba(0, 0, 0, 0.45);
  }

  .panel {
    width: 100%;
    max-height: min(72dvh, 640px);
    margin: 0;
    align-self: flex-end;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    padding: 1.25rem 1.15rem max(1.5rem, env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
    animation-name: panel-up;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  @keyframes panel-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .panel h2 {
    font-size: 1.35rem;
    padding-right: 2rem;
  }

  .panel p,
  .panel li {
    font-size: 0.9rem;
  }

  .event-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .cta-link {
    display: block;
    text-align: center;
    padding: 0.85rem 1rem;
  }

  .play-pause {
    top: auto;
    bottom: max(4.25rem, calc(env(safe-area-inset-bottom) + 3.5rem));
    right: max(0.85rem, env(safe-area-inset-right));
    width: 2.9rem;
    height: 2.9rem;
  }

  .bg-credit {
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    padding: 0.45rem 0.65rem;
  }

  .bg-credit-link {
    font-size: 0.78rem;
  }
}

/* Narrow phones */
@media (max-width: 380px) {
  .nav-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
    min-height: 2.35rem;
  }

  .cct-title {
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}

/* Touch: no hover-only dependency for active nav state */
@media (hover: none) {
  .nav-btn:hover {
    background: transparent;
    color: rgba(242, 240, 235, 0.5);
  }

  .nav-btn.is-active {
    background: rgba(242, 240, 235, 0.12);
    color: #ffffff;
  }
}
