@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital@0;1&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #f1f1f6;
  --ink: #282637;
  --muted: #504d63;
  --line: #cbc9d8;
  --signal: #5c35c1;
  --soft-signal: #e6ddfb;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font: 500 1rem/1.55 Manrope, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 5px; }
::selection { background: var(--soft-signal); color: var(--ink); }
.wrap { width: min(1260px, calc(100% - 112px)); margin-inline: auto; }

.top, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top { min-height: 85px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.12rem; font-weight: 800; text-decoration: none; }
.top nav { display: flex; align-items: center; gap: clamp(.9rem, 2.6vw, 2.1rem); }
.top nav a, .footer > a:last-child { font-size: .85rem; font-weight: 800; text-decoration: none; }
.top nav a:hover, .footer > a:last-child:hover, .text-link:hover { text-decoration: underline; text-underline-offset: .25em; }
.repo-link span { margin-left: .2rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

h1 {
  margin: 0 0 1.35rem;
  max-width: 10ch;
  font: 400 clamp(4.8rem, 7.8vw, 8.25rem)/.91 var(--serif);
  letter-spacing: -.032em;
}
h1 em { color: var(--signal); font-weight: 400; }
.lede { max-width: 39ch; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.17rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.25rem; margin-top: 1.85rem; }
.cta, .text-link { font-size: .88rem; font-weight: 800; }
.cta { display: inline-flex; gap: 1rem; padding: .8rem 1rem; border-radius: 7px; background: var(--ink); color: var(--paper); text-decoration: none; }
.cta:hover { background: #3d3652; }
.text-link { text-decoration: none; }

.map { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #e8e7f0; }
.map-top, .map-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: 1rem 1.25rem; }
.map-top { border-bottom: 1px solid var(--line); }
.map-top h2, .map-bottom h3 { font-size: .88rem; font-weight: 800; }
.map-top span { color: var(--muted); font-size: .74rem; }
.diagram {
  position: relative;
  isolation: isolate;
  width: min(100%, 450px);
  aspect-ratio: 1.22;
  margin-inline: auto;
  background: radial-gradient(circle at center, #c4c1d4 1px, transparent 1.15px) center / 18px 18px;
}
.ring {
  position: absolute;
  inset: 50% auto auto 50%;
  aspect-ratio: 1;
  border: 1px solid #c7c4d8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ring-outer { width: 70%; }
.ring-inner { width: 47%; }
[data-provider="google"] { --x: 21%; --y: 23%; --angle: 217.4deg; }
[data-provider="render"] { --x: 79%; --y: 23%; --angle: -37.4deg; }
[data-provider="aws"] { --x: 21%; --y: 77%; --angle: 142.6deg; }
[data-provider="railway"] { --x: 79%; --y: 77%; --angle: 37.4deg; }

.route {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 36.5%;
  height: 1px;
  background: #a39dbb;
  transform: rotate(var(--angle));
  transform-origin: left center;
}
.route::after {
  position: absolute;
  top: 50%;
  left: 76%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  opacity: 0;
  content: '';
}
.diagram[data-active="google"] .route[data-provider="google"],
.diagram[data-active="render"] .route[data-provider="render"],
.diagram[data-active="aws"] .route[data-provider="aws"],
.diagram[data-active="railway"] .route[data-provider="railway"] {
  height: 2px;
  background: var(--signal);
}
.diagram[data-active="google"] .route[data-provider="google"]::after,
.diagram[data-active="render"] .route[data-provider="render"]::after,
.diagram[data-active="aws"] .route[data-provider="aws"]::after,
.diagram[data-active="railway"] .route[data-provider="railway"]::after {
  opacity: 1;
  animation: signal-in 570ms ease-out both;
}
@keyframes signal-in {
  from { translate: 320% -50%; }
  to { translate: -50% -50%; }
}

.hub, .provider {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .32rem;
  transform: translate(-50%, -50%);
}
.hub {
  inset: 50% auto auto 50%;
  width: clamp(95px, 13vw, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: .82rem;
}
.hub img { border-radius: 11px; }
.provider {
  top: var(--y);
  left: var(--x);
  width: clamp(87px, 8.7vw, 116px);
  min-height: clamp(67px, 7.6vw, 88px);
  padding: .35rem;
  border: 1px solid #b7b3c9;
  border-radius: 12px;
  background: #faf9fe;
  cursor: pointer;
  font-size: clamp(.65rem, 1.04vw, .77rem);
  font-weight: 800;
  transition: translate 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.provider img { max-width: 100%; height: auto; max-height: 38px; object-fit: contain; }
.provider:hover, .provider:focus-visible { translate: 0 -4px; }
.provider[aria-pressed="true"] { border-color: var(--signal); background: #f6efff; }
.map-bottom { align-items: center; min-height: 95px; border-top: 1px solid var(--line); background: #f7f6fb; }
.map-bottom p { margin-top: .2rem; color: var(--muted); font-size: .8rem; }
#provider-link {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  flex: none;
  min-height: 42px;
  padding-inline: .65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: .75rem;
  font-weight: 800;
  text-decoration: none;
}
#provider-link:hover { border-color: var(--signal); color: var(--signal); }

.workflow { padding-block: 1px; border-block: 1px solid var(--line); background: #e6e5ef; }
.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  padding-block: clamp(2.75rem, 6vw, 6rem);
}
.workflow h2 { font: 400 clamp(3rem, 5.8vw, 5.4rem)/.94 var(--serif); letter-spacing: -.023em; text-wrap: balance; }
.workflow-intro { max-width: 45ch; margin-top: .9rem; color: var(--muted); }
.steps { margin: 1.5rem 0 0; padding-left: 1.3rem; font-size: .9rem; }
.steps li { padding-left: .3rem; margin-bottom: .65rem; }
.steps li::marker { color: var(--signal); font-weight: 800; }

.terminal {
  min-width: 0;
  background: #282637;
  color: #f4f0ff;
  border-radius: 14px;
  overflow: hidden;
  scroll-margin-top: 1rem;
}
.terminal :focus-visible { outline-color: #d4bdff; }
.terminal-top, .command-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.terminal-top { padding: .9rem 1.15rem; border-bottom: 1px solid #59536b; }
.terminal-top h3 { font-size: .87rem; }
.terminal-top > span { color: #d0cadd; font-size: .73rem; }
.terminal-body { padding: 1.15rem; }
.command-row { align-items: start; justify-content: start; border-radius: 8px; background: #1d1a2b; padding: .7rem; }
.command-row code, .terminal pre, .prompt { font: 400 .81rem/1.65 var(--mono); }
.command-row code { overflow-wrap: anywhere; user-select: all; }
.prompt, .terminal-active { color: #d4bdff; }
#copy-command { border: 1px solid #867d9b; border-radius: 5px; background: transparent; color: #f4f0ff; cursor: pointer; font-size: .72rem; padding: .25rem .4rem; }
#copy-command:hover { background: #3d3652; }
.copy-status { min-height: 1.1rem; margin-top: .2rem; color: #d0cadd; font-size: .74rem; }
.terminal pre { margin: .2rem 0 0; white-space: pre-wrap; }
.terminal-heading { color: #efe4ff; font-weight: 700; }
.terminal-link { display: block; padding: .8rem 1.15rem; border-top: 1px solid #59536b; font-size: .81rem; font-weight: 800; text-decoration: none; }
.terminal-link:hover { background: #3d3652; }
.footer { min-height: 80px; }

@media (max-width: 1050px) {
  .wrap { width: calc(100% - 64px); }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .top { min-height: 68px; }
  .hero, .workflow-grid { grid-template-columns: 1fr; }
  .hero { gap: 2rem; }
  h1 { font-size: clamp(3.8rem, 13vw, 6rem); }
  .map { width: min(100%, 520px); }
}

@media (max-width: 370px) {
  .map-top, .map-bottom { padding-inline: .75rem; }
  .hub { width: 84px; }
  .hub img { width: 43px; height: 43px; }
  .provider { width: 78px; min-height: 60px; }
  .provider img { max-height: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
