/* The site's own stylesheet. It covers the server-rendered pages only; the
   editor ships its own CSS with its bundle. The custom properties are the ones
   the React app already used, so the two halves of the site look like one. */

:root {
  --color-background: #f4f4f0;
  --color-dark: #0b0d0f;
  --color-primary: #bbd0d0;
  --color-error: #d04040;
  --color-ok: #2b7a4b;
  --color-link: #1877f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 18px;
  line-height: 1.6666;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-link);
}

/* Header ------------------------------------------------------------------ */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 1em;
  background-color: var(--color-dark);
}

.wordmark {
  font-family: 'Monoton', cursive;
  font-weight: 400;
  font-size: 2.5em;
  line-height: 1;
  margin: 0;
}

.wordmark a {
  color: #fff;
  text-decoration: none;
}

.byline {
  color: #bbb;
  font-family: 'Rokkitt', serif;
  font-size: 1.1em;
  line-height: 1.2;
}

.byline a {
  color: var(--color-primary);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a,
.menu button {
  color: #fff;
  text-decoration: none;
}

.menu a:hover,
.menu button:hover {
  text-decoration: underline;
}

.menu button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* The admin looking in as somebody else: loud, so it is never forgotten. */
.impersonating {
  padding: 0.25em 1em;
  background-color: var(--color-error);
  color: white;
}

.impersonating form {
  margin: 0;
}

.impersonating button.linkish {
  color: white;
  text-decoration: underline;
}

.crumbs {
  padding: 0 1em;
  background-color: var(--color-primary);
}

.crumbs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs a {
  color: var(--color-dark);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

/* Body -------------------------------------------------------------------- */

.appbody {
  padding: 1em;
}

.prose {
  max-width: 44em;
}

/* The "Updated:" line above a policy: said once, and quietly — it is about the
   text rather than part of it. */
.prose .hint {
  color: #666;
  font-size: 0.9em;
}

/* The MCP address and the command that adds it: things to copy exactly. */
.prose pre {
  padding: 0.75em 1em;
  overflow-x: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* The demo on the page that connects an AI assistant. */
.prose .video {
  margin: 1.5em 0;
}

.prose .video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 6px;
}

.prose .video figcaption {
  color: #666;
  font-size: 0.9em;
  margin-top: 0.5em;
}

.prose code {
  font-size: 0.95em;
}

/* Allow and deny, on the page that connects an AI assistant. */
.decision {
  display: flex;
  gap: 1.5em;
  align-items: center;
  margin-top: 1.5em;
}

.prose h1,
.prose h2,
.landing h2 {
  font-family: 'Rokkitt', serif;
  margin-block-end: 0.3em;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: flex-start;
}

/* A column of cards inside .columns: it takes the share a card would, and
   its cards stack at their own height rather than stretching. */
.column {
  flex: 1 1 22em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  min-width: 0;
}

.column > .card {
  flex: none;
}

.card {
  flex: 1 1 22em;
  padding: 1em 1.5em;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card h1,
.card h2 {
  font-family: 'Rokkitt', serif;
  margin-block-start: 0.2em;
}

.empty {
  color: #666;
}

.projectlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.projectlist li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  padding: 0.35em 0;
  border-bottom: 1px solid #eee;
}

.projectlist .project-actions {
  display: flex;
  gap: 1em;
  flex-shrink: 0;
}

.projectlist .rename-project {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em 1em;
  width: 100%;
}

.projectlist .rename-project input {
  flex: 1 1 12em;
  width: auto;
  margin: 0;
}

.projectlist .rename-project .status {
  flex-basis: 100%;
  margin: 0;
}

/* Forms ------------------------------------------------------------------- */

label {
  display: block;
  font-size: 0.9em;
  color: #555;
}

input[type='text'],
input[type='email'] {
  display: block;
  width: 100%;
  max-width: 24em;
  padding: 0.5em;
  margin: 0.25em 0 0.75em;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

button,
a.button {
  font: inherit;
  padding: 0.4em 1em;
  border: none;
  border-radius: 6px;
  background: var(--color-dark);
  color: #fff;
  cursor: pointer;
}

button:hover,
a.button:hover {
  opacity: 0.9;
}

/* A link wearing a button: the data download is an <a> rather than a form,
   because what comes back is a file for the browser to save. */
a.button {
  display: inline-block;
  text-decoration: none;
}

button[disabled] {
  opacity: 0.5;
  cursor: progress;
}

button.linkish {
  background: none;
  color: var(--color-link);
  padding: 0;
  text-decoration: underline;
}

button.danger {
  background: var(--color-error);
}

button.linkish.danger {
  background: none;
  color: var(--color-error);
}

.status {
  margin: 0.5em 0 0;
  font-size: 0.9em;
}

.status-error {
  color: var(--color-error);
}

.status-ok {
  color: var(--color-ok);
}

/* Feedback ---------------------------------------------------------------- */

.feedback {
  margin-bottom: 1em;
  border: 2px solid var(--color-primary);
}

.assistant ul {
  padding-inline-start: 1.25em;
}

.assistant-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
}

.feedback ul {
  padding-inline-start: 1.25em;
}

.feedback li {
  margin: 0.3em 0;
}

.feedback textarea {
  display: block;
  width: 100%;
  padding: 0.5em;
  margin: 0.25em 0 0.75em;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}

.consent {
  margin: 0 0 0.75em;
}

.consent label {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-size: 1em;
  color: inherit;
  cursor: pointer;
}

/* The box sits on the first line of the label rather than at the top of the
   whole thing, which on a narrow screen is several lines tall. The offset is
   half the difference between that line and the box, so the two share a
   middle; both are in em, so a browser with larger text keeps the alignment.
   font-size is set because an input does not inherit one, and the em would
   otherwise be the browser's own smaller default. */
.consent input[type='checkbox'] {
  flex: none;
  font-size: inherit;
  width: 1em;
  height: 1em;
  margin: calc((1.6666em - 1em) / 2) 0 0;
}

.consent .hint {
  display: block;
  margin: 0.25em 0 0 1.6em;
  color: #666;
  font-size: 0.9em;
}

/* Import banner ----------------------------------------------------------- */

.banner {
  margin-bottom: 1em;
  padding: 0.75em 1.25em;
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  background: #fff;
}

.banner p {
  margin: 0.4em 0;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
}

/* Landing ----------------------------------------------------------------- */

/* The landing page runs edge to edge: its hero carries the black of the
   header bar on down, and the cards lie on it as on a table. */
.landing {
  margin: -1em -1em 0;
}

.landing-section h2 {
  margin: 0 0 0.4em;
  font-size: 2.2em;
  line-height: 1.1;
}

.landing .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 2em 3em;
  padding: 2.5em max(1.5em, calc((100% - 72em) / 2 + 1.5em)) 3.5em;
  background-color: var(--color-dark);
  color: #fff;
}

.landing .hero-title {
  max-width: 11em;
  margin: 0 0 0.35em;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
}

.landing .hero-lede {
  max-width: 30em;
  margin: 0;
  color: #c3d1d1;
  font-size: 1.1em;
}

.landing .hero .signin {
  margin: 1.75em 0 0;
  color: var(--color-dark);
}

.landing .hero .cta {
  margin: 1.5em 0 0;
}

/* A hand of cards. Each turns about a point well below the hand, so the five
   spread into an arc; they are dealt into it once, as the page opens. */
.landing .hand {
  margin: 0;
}

.landing .fan {
  --card-w: clamp(140px, 16vw, 230px);
  position: relative;
  height: calc(var(--card-w) * 1.72 + 1em);
}

.landing .fan-card {
  position: absolute;
  left: 50%;
  bottom: calc(var(--card-w) * 0.3 + 0.25em);
  width: var(--card-w);
  height: auto;
  margin-left: calc(var(--card-w) / -2);
  border-radius: 4.7% / 3.4%;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.07);
  transform-origin: 50% 190%;
  transform: rotate(var(--angle));
  animation: deal 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.landing .fan-card:nth-child(1) { --angle: -20deg; animation-delay: 0.05s; }
.landing .fan-card:nth-child(2) { --angle: -10deg; animation-delay: 0.1s; }
.landing .fan-card:nth-child(3) { --angle: 0deg; animation-delay: 0.15s; }
.landing .fan-card:nth-child(4) { --angle: 10deg; animation-delay: 0.2s; }
.landing .fan-card:nth-child(5) { --angle: 20deg; animation-delay: 0.25s; }

@keyframes deal {
  from {
    transform: translateY(1.5em) rotate(0deg);
  }
}

.landing .hand figcaption {
  color: #8d9c9c;
  font-size: 0.85em;
  text-align: center;
}

.landing .cta a {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: 8px;
  font-family: 'Rokkitt', serif;
  font-size: 1.6em;
  background-color: var(--color-primary);
  color: var(--color-dark);
  text-decoration: none;
}

.landing .cta a:hover {
  background-color: #fff;
}

.landing .cta a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.landing-section {
  max-width: 72em;
  margin: 0 auto;
  padding: 4em 1.5em 0;
}

.landing .section-lede {
  max-width: 36em;
  margin: 0 0 1.75em;
}

.landing .shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d5dcdc;
  border-radius: 10px;
  box-shadow: 0 24px 48px -28px rgba(11, 13, 15, 0.45);
}

