html, body { margin: 0; min-height: 100%; }
.sails-tld { opacity: 0.8; }
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
::view-transition-group(*) {
  z-index: 1;
  animation-duration: 560ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-group(root) {
  z-index: 0;
  animation-duration: 240ms;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
}
html:active-view-transition .wall > li,
html.no-stagger .wall > li {
  opacity: 1;
  transform: none;
  animation: none;
}
:root {
  --ink: #0f172a;
  --muted: #475569;
  --canvas: #f1f5f9;
  --line: rgb(15 23 42 / 0.08);
  --text: #1e293b;
  --nav-bg: #f1f5f9;
  --nav-link: #64748b;
  --nav-on: #0f172a;
  --panel: #fff;
  --field: #fff;
  --field-line: rgb(15 23 42 / 0.14);
  --code: #f1f5f9;
  --prompt: #f8fafc;
  --btn: #0f172a;
  --btn-ink: #fff;
  --link: #0f172a;
  --soft: #64748b;
  --soft-off: #cbd5e1;
  --close: #0f172a;
  --display: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #94a3b8;
  --canvas: #030712;
  --line: rgb(248 250 252 / 0.1);
  --text: #e2e8f0;
  --nav-bg: #030712;
  --nav-link: #94a3b8;
  --nav-on: #f8fafc;
  --panel: #0d1116;
  --field: #0d1116;
  --field-line: rgb(248 250 252 / 0.14);
  --code: #0d1116;
  --prompt: #0d1116;
  --btn: #f8fafc;
  --btn-ink: #030712;
  --link: #f8fafc;
  --soft: #94a3b8;
  --soft-off: #334155;
  --close: #030712;
  color-scheme: dark;
}
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.wordmark .mark {
  display: inline-flex;
  width: 1.55em;
  height: 1.26em;
  flex: 0 0 auto;
}
.wordmark .mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.nav-links { display: flex; gap: 1.1rem; }
.nav-links a {
  color: var(--nav-link);
  text-decoration: none;
  font-weight: 550;
}
.nav-links a:hover, .nav-links a.on { color: var(--nav-on); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
}
.theme-toggle:active { background: var(--line); }
.theme-toggle svg { display: block; width: 1.15rem; height: 1.15rem; }
html[data-theme="light"] .theme-toggle .icon-sun,
html:not([data-theme]) .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.page { max-width: 72rem; margin: 0 auto; padding: 2.25rem 1.25rem 4rem; }
.page-creation,
.page-home { max-width: none; padding: 0; }

.nav-home .site-nav,
.nav-creation .site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: transparent;
  border-bottom: 0;
}
.nav-home .site-nav::before,
.nav-creation .site-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7.5rem;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.52), rgb(0 0 0 / 0.18) 42%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  mask-image: linear-gradient(to bottom, #000 38%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 38%, transparent);
}
.nav-home .wordmark,
.nav-home .nav-links a,
.nav-creation .wordmark,
.nav-creation .nav-links a { color: #fff; }
.nav-home .nav-links a.on,
.nav-creation .nav-links a.on { color: #fff; }
.hero-frame {
  min-height: 100dvh;
  padding-bottom: 140px;
}
.hero {
  position: sticky;
  top: 0;
  display: block;
  height: 100dvh;
  min-height: 28rem;
  border-radius: var(--hero-inset, 0px);
  transform: translateY(var(--hero-y, 0px)) scale(var(--hero-scale, 1));
  transform-origin: center center;
  will-change: transform;
  background: #111;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.hero iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
  pointer-events: none;
}
.hero-play iframe { pointer-events: auto; }
.hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 9rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.55));
  pointer-events: none;
}
.hero-meta {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 1;
}
.hero-meta strong { display: block; font-size: 1.25rem; font-weight: 650; }
.hero-meta span { color: rgb(255 255 255 / 0.85); }
.home-intro,
.piece-details {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 4rem;
}
.home-intro {
  padding: 4.5rem 1.25rem 3.5rem;
}
.home-intro h1 {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.home-intro .lead {
  margin-top: 1.15rem;
  max-width: 26rem;
  font-size: 1.15rem;
  line-height: 1.45;
}
.home-intro .about { max-width: 26rem; }
.home-intro .actions { margin-top: 1.6rem; align-items: center; }
.home-intro .actions .btn {
  margin-top: 0;
  background: var(--btn);
  color: var(--btn-ink);
}
.home-band {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  border-top: 1px solid var(--line);
}
.home-band h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-transform: none;
  color: var(--ink);
  text-wrap: balance;
}
.home-how-head { max-width: 36rem; }
.home-how-lead {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.home-features {
  display: grid;
  gap: 0;
  margin: 2.25rem 0 0;
  padding: 0;
}
.home-features > div {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 800px) {
  .home-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-features > div {
    padding: 0 1.75rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .home-features > div:first-child {
    padding-left: 0;
    border-left: 0;
  }
}
.home-features dt {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-features dt span {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1;
  color: var(--soft);
}
.home-features dd {
  margin: 0.45rem 0 0;
  color: var(--muted);
  text-wrap: pretty;
}
.home-close {
  background: var(--close);
  color: #fff;
  text-align: center;
  padding: 5rem 1.25rem 5.25rem;
}
.home-close-inner { max-width: 34rem; margin: 0 auto; }
.home-close-marks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  color: #fff;
}
.home-close-mark {
  display: inline-flex;
}
.home-close-mark.is-cc {
  width: 2.6rem;
  height: 2.1rem;
}
.home-close-mark.is-sails {
  width: 2.35rem;
  height: 2.35rem;
}
.home-close-plus {
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  color: rgb(255 255 255 / 0.5);
}
.home-close-mark svg { display: block; width: 100%; height: 100%; }
.home-close h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.15rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-transform: none;
  color: #fff;
  text-wrap: balance;
}
.home-close p {
  margin: 0.75rem auto 0;
  color: rgb(255 255 255 / 0.72);
  max-width: 28rem;
  font-size: 1.05rem;
}
.home-close .actions {
  justify-content: center;
  align-items: center;
  margin-top: 1.6rem;
}
.home-close .actions .btn {
  margin-top: 0;
  background: #fff;
  color: #030712;
  text-decoration: none;
}
.home-close .actions .btn:active { background: #e2e8f0; }
.home-close .actions a:not(.btn) { color: #fff; }

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.lead { margin: 0.55rem 0 0; color: var(--muted); max-width: 32rem; }
.about { margin: 1.1rem 0 0; color: var(--muted); max-width: 32rem; }
.actions { display: flex; gap: 1rem; margin: 1.25rem 0 0; }
.actions a { font-weight: 550; color: var(--link); }

h2 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}

.feature { margin: 2rem 0 0; }
.feature .frame { max-width: 36rem; }

.wall {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.25rem;
}
.wall > li {
  opacity: 0;
  transform: translateY(14px);
  animation: tile-in 0.45s ease forwards;
  animation-delay: calc(var(--i, 0) * 75ms);
}
@keyframes tile-in {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wall > li {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
.tile {
  display: block;
  min-width: 0;
  text-decoration: none;
  perspective: 900px;
  transition: transform 0.12s ease;
}
.tile:active {
  transform: scale(0.99);
}
.frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.12);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}
.frame.is-tilt {
  transition: none;
  box-shadow:
    inset 0 0 0 1px rgb(15 23 42 / 0.12),
    0 18px 36px rgb(15 23 42 / 0.18),
    0 6px 12px rgb(15 23 42 / 0.08);
}
.frame-shine {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--shine-x, 50%) var(--shine-y, 50%),
    rgb(255 255 255 / 0.26),
    rgb(255 255 255 / 0.04) 28%,
    transparent 55%
  );
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.25s ease;
}
.frame.is-tilt .frame-shine { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tile { perspective: none; }
  .frame,
  .frame.is-tilt {
    transform: none !important;
    transition: none;
    box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.12);
  }
  .frame-shine { display: none; }
}
.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
  pointer-events: none;
}
.frame-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.55rem 0.15rem 0;
  font-size: 0.95rem;
}
.meta strong { font-weight: 600; }
.meta span { color: var(--soft); }
.empty { margin: 1.5rem 0 0; color: var(--soft); }
.pages {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 2rem 0 0;
  color: var(--soft);
}
.pages a {
  font-weight: 550;
  color: var(--link);
  text-decoration: none;
}
.pages a:hover { color: var(--muted); }
.pages .off { color: var(--soft-off); }

