/* ==========================================================================
   Gradien homepage — Core-led positioning (new-positioning branch)
   Builds on tokens + shared components in design-system.css / shared-v4.css.
   ========================================================================== */

/* ---------- Hero ---------- */
.home-hero { padding-top: clamp(56px, 8vw, 96px); text-align: center; }
.home-hero__inner { display: flex; flex-direction: column; align-items: center; max-width: 760px; margin-inline: auto; }
.home-hero__eyebrow { margin-bottom: var(--space-2); }
.home-hero__title {
  font-size: var(--text-h1);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  max-width: 18ch;
  margin: 0 0 var(--space-3);
}
.home-hero__lead { font-size: var(--text-lead); color: var(--text-secondary); line-height: var(--leading-snug); max-width: 56ch; margin: 0 0 var(--space-4); }
.home-hero__ctas { display: flex; justify-content: center; }
.home-hero__trial { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-tertiary); }
.home-hero__stagewrap { margin-top: var(--space-7); }

/* ---------- Generic section rhythm reused across the story sections ---------- */
.home-continue__bridge,
.home-compound__statement,
.home-team__statement {
  text-align: center;
  font-size: var(--text-h3);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-6) auto 0;
  max-width: 32ch;
}

/* ---------- Continue where the work left off ---------- */
.home-continue__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-6); align-items: center; margin-top: var(--space-6); }
.home-continue__scenes { position: relative; }
.home-continue__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); counter-reset: step; }
.home-continue__steps li { display: flex; gap: var(--space-3); align-items: flex-start; opacity: 0.35; transition: opacity var(--duration-slow) var(--ease-out); }
.home-continue__steps li.is-on, .home-continue__steps li.is-now { opacity: 1; }
.home-continue__stepnum { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--signal-blue-ink); flex: none; padding-top: 4px; }
.home-continue__steps strong { display: block; font-size: var(--text-body-lg); margin-bottom: 4px; }
.home-continue__steps p { margin: 0; color: var(--text-secondary); max-width: 62ch; }
.home-continue__steps .gr-status { margin-top: var(--space-1); display: inline-flex; }
.home-continue__visual { min-width: 0; }
.home-continue__stage.gr-macstage { aspect-ratio: 4 / 3; }

/* ---------- One home for the context AI actually needs ---------- */
.home-context__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--space-6); align-items: center; }
.home-context__copy .kit-head__title { margin-bottom: var(--space-2); }
.home-context__visual { min-width: 0; }

/* ---------- Integration orbit (One home for the context AI actually needs) ---------- */
.home-context__orbit {
  position: relative;
  width: 100%;
  max-width: 29rem;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.home-context__orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--radius-pill);
  background: var(--surface-page);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.home-context__orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--radius) * 2);
  height: calc(var(--radius) * 2);
  border: 1px dashed var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  /* Each ring's box is a full square even though only its circular border
     paints - without this, ring--3 (largest, last in DOM order, painted on
     top) blocks every hover/click meant for ring--1 and --2's icons. */
  pointer-events: none;
}
.home-context__orbit-ring--1 { --radius: 6.75rem; }
.home-context__orbit-ring--2 { --radius: 9.75rem; }
.home-context__orbit-ring--3 { --radius: 12.75rem; }
.home-context__orbit-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--angle)) translateX(var(--radius));
}
.home-context__orbit-icon-spin {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle)));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  background: var(--surface-page);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.home-context__orbit-icon-spin img { width: 1.25rem; height: 1.25rem; object-fit: contain; transition: width var(--duration-panel) var(--ease-out-quart), height var(--duration-panel) var(--ease-out-quart); }
.home-context__orbit-caption { margin: var(--space-4) 0 0; text-align: center; font-size: var(--text-sm); color: var(--text-tertiary); }

/* Hover: pause only the ring the hovered icon belongs to (the other rings
   keep spinning), enlarge that icon's chip, and reveal its name label
   directly underneath it. Scoping :has() to .home-context__orbit-ring
   itself (rather than the whole .home-context__orbit) means only the ring
   containing the hovered icon matches - the other two rings are untouched. */
.home-context__orbit-icon-spin {
  cursor: default;
  pointer-events: auto;
  transition: width var(--duration-panel) var(--ease-out-quart), height var(--duration-panel) var(--ease-out-quart), box-shadow var(--duration-panel) var(--ease-out-quart);
}
.home-context__orbit-icon-spin:hover {
  width: 3rem;
  height: 3rem;
  box-shadow: var(--shadow-md);
  z-index: 3;
}
.home-context__orbit-icon-spin:hover img { width: 1.5rem; height: 1.5rem; }
.home-context__orbit-ring:has(.home-context__orbit-icon-spin:hover),
.home-context__orbit-ring:has(.home-context__orbit-icon-spin:hover) .home-context__orbit-icon-spin {
  animation-play-state: paused;
}
.home-context__orbit-icon-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
  z-index: 4;
}
.home-context__orbit-icon-spin:hover .home-context__orbit-icon-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes gr-orbit-spin-cw {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes gr-orbit-spin-ccw {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}
@keyframes gr-orbit-counter-cw {
  from { transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))); }
  to { transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle) - 360deg)); }
}
@keyframes gr-orbit-counter-ccw {
  from { transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))); }
  to { transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle) + 360deg)); }
}

