/* Vellune's page: a grainy orange sky, the app's window fading into a huge wordmark, and one
   line to install it. Everything but the window holds still. */

:root {
  --sky-top: #f9d98a;
  --ink: #2a1304;          /* text on the orange: dark brown, for contrast */
  --glass: rgba(112, 44, 6, 0.42);
  --glass-edge: rgba(255, 255, 255, 0.38);
  --ui: "Satoshi", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Cabinet Grotesk", "Satoshi", "Segoe UI", system-ui, sans-serif;

  /* The app window's width, and where it starts; the wordmark and the rest follow from these. */
  --sw: min(54vw, 820px);
  --st: clamp(44px, 6.5vh, 92px);
}

* { box-sizing: border-box; }

html {
  background: #f4822a;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--ui);
  color: #fff;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Background ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 60% at 50% -6%, rgba(255, 246, 200, 0.85), rgba(255, 246, 200, 0) 62%),
    linear-gradient(180deg, #f9dc8e 0%, #f8c260 20%, #f5993e 50%, #f3822b 78%, #f27a25 100%);
}

.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.34;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- Top bar ---------- */

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 3vw, 34px) 0;
}

.brand svg { display: block; width: 38px; height: 38px; border-radius: 11px; }

.social { display: flex; gap: 10px; color: #0d0d0f; }
.social a { color: inherit; }
.social a { display: block; width: 38px; height: 38px; border-radius: 10px; transition: transform 0.2s ease; }
.social a:hover { transform: translateY(-2px); }
.social svg { display: block; width: 100%; height: 100%; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100svh;
  padding: 0 20px 28px;
  text-align: center;
}

.stage {
  position: absolute;
  top: var(--st);
  left: 50%;
  width: var(--sw);
  aspect-ratio: 1500 / 880;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Three.js draws on a canvas larger than the window, so it can tilt without being cut off. */
#stage-canvas {
  position: absolute;
  inset: -22% -26%;
  width: 152%;
  height: 144%;
  display: block;
  opacity: 0;
}

.stage-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 96%);
}

.stage.is-3d #stage-canvas { opacity: 1; }
.stage.is-3d .stage-fallback { opacity: 0; }

.wordmark {
  position: relative;
  margin: calc(var(--st) + var(--sw) * 0.27) 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: calc(var(--sw) * 0.37);
  line-height: 0.82;
  letter-spacing: -0.045em;
  color: #fff;
  text-transform: lowercase;
  user-select: none;
}

.tagline {
  margin: clamp(2px, 0.4vw, 8px) 0 0;
  max-width: 92vw;
  font-size: clamp(16px, 1.75vw, 22px);
  line-height: 1.4;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 14px rgba(122, 46, 0, 0.38);
}

/* ---------- Linux / Windows ---------- */

.toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(18px, 2.4vw, 30px);
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.toggle button {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  padding: 9px 26px;
  min-width: 104px;
  font: 500 clamp(16px, 1.6vw, 20px) / 1 var(--ui);
  color: #fff;
  cursor: pointer;
  transition: color 0.25s ease;
}

.toggle button[aria-selected="true"] { color: var(--ink); }

.toggle-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(110, 44, 4, 0.25);
  transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
}

.toggle[data-os="windows"] .toggle-thumb { transform: translateX(100%); }

/* ---------- The command ---------- */

.command {
  position: relative;
  width: min(640px, 100%);
  margin-top: clamp(12px, 1.6vw, 18px);
  padding: clamp(20px, 2.6vw, 30px) 58px clamp(20px, 2.6vw, 30px) 24px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.command code {
  display: block;
  font: 500 clamp(15px, 1.55vw, 20px) / 1.45 var(--ui);
  color: #fff;
  overflow-wrap: anywhere;
  user-select: all;
}

.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.copy:hover { background: rgba(255, 255, 255, 0.16); }
.copy svg { width: 22px; height: 22px; grid-area: 1 / 1; transition: opacity 0.2s ease, transform 0.2s ease; }
.copy .icon-done { opacity: 0; transform: scale(0.6); }
.copy.is-done .icon-copy { opacity: 0; transform: scale(0.6); }
.copy.is-done .icon-done { opacity: 1; transform: scale(1); }

.hint {
  min-height: 1.6em;
  margin: 10px 0 0;
  font-size: clamp(14px, 1.3vw, 16px);
  font-weight: 500;
  color: var(--ink);
}

.foot {
  position: relative;
  z-index: 2;
  padding: 0 20px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  opacity: 0.8;
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  :root { --sw: 90vw; --st: 76px; }
  .wordmark { font-size: calc(var(--sw) * 0.34); }
  .command { padding-right: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle-thumb, .social a, .copy svg { transition: none; }
}