form { display: grid; gap: 0.75rem; margin-top: 0.85rem; max-width: 22rem; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 550; }
input, select, textarea {
  font: inherit;
  color: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--field);
}
textarea { min-height: 4.5rem; resize: vertical; }
button {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border: 0;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-ink);
  cursor: pointer;
}
button:active { filter: brightness(0.92); }
.hint { margin: 0; color: var(--soft); font-size: 0.9rem; font-weight: 400; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--link); font-weight: 550; }

.viewer {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 3.25rem);
}
.chrome {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
}
.chrome h1 { font-size: 1.15rem; }
.chrome p { margin: 0.15rem 0 0; color: var(--soft); font-size: 0.95rem; }
.chrome a { font-weight: 550; color: var(--link); white-space: nowrap; }
.stage {
  flex: 1;
  min-height: 24rem;
  background: #111;
}
.stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100dvh - 7.5rem);
  border: 0;
  background: #111;
}

.page-create { max-width: 56rem; }
.create-head { margin-bottom: 1.75rem; }
.create-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 800px) {
  .create-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.panel .step {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--soft);
}
.panel h2 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--ink);
}
.panel p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}
.panel form { max-width: none; }
.btn {
  display: inline-flex;
  align-items: center;
  margin-top: 1.1rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
}
.btn:active { filter: brightness(0.92); }
.code {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--code);
  font-size: 0.78rem;
  overflow-x: auto;
  color: var(--ink);
}
.prompt-box {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem 1.15rem 1.1rem;
  border-radius: 12px;
  background: var(--prompt);
  box-shadow: inset 0 0 0 1px var(--line);
}
.prompt-text p {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.55;
  letter-spacing: -0.02em;
}
.prompt-text p + p { margin-top: 0.85rem; }
.prompt-text p:first-child {
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.prompt-box .btn {
  align-self: flex-end;
  margin-top: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
}