@media (prefers-reduced-motion: no-preference) {
  .home-context__orbit-ring--1 { animation: gr-orbit-spin-cw 26s linear infinite; }
  .home-context__orbit-ring--2 { animation: gr-orbit-spin-ccw 38s linear infinite; }
  .home-context__orbit-ring--3 { animation: gr-orbit-spin-cw 50s linear infinite; }
  .home-context__orbit-ring--1 .home-context__orbit-icon-spin { animation: gr-orbit-counter-cw 26s linear infinite; }
  .home-context__orbit-ring--2 .home-context__orbit-icon-spin { animation: gr-orbit-counter-ccw 38s linear infinite; }
  .home-context__orbit-ring--3 .home-context__orbit-icon-spin { animation: gr-orbit-counter-cw 50s linear infinite; }
}

/* ---------- The next run starts further ahead ---------- */
.home-compound__runs { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-4); align-items: start; margin-top: var(--space-6); }
.home-compound__run .gr-eyebrow { display: block; margin-bottom: var(--space-2); }
.home-compound__window .gr-window__body { display: flex; flex-direction: column; gap: var(--space-2); }
.home-compound__prompt { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-body); margin: 0; }
.home-compound__prompt--short { font-size: var(--text-body-lg); color: var(--text-primary); font-weight: var(--weight-medium); }
.home-compound__note { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.home-compound__run--later .home-compound__window { box-shadow: var(--shadow-md); }
.home-compound__timeline { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.home-compound__timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.home-compound__timeline-dot.is-active { background: var(--signal-blue); }
.home-compound__timeline-line { width: 1px; flex: 1; background: var(--border-subtle); min-height: 60px; }

/* ---------- The work carries across your team ---------- */
.home-team__flow { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.home-team__card { border-top: 3px solid var(--border-strong); }
.home-team__card--chatgpt { border-top-color: #10a37f; }
.home-team__card--claude { border-top-color: #d97757; }
.home-team__card--codex { border-top-color: #6366f1; }
.home-team__card .gr-scenecard__bar { display: flex; justify-content: space-between; align-items: center; }
.home-team__card .gr-scenecard__name { display: inline-flex; align-items: center; gap: 6px; }
.home-team__card .gr-scenecard__name img, .home-team__card .gr-scenecard__name svg { flex: none; opacity: 0.85; }
.home-team__card .gr-src, .home-team__card .gr-status { margin-top: var(--space-1); display: inline-flex; }

/* ---------- Your tools can change ---------- */
.home-ownership.kit-section--dark .kit-head__title,
.home-ownership.kit-section--dark .kit-head__lead { color: var(--text-inverse); }
.home-ownership.kit-section--dark .kit-head__lead { color: var(--text-inverse-secondary); }
.home-ownership__flow { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin: var(--space-6) auto 0; max-width: 900px; }

.home-ownership__integrations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: none; }
.home-ownership__integrations li { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--text-inverse-secondary); }
.home-ownership__integrations li img { width: 26px; height: 26px; padding: 5px; box-sizing: border-box; border-radius: 50%; background: var(--white); flex: none; }

.home-ownership__arrow { position: relative; width: clamp(28px, 4vw, 56px); height: 2px; background: var(--border-inverse-strong); flex: none; }
.home-ownership__arrow::before {
  content: '';
  position: absolute;
  top: 50%; left: 0;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--signal-blue);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--signal-blue) 55%, transparent);
  opacity: 0;
  animation: home-ownership-flow 2.4s linear infinite;
}
.home-ownership__arrow:nth-of-type(2)::before { animation-delay: 1.2s; }
@keyframes home-ownership-flow {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.home-ownership__core {
  flex: none;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid var(--border-inverse-strong);
  background: rgba(255,255,255,0.05);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
}
.home-ownership__core-id { display: flex; align-items: center; gap: 8px; color: var(--white); font-size: var(--text-body); font-weight: var(--weight-medium); }
.home-ownership__core-contains { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.home-ownership__core-contains li {
  font-size: var(--text-xs);
  color: var(--text-inverse-secondary);
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  text-align: center;
}

.home-ownership__surface { position: relative; flex: none; width: 150px; height: 50px; }
.home-ownership__surface-frame {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-inverse-secondary);
  font-size: var(--text-sm);
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}
.home-ownership__surface-frame.is-active { opacity: 1; }
.home-ownership__surface-frame img, .home-ownership__surface-frame svg {
  width: 32px; height: 32px; padding: 6px; box-sizing: border-box; border-radius: 50%; background: var(--white); flex: none; color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .home-ownership__arrow::before { animation: none; opacity: 0.7; left: 50%; }
}
.home-ownership__points { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-6); }
.home-ownership__points strong { display: block; color: var(--white); margin-bottom: 6px; }
.home-ownership__points p { margin: 0; color: var(--text-inverse-secondary); font-size: var(--text-sm); }

/* ---------- Pricing ---------- */
.home-pricing__toggle { position: relative; display: flex; justify-content: center; gap: 4px; width: fit-content; margin: var(--space-6) auto 0; padding: 4px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); background: var(--surface-subtle); }
.home-pricing__toggle-slider { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); width: 0; border-radius: var(--radius-pill); background: var(--ink); transition: transform var(--duration-panel) var(--ease-out-quart), width var(--duration-panel) var(--ease-out-quart); z-index: 0; }
.home-pricing__toggle-btn { position: relative; z-index: 1; appearance: none; border: 0; background: transparent; border-radius: var(--radius-pill); padding: 8px 22px; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); cursor: pointer; transition: color var(--duration-panel) var(--ease-out-quart); }
.home-pricing__toggle-btn.is-active { color: var(--white); }
@media (prefers-reduced-motion: reduce) {
  .home-pricing__toggle-slider { transition: none; }
}
.home-pricing__plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); max-width: 880px; margin: var(--space-4) auto 0; }
.home-pricing__plan {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 340px;
  border-radius: var(--radius-xl);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.home-pricing__plan:hover, .home-pricing__plan:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.home-pricing__plan::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(10,8,6,0.35) 0%, rgba(10,8,6,0.55) 45%, rgba(6,5,4,0.94) 100%);
  transition: background var(--duration-base) var(--ease-out);
}
.home-pricing__plan:hover::before, .home-pricing__plan:focus-within::before {
  background: linear-gradient(180deg, rgba(10,8,6,0.45) 0%, rgba(10,8,6,0.62) 45%, rgba(6,5,4,0.96) 100%);
}
.home-pricing__plan-body { position: relative; z-index: 1; padding: var(--space-5); text-align: left; }
.home-pricing__eyebrow { font-size: var(--text-body-lg); color: rgba(255,255,255,0.82); }
.home-pricing__price { color: var(--white); font-size: var(--text-h2); font-weight: var(--weight-medium); margin: var(--space-2) 0 0; }
.home-pricing__price-amount { font-variant-numeric: tabular-nums; }
.home-pricing__price-unit { display: block; font-size: var(--text-body); font-weight: var(--weight-regular); color: rgba(255,255,255,0.7); margin-top: 2px; }
.home-pricing__desc { margin-top: var(--space-3); color: rgba(255,255,255,0.85); font-size: var(--text-body); max-width: 38ch; }
.home-pricing__cta { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); margin-top: var(--space-6); }

