/*
  Prism hero (home page): a dark full-viewport hero with a real-time 3D glass prism
  that splits a white beam into a soft rainbow (prism-hero.js). Every class is prefixed
  "ph-" so nothing here touches the rest of the site, and this sheet is loaded outside
  the cascade layers so the site's own styles never override it.
*/

.ph-hero {
  --bg: #151517;
  --bg-2: #1b1b1e;
  --ink: #ededed;
  --muted: #a1a1a1;
  --dim: #6e6e73;
  --line: rgba(255, 255, 255, 0.12);
  --chip: rgba(255, 255, 255, 0.04);
  --gutter: clamp(16px, 2.6vw, 28px);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;

  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.ph-hero *,
.ph-hero *::before,
.ph-hero *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ph-hero a {
  color: inherit;
  text-decoration: none;
}

.ph-hero button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.ph-hero :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Melt the hero's charcoal into the obsidian page below */
.ph-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 140px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 6, 8, 0), #060608);
}

.ph-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  touch-action: pan-y;
  opacity: 0;
  animation: ph-fade 1.6s 0.2s ease forwards;
}

.ph-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#ph-fx {
  mix-blend-mode: screen;
}

/* ---- Navigation ---- */

.ph-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gutter);
  height: 64px;
}

.ph-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ph-brand-mark {
  display: flex;
}

.ph-brand-slash {
  color: var(--dim);
  font-size: 22px;
  font-weight: 300;
  transform: translateY(-1px);
}

.ph-brand-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.ph-links {
  display: flex;
  gap: 20px;
  margin-left: 12px;
}

.ph-links a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s;
}

.ph-links a:hover,
.ph-links a[aria-current="page"] {
  color: var(--ink);
}

.ph-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ph-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 36px;
  padding: 0 6px 0 12px;
  min-width: 172px;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: var(--chip) !important;
  font-size: 14px;
  color: var(--muted) !important;
  transition: border-color 0.2s, color 0.2s;
}

.ph-search:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: var(--ink) !important;
}

.ph-hero kbd {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.ph-ask {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: var(--chip) !important;
  transition: background-color 0.2s, border-color 0.2s;
}

.ph-ask:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.ph-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.ph-icon-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.ph-menu {
  display: none;
}

/* ---- Copy ---- */

.ph-copy {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter) 64px;
  max-width: 600px;
  pointer-events: none;
}

.ph-copy > * {
  pointer-events: auto;
}

.ph-wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 8.6vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 72;
  margin-bottom: clamp(14px, 1.8vw, 22px);
  white-space: nowrap;
}

.ph-lede {
  font-size: clamp(28px, 3.05vw, 44px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin-bottom: clamp(24px, 2.6vw, 36px);
}

.ph-lede span {
  display: block;
}

.ph-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 14px;
}

.ph-tab {
  color: var(--dim) !important;
  padding: 2px 0 !important;
  transition: color 0.2s;
}

.ph-tab:hover {
  color: var(--muted) !important;
}

.ph-tab[aria-selected="true"] {
  color: var(--ink) !important;
}

.ph-dot {
  color: var(--dim);
  font-size: 11px;
}

.ph-cmd {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 440px;
  padding-top: 14px;
  font-size: 15px;
  line-height: 1.5;
}

.ph-cmd::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 70%, transparent);
}

.ph-cmd-text {
  transition: opacity 0.18s, transform 0.18s;
}

.ph-cmd-text.swap {
  opacity: 0;
  transform: translateY(3px);
}

.ph-go {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--dim) !important;
  transition: color 0.2s, background-color 0.2s;
}

.ph-go:hover {
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ---- Load-in ---- */

.ph-rise {
  opacity: 0;
  transform: translateY(12px);
  animation: ph-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.ph-copy > .ph-rise:nth-child(2) {
  animation-delay: 0.08s;
}

.ph-copy > .ph-rise:nth-child(3) {
  animation-delay: 0.16s;
}

.ph-copy > .ph-rise:nth-child(4) {
  animation-delay: 0.24s;
}

@keyframes ph-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ph-fade {
  to {
    opacity: 1;
  }
}

/* ---- Responsive ---- */

@media (max-width: 960px) {
  .ph-search {
    min-width: 0;
    gap: 14px;
  }
}

@media (max-width: 820px) {
  .ph-links,
  .ph-search,
  .ph-ask {
    display: none;
  }

  .ph-menu {
    display: grid;
  }

  .ph-hero {
    min-height: max(100svh, 720px);
  }

  .ph-copy {
    justify-content: flex-start;
    min-height: 0;
    padding-top: clamp(28px, 7svh, 64px);
    padding-bottom: 0;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .ph-wordmark {
    font-size: clamp(56px, 17vw, 72px);
  }

  .ph-tabs {
    font-size: 14px;
    gap: 6px;
  }

  .ph-cmd {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-rise,
  .ph-stage {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