/* The features are grouped by what you are doing when you need them; the
   teal rule over each group heading is what marks where a group begins. */
.landing .feature-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17em, 1fr));
  gap: 2em 3em;
  margin-top: 1.25em;
}

.landing .feature-group h3 {
  margin: 0 0 0.75em;
  padding-top: 0.5em;
  border-top: 4px solid var(--color-primary);
  font-family: 'Rokkitt', serif;
  font-size: 1.4em;
  line-height: 1.2;
}

.landing .feature-group dl {
  margin: 0;
}

.landing .feature-group dt {
  margin-top: 1em;
  font-weight: 700;
  line-height: 1.35;
}

.landing .feature-group dt:first-child {
  margin-top: 0;
}

.landing .feature-group dd {
  margin: 0.2em 0 0;
  color: #3b4246;
  font-size: 0.95em;
  line-height: 1.55;
}

.landing .printing {
  display: grid;
  grid-template-columns: minmax(0, 22em) minmax(0, 1fr);
  align-items: center;
  gap: 2em 4em;
  padding-bottom: 1em;
}

/* The page as it comes out of the printer, lying on the desk. */
.landing .sheet {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(11, 13, 15, 0.08), 0 24px 44px -20px rgba(11, 13, 15, 0.45);
  transform: rotate(-2deg);
}