@media (max-width: 900px) {
  .home-continue__grid { grid-template-columns: 1fr; }
  .home-context__grid { grid-template-columns: 1fr; }
  .home-context__orbit-ring--1 { --radius: 5rem; }
  .home-context__orbit-ring--2 { --radius: 7.25rem; }
  .home-context__orbit-ring--3 { --radius: 9.5rem; }
  .home-compound__runs { grid-template-columns: 1fr; }
  .home-compound__timeline { flex-direction: row; width: 100%; }
  .home-compound__timeline-line { width: auto; height: 1px; flex: 1; min-height: 0; }
  .home-team__flow { grid-template-columns: 1fr; }
  .home-ownership__points { grid-template-columns: 1fr; text-align: center; }
  .home-pricing__plans { grid-template-columns: 1fr; max-width: 420px; }
}

@media (max-width: 640px) {
  .home-hero__title { max-width: 14ch; }
  .home-context__orbit-ring--1 { --radius: 3.75rem; }
  .home-context__orbit-ring--2 { --radius: 5.5rem; }
  .home-context__orbit-ring--3 { --radius: 7.25rem; }
  .home-context__orbit-core { width: 3.5rem; height: 3.5rem; }
  .home-context__orbit-icon-spin { width: 2rem; height: 2rem; }
  .home-context__orbit-icon-spin img { width: 1rem; height: 1rem; }
  .home-context__orbit-icon-label { display: none; }
}

@media (max-width: 700px) {
  .home-ownership__flow { flex-direction: column; }
  .home-ownership__integrations { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 260px; }
  .home-ownership__arrow { width: 2px; height: 32px; }
  .home-ownership__arrow::before { top: 0; left: 50%; margin-top: 0; margin-left: -3px; animation-name: home-ownership-flow-vertical; }
  .home-ownership__core { width: 180px; height: 180px; }
}
@keyframes home-ownership-flow-vertical {
  0% { top: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
