/* The home view's side column (public/home-rail.js): three cards beside the composer on a wide screen, and a row
   under the projects below that. Flat cards in the dashboard's own tones; the pen blue marks what's live. */

.view-home { grid-template-columns: minmax(0, 1fr); align-items: start; }
.home-main { display: grid; justify-items: center; width: 100%; min-width: 0; }

.home-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; width: 100%; max-width: 1040px; margin: 48px auto 0; justify-self: center; }
@media (min-width: 1360px) {
  .view-home { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 28px; }
  .home-rail { grid-template-columns: minmax(0, 1fr); max-width: none; margin: 0; position: sticky; top: 20px; }
}

.rail-card { position: relative; display: grid; gap: 12px; align-content: start; min-width: 0; padding: 18px; border-radius: var(--r-card); background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: inset 0 0 0 1px var(--hair), var(--edge); }
.rail-card h2 { margin: 0; font-size: 16.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.rail-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.rail-note:empty { display: none; }
.rail-head { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.rail-head .ic { color: var(--muted); }
.rail-head h2 { flex: 1; min-width: 0; }
.rail-range { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* the editor card: the three windows, still, and every few seconds collapsing into one and opening again. Both
   are transparent, and the video's first and last frames are the still, so the swap doesn't show */
.rail-editor { grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 14px; container: railed / inline-size; }
/* a narrow card puts the windows above the words, so the button always has room for its label on one line */
@container railed (max-width: 289px) {
  .rail-art, .rail-copy { grid-column: 1 / -1; }
  .rail-art { width: 100%; max-width: 300px; margin: 0; justify-self: center; }
}
.rail-copy { display: grid; gap: 8px; justify-items: start; }
.rail-copy p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.rail-art { position: relative; aspect-ratio: 4 / 3; margin: -6px 0 -6px -6px; }
.rail-img, .rail-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.rail-img[hidden], .rail-vid[hidden] { display: none; }

/* flat buttons: one fill, a ring on hover, a little smaller on press */
.rail-btn { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 14px; border-radius: var(--r-control); font-size: 13.3px; font-weight: 600; color: var(--text); background: var(--btn2-face); -webkit-backdrop-filter: var(--btn-glass); backdrop-filter: var(--btn-glass); box-shadow: var(--btn2-ring); text-decoration: none;
  transition: box-shadow var(--t-1) var(--ease), scale var(--t-1) var(--ease); }
.rail-btn .ic, .rail-link .ic { width: 15px; height: 15px; }
.rail-btn:hover { box-shadow: var(--btn2-ring-hover); }
.rail-btn:active { scale: .97; }
.rail-link { display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 32px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.rail-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail-link[hidden] { display: none; }
.rail-btn:focus-visible, .rail-link:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Business Brain: three numbers, then visitors by day */
.brain-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.brain-stats > div { display: grid; gap: 3px; min-width: 0; padding: 0 12px; border-left: 1px solid var(--line); }
.brain-stats > div:first-child { padding-left: 0; border-left: 0; }
.brain-stats dt { font-size: 12px; color: var(--muted); }
.brain-stats dd { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.brain-ch { min-height: 16px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.brain-ch[data-dir="up"] { color: var(--ok); }
.brain-ch[data-dir="down"] { color: var(--danger); }
.brain-ch[data-dir="flat"] { color: var(--muted); }
.brain-bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.brain-bars i { flex: 1; min-height: 3px; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--pen) 30%, transparent); }
.brain-bars i:last-child { background: var(--pen); }
.brain-bars[data-empty] i { background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .brain-bars i { transform-origin: bottom; animation: bar-up 520ms var(--ease-reveal) both; animation-delay: calc(var(--i) * 12ms); }
  @keyframes bar-up { from { scale: 1 0; } }
}

/* Growth Autopilot: the switch turns every automation on or off; the list says what each one is doing. Its art sits
   beside what the automations are doing, like the editor card's, and goes above it in a narrow card */
.auto-intro { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; container: autoin / inline-size; }
.auto-intro .rail-art { margin: -6px 0 -6px -6px; }
@container autoin (max-width: 259px) {
  .auto-intro > * { grid-column: 1 / -1; }
  .auto-intro .rail-art { width: 100%; max-width: 240px; margin: 0; justify-self: center; }
}
.auto-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.auto-list:empty { display: none; }
.auto-list li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--body); }
.auto-list li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; translate: 0 -1px; background: var(--muted); }
.auto-list li[data-on]::before { background: var(--ok); }
.auto-list small { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sr-switch:disabled { opacity: .45; cursor: default; }

/* Pro, offered to an account below it (public/home-rail.js): a glow rising from the card's bottom edge with stars
   and bits of code drifting through it, an example revenue chart, and one button. The glow is the pen blue into the
   dashboard's violet; the line is --ok, the colour every "up" figure here uses. */
.rail-auto { --sky-glow: color-mix(in srgb, var(--pen) 58%, transparent); --sky-glow-2: color-mix(in srgb, #8b5cf6 22%, transparent); --sky-star: #d6e4ff; --sky-code: color-mix(in srgb, var(--pen) 65%, #ffffff); }
:root[data-theme="light"] .rail-auto { --sky-glow: color-mix(in srgb, var(--pen) 28%, transparent); --sky-glow-2: color-mix(in srgb, #8b5cf6 12%, transparent); --sky-star: var(--pen); --sky-code: var(--pen); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .rail-auto { --sky-glow: color-mix(in srgb, var(--pen) 28%, transparent); --sky-glow-2: color-mix(in srgb, #8b5cf6 12%, transparent); --sky-star: var(--pen); --sky-code: var(--pen); } }
.rail-auto[data-pro] { overflow: hidden; isolation: isolate; }
.rail-auto[data-pro] > :not(.auto-sky) { position: relative; z-index: 1; }
.auto-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(140% 58% at 50% 108%, var(--sky-glow), var(--sky-glow-2) 46%, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 92%); mask-image: linear-gradient(to top, #000 35%, transparent 92%); }
.auto-sky[hidden] { display: none; }
.auto-sky .st { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; background: var(--sky-star); opacity: .45; }
.auto-sky .cg { position: absolute; left: var(--x); bottom: 8px; font: 500 11px/1 var(--mono); color: var(--sky-code); white-space: nowrap; opacity: .3; translate: 0 calc(var(--r, 40) * -1px); }
@media (prefers-reduced-motion: no-preference) {
  .auto-sky .st { animation: sky-star var(--d) ease-in-out var(--dl) infinite; }
  .auto-sky .cg { opacity: 0; animation: sky-code var(--d) linear var(--dl) infinite; }
  .auto-sky[data-still] :is(.st, .cg) { animation-play-state: paused; }
  @keyframes sky-star { 0%, 100% { opacity: .12; translate: 0 0; } 50% { opacity: .8; translate: -5px -7px; } }
  @keyframes sky-code { 0% { opacity: 0; translate: 0 10px; } 18% { opacity: .38; } 75% { opacity: .18; } 100% { opacity: 0; translate: 0 -230px; } }
}
/* Settings › Accessibility › Motion = Reduce stops every animation (base.css): the code rests where it is, as above */
:root[data-motion="reduce"] .auto-sky .cg { opacity: .3; animation: none; }
:root[data-motion="reduce"] .auto-sky .st { animation: none; }

.auto-pro { display: grid; gap: 12px; }
.auto-pro[hidden] { display: none; }
.auto-chart { display: grid; gap: 4px; margin: 2px 0 0; }
.auto-fig { margin: 0; font-size: 13px; color: var(--body); }
.auto-fig b { margin-right: 2px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.auto-chart svg { display: block; width: 100%; height: auto; overflow: visible; color: var(--ok); }
.auto-grid { fill: none; stroke: var(--line); stroke-dasharray: 2 4; }
.auto-area { fill: url(#auto-fill); }
.auto-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auto-dot { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.auto-chart figcaption { font-size: 12px; color: var(--body); }
.auto-price { margin: 0; font-size: 13px; line-height: 1.45; color: var(--body); }

/* the house primary button: one face, a ring on hover, a little smaller on press; it never lifts */
.auto-get { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-control); font: inherit; font-size: 14px; font-weight: 500; color: var(--btn-main-text); background: var(--btn-main); box-shadow: none; cursor: pointer;
  transition: background-color var(--t-1) var(--ease), scale var(--t-1) var(--ease); }
.auto-get:not(:disabled):hover { background: var(--btn-main-hover); }
.auto-get .ic { width: 16px; height: 16px; }
.auto-get:hover { box-shadow: var(--btn1-ring-hover); }
.auto-get:active { scale: .97; }
.auto-get:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

@media (max-width: 420px) {
  .rail-editor { grid-template-columns: minmax(0, 1fr); }
  .rail-art { margin: 0; max-width: 320px; width: 100%; justify-self: center; }
}

/* "Example" on a card that shows an example instead of the account's own numbers (the YC demo, home-rail.js example) */
.rail-ex { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; color: var(--text); background: var(--raised); white-space: nowrap; }