.landing .printing-text {
  max-width: 34em;
}

.landing .printing h3 {
  margin: 1.1em 0 0.2em;
  font-family: 'Rokkitt', serif;
  font-size: 1.4em;
  line-height: 1.2;
}

.landing .printing p {
  margin: 0;
}

@media only screen and (max-width: 800px) {
  .landing .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 1.5em;
  }

  .landing .hand {
    order: -1;
  }

  .landing .fan {
    --card-w: min(30vw, 170px);
  }

  .landing .printing {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing .sheet {
    max-width: 18em;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing .fan-card {
    animation: none;
  }
}

.signin {
  max-width: 28em;
  margin: 0 auto 2em;
  padding: 1em 1.5em;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.signin h2 {
  margin-block-start: 0.2em;
}

/* Editor shell ------------------------------------------------------------ */

#editor {
  min-height: 60vh;
}

/* Footer ------------------------------------------------------------------ */

.sitefoot {
  margin-top: 2em;
  padding: 1em;
  text-align: center;
  font-size: 0.9em;
  color: #555;
}

.sitefoot p {
  margin: 0 0 0.35em;
}

.sitefoot p:last-child {
  margin-bottom: 0;
}

.sitefoot a {
  color: inherit;
}

/* The separators divide, they are not read, so they are faded rather than set
   in the same ink as the links they stand between. */
.sitefoot .sep {
  padding: 0 0.5em;
  opacity: 0.5;
}

@media only screen and (max-width: 600px) {
  .wordmark {
    font-size: 1.8em;
  }
}
