/* yassir's world — styles (inspired by tentwenty: black, light lowercase type, one accent) */

:root {
  --accent: #4a48f3;
  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --ink: #000000;
  --ink-muted: rgba(0, 0, 0, 0.62);
  --line: rgba(0, 0, 0, 0.12);
  --panel-w: 440px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font);
  font-weight: 300;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app { position: fixed; inset: 0; overflow: hidden; }
.hl { background: var(--accent); color: #fff; padding: 0 0.12em; }

#kg-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: grab;
}

/* ui layers fade in once the intro is over */
.ui { opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
.is-ready .ui { opacity: 1; }
.is-ready .ui button, .is-ready .ui a { pointer-events: auto; }

/* ---------- nav ---------- */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 40px;
}
.brand {
  background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer;
  font-size: 20px; font-weight: 500; letter-spacing: -0.02em;
}
.menu { display: flex; align-items: center; gap: 28px; }
.nav-link {
  background: none; border: 0; padding: 10px 0; min-height: 44px; cursor: pointer;
  font-size: 16px; font-weight: 400;
  text-underline-offset: 7px; text-decoration-thickness: 1px;
}
.nav-link:hover, .nav-link.is-active { text-decoration: underline; }

.pill {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 22px;
  border: 1.5px solid #fff; border-radius: 999px; background: transparent;
  font-size: 16px; font-weight: 400; cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.pill:hover, .pill.is-active { background: #fff; color: #000; }
.pill-solid { background: #fff; color: #000; min-height: 56px; padding: 0 30px; font-size: 18px; gap: 14px; }
.pill-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: absolute; z-index: 2; left: 40px; bottom: 132px; max-width: 760px;
  transition: opacity 0.6s ease, transform 0.8s var(--ease);
}
.eyebrow { margin: 0 0 14px; font-size: 16px; font-weight: 400; color: var(--muted); }
.hero .hl { white-space: nowrap; }
.hero h1 { margin: 0; font-size: 54px; line-height: 1.08; font-weight: 300; letter-spacing: -0.03em; }
.hint-link { margin: 26px 0 0; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 400; }
.is-ready.panel-open .hero { opacity: 0; transform: translateY(16px); }

/* ---------- bottom bar ---------- */
.bar {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 40px 28px;
  transition: opacity 0.6s ease, right 0.7s var(--ease);
}
.panel-open .bar { right: 488px; }
.hint { margin: 0; flex: none; font-size: 13px; font-weight: 400; color: var(--muted); }
.legend { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
.legend::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(0, 0, 0, 0.55);
  font-size: 14px; font-weight: 400; white-space: nowrap; cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.chip i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.chip:hover { border-color: #fff; }
.chip[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

/* ---------- details panel ---------- */
.panel {
  position: absolute; z-index: 6; top: 92px; right: 24px; bottom: 24px; width: var(--panel-w);
  background: #fff; color: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 36px 40px;
  transform: translateX(calc(100% + 48px)); opacity: 0; visibility: hidden;
  transition: transform 0.75s var(--ease), opacity 0.5s ease, visibility 0s linear 0.75s;
}
.panel:focus { outline: none; }
.panel-open .panel { transform: none; opacity: 1; visibility: visible; transition: transform 0.75s var(--ease), opacity 0.5s ease, visibility 0s; }

.p-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.p-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; color: var(--ink-muted); }
.p-kicker i, .p-row i { flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
.p-close {
  flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.16); background: #fff; color: #000;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.p-close:hover { background: #000; color: #fff; }
.p-img { display: block; width: 100%; object-fit: cover; margin-bottom: 26px; background: #f3f3f5; }
.p-img.is-contain { object-fit: contain; background: #fff; }
.p-title { margin: 0; font-size: 46px; line-height: 1.04; font-weight: 300; letter-spacing: -0.03em; }
.p-title.is-long { font-size: 36px; }
.p-cypher {
  margin: 16px 0 0; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  letter-spacing: 0; text-transform: none; color: var(--ink-muted); overflow-wrap: anywhere;
}
.p-cypher b { color: var(--accent); font-weight: 500; }
.p-meta { margin: 18px 0 0; font-size: 15px; font-weight: 400; color: var(--ink-muted); }
.p-desc { margin: 16px 0 0; font-size: 17px; line-height: 1.55; font-weight: 300; color: rgba(0, 0, 0, 0.84); }
.p-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
}
.p-stats div { display: flex; flex-direction: column; gap: 4px; }
.p-stats .n { font-size: 34px; line-height: 1; font-weight: 300; letter-spacing: -0.03em; }
.p-stats .l { font-size: 13px; font-weight: 400; color: var(--ink-muted); }
.p-links { display: flex; flex-direction: column; gap: 4px; margin-top: 26px; }
.p-link {
  display: inline-flex; align-items: center; gap: 12px; min-height: 40px;
  color: #000; font-size: 16px; font-weight: 400;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; overflow-wrap: anywhere;
}
.p-link svg { flex: none; transition: transform 0.3s var(--ease); }
.p-link:hover { color: var(--accent); }
.p-link:hover svg { transform: translateX(4px); }
.p-rows-title { margin: 34px 0 6px; font-size: 14px; font-weight: 400; color: var(--ink-muted); }
.p-rows { border-bottom: 1px solid var(--line); }
.p-row {
  width: 100%; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 0;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; color: #000;
}
.p-row i { width: 9px; height: 9px; }
.p-row .idx { flex: none; width: 24px; font-size: 13px; font-weight: 400; color: rgba(0, 0, 0, 0.55); font-variant-numeric: tabular-nums; }
.p-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.p-row .lbl { font-size: 17px; line-height: 1.25; font-weight: 400; }
.p-row .rel { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; text-transform: none; color: rgba(0, 0, 0, 0.55); }
.p-row .sub { font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.p-row svg { flex: none; transition: transform 0.3s var(--ease); }
.p-row:hover .lbl { color: var(--accent); }
.p-row:hover svg { transform: translateX(4px); }

/* ---------- intro ---------- */
.intro {
  position: absolute; inset: 0; z-index: 10; background: #000;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 8vw;
  transition: opacity 0.9s ease;
}
.intro.leaving { opacity: 0; pointer-events: none; }
.intro-text { margin: 0; max-width: 1180px; min-height: 2.3em; font-size: 68px; line-height: 1.14; font-weight: 300; letter-spacing: -0.03em; }
.intro .ih { margin: 0 0.02em; padding: 0 0.1em; }
.intro .ih:empty { display: none; }
.intro .l2 { display: none; color: rgba(255, 255, 255, 0.55); }
.intro.has-l2 .l2 { display: block; }
.intro .l2w { color: #fff; }
.caret {
  display: inline-block; width: 2px; height: 0.95em; margin-left: 5px; vertical-align: -0.1em;
  background: #fff; visibility: hidden; animation: kg-blink 1.04s steps(1) infinite;
}
.intro[data-line="1"] .l1 .caret, .intro[data-line="2"] .l2 .caret { visibility: visible; }
.intro.typing .caret { animation: none; }
@keyframes kg-blink { 50% { opacity: 0; } }
.ask {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  margin-top: 44px; min-height: 60px;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}
.ask.on { opacity: 1; transform: none; pointer-events: auto; }
.ask span { font-size: 15px; font-weight: 400; color: var(--muted); }
.skip {
  position: absolute; right: 40px; bottom: 28px; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.72); font-size: 15px; font-weight: 400;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px;
}
.skip:hover { color: #fff; }

/* ---------- no-js fallback ---------- */
.nojs { position: relative; z-index: 20; max-width: 760px; margin: 0 auto; padding: 64px 24px; overflow-y: auto; height: 100%; }
.nojs a { color: #fff; }

/* ---------- phones ---------- */
@media (max-width: 759px) {
  .nav { padding: 14px 18px; }
  .nav-link { display: none; }
  .pill { padding: 0 18px; font-size: 15px; }
  .hero { left: 20px; right: 20px; top: 86px; bottom: auto; max-width: none; }
  .eyebrow { font-size: 14px; }
  .hero h1 { font-size: 32px; }
  .hint, .hint-link { display: none; }
  .bar { padding: 0 14px 16px; }
  .panel-open .bar { right: 0; opacity: 0; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 64%;
    border-radius: 18px 18px 0 0; padding: 18px 20px 32px;
    transform: translateY(105%);
  }
  .p-title { font-size: 38px; }
  .p-title.is-long { font-size: 30px; }
  .intro { padding: 0 24px; }
  .intro-text { font-size: 36px; }
  .skip { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
