/* Landing page of req-lang.org. Palette and fonts come from theme.css (the req brand). */

.landing {
  --ln-ink: var(--pst-color-text-base);
  --ln-muted: var(--pst-color-text-muted);
  --ln-rule: var(--pst-color-border);
  --ln-link: var(--pst-color-primary);

  /* The stage is the one loud element: the brand blue, with the brand colors
     reserved for what the checker says (green: clean, yellow/orange: issues). */
  --stage-bg: #1C0DB1;
  --stage-ink: #F4F2FF;
  --stage-dim: #ADA6F5;
  --stage-rule: rgba(244, 242, 255, 0.18);
  --stage-add: rgba(0, 255, 131, 0.13);

  width: 100%;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ln-ink);
}

html[data-theme="dark"] .landing {
  --stage-bg: #140B78;
  --stage-rule: rgba(244, 242, 255, 0.14);
}

.landing a {
  color: var(--ln-link);
}

.landing :not(pre)>code {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.88em;
  color: inherit;
  background: color-mix(in srgb, var(--pst-color-primary) 8%, transparent);
  border: 0;
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

.ln-wrap {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Hero -------------------------------------------------------------- */

.ln-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.landing h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ln-ink);
}

.ln-lead {
  margin: 1.4rem 0 0;
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.55;
}

.ln-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

.ln-btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border: 2px solid var(--pst-color-primary);
  border-radius: 0.4rem;
  font-weight: 500;
  text-decoration: none;
}

.ln-btn:hover {
  background: color-mix(in srgb, var(--pst-color-primary) 10%, transparent);
  text-decoration: none;
}

.ln-btn-primary {
  background: var(--pst-color-primary);
  color: #fff;
}

html[data-theme="dark"] .ln-btn-primary {
  color: #0b0b2e;
}

.landing .ln-btn-primary:hover {
  background: var(--pst-color-primary);
  filter: brightness(1.12);
  color: #fff;
}

html[data-theme="dark"] .landing .ln-btn-primary:hover {
  color: #0b0b2e;
}

html[data-theme="light"] .landing .ln-btn-primary {
  color: #fff;
}

.ln-install {
  display: flex;
  align-items: stretch;
  max-width: 34rem;
  margin: 2rem 0 0;
  border: 1px solid var(--ln-rule);
  border-radius: 0.4rem;
  background: var(--pst-color-surface);
}

.landing .ln-install code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  background: none;
  border-radius: 0;
}

.ln-copy {
  flex: none;
  padding: 0 1rem;
  border: 0;
  border-left: 1px solid var(--ln-rule);
  background: none;
  color: var(--ln-link);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.ln-copy:hover {
  background: color-mix(in srgb, var(--pst-color-primary) 10%, transparent);
}

.ln-note {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--ln-muted);
}

/* ---- Stage: the same requirement in three steps ------------------------ */

.stage {
  min-width: 0;
  border-radius: 0.6rem;
  background: var(--stage-bg);
  color: var(--stage-ink);
  overflow: hidden;
}

.stage-tabs {
  display: flex;
  border-bottom: 1px solid var(--stage-rule);
}

.stage-tabs button {
  flex: 1 1 0;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--stage-dim);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.stage-tabs button:hover {
  color: var(--stage-ink);
}

.stage-tabs button[aria-selected="true"] {
  color: var(--stage-ink);
  border-bottom-color: #FFC012;
}

.stage button:focus-visible,
.stage pre:focus-visible,
.ln-copy:focus-visible {
  outline: 3px solid #00FF83;
  outline-offset: -3px;
}

.stage-panel {
  padding-bottom: 0.25rem;
}

.js .stage-panel[hidden] {
  display: none;
}

.stage-caption {
  margin: 0;
  padding: 1rem 1.25rem 0;
  color: var(--stage-dim);
  font-size: 0.95rem;
  min-height: 4.1em;
}

.stage-code {
  margin: 0;
  padding: 0.75rem 0;
  overflow-x: auto;
  background: none;
  border: 0;
  color: var(--stage-ink);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.65;
}

.stage-code code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.stage-code .ln {
  display: block;
  min-height: 1.65em;
  padding: 0 1.25rem;
  white-space: pre;
}

.stage-code .ln.add {
  background: var(--stage-add);
  box-shadow: inset 3px 0 0 #00FF83;
}

/* Token colors on the stage */
.lc .k {
  color: #FFC012;
  font-weight: 500;
}

/* keywords */
.lc .nc {
  color: #fff;
  font-weight: 600;
}

/* package / part names */
.lc .nf {
  color: #fff;
  font-weight: 600;
}

/* requirement names */
.lc .na {
  color: #C8C3FF;
}

/* attributes */
.lc .nv {
  color: #C8C3FF;
}

/* identifiers in expressions */
.lc .cm {
  color: var(--stage-ink);
  font-style: italic;
}

/* informal text */
.lc .cm+.p+.nv,
.lc .p+.nv {
  color: #00FF83;
}

/* [[references]] inside informal text */
.lc .s {
  color: var(--stage-dim);
}

/* tags */
.lc .si {
  color: #FF9A55;
}

/* units */
.lc .mi,
.lc .mf {
  color: #FF9A55;
}

/* numbers */
.lc .o,
.lc .ow {
  color: #FFC012;
}

/* operators */
.lc .p {
  color: var(--stage-dim);
}

.stage-report {
  margin: 0.25rem 1.25rem 1rem;
  padding: 0.9rem 1rem 0.9rem 1.1rem;
  border-left: 4px solid #00FF83;
  border-radius: 0 0.3rem 0.3rem 0;
  background: rgba(0, 0, 0, 0.22);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}

.stage-report[data-state="light"] {
  border-left-color: #FFC012;
}

.stage-report[data-state="moderate"] {
  border-left-color: #FFC012;
}

.stage-report[data-state="severe"] {
  border-left-color: #FF6912;
}

.stage-report[data-state="critical"] {
  border-left-color: #FF6912;
}

.stage-report p {
  margin: 0;
}

.stage-cmd {
  color: var(--stage-dim);
}

.chk-issues {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.chk-issue {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  column-gap: 0.5rem;
  padding: 0.15rem 0;
}

.chk-loc {
  color: var(--stage-dim);
}

.chk-msg {
  color: var(--stage-ink);
  font-weight: 500;
}

.chk-code {
  color: var(--stage-dim);
  font-weight: 400;
}

.chk-where {
  grid-column: 2;
  color: var(--stage-dim);
}

.chk-where code {
  background: none;
  color: inherit;
  padding: 0;
}

.chk-sum {
  margin-top: 0.6rem;
  color: var(--stage-dim);
}

.chk-sum strong {
  color: #00FF83;
  font-weight: 600;
}

.stage-report[data-state="light"] .chk-sum strong,
.stage-report[data-state="moderate"] .chk-sum strong {
  color: #FFC012;
}

.stage-report[data-state="severe"] .chk-sum strong,
.stage-report[data-state="critical"] .chk-sum strong {
  color: #FF9A55;
}

/* The report answers the person's choice of step: it settles in, once. */
@media (prefers-reduced-motion: no-preference) {
  .js .stage-panel.is-entering .stage-report {
    animation: report-in 0.35s ease-out;
  }

  @keyframes report-in {
    from {
      opacity: 0;
      transform: translateY(0.4rem);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}

.stage-foot {
  margin: 0;
  padding: 0 1.25rem 1rem;
  color: var(--stage-dim);
  font-size: 0.8rem;
}

.stage-foot code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ---- Sections ---------------------------------------------------------- */

.ln-section>.ln-wrap {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.ln-section>.ln-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  border-top: 1px solid var(--ln-rule);
}

.ln-section h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  border: 0;
}

.ln-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.ln-prose {
  max-width: 34rem;
}

.ln-prose p {
  margin: 0 0 1rem;
}

/* The line right under a section title reads as a subtitle. */
.ln-prose h2+p {
  font-style: italic;
  color: var(--ln-muted);
}

/* Authoring gap */
.gap {
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.gap-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.gap-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ln-rule);
  border-radius: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gap-box b {
  font-weight: 600;
}

.gap-box span,
.gap-box code {
  color: var(--ln-muted);
  background: none;
  border: 0;
  padding: 0;
}

.gap-link {
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.72rem;
  color: var(--ln-muted);
  border-left: 2px dashed var(--ln-rule);
  padding: 0.5rem 0.25rem;
}

.gap-one {
  grid-template-columns: 1fr;
}

.gap-one .gap-box {
  border: 2px solid var(--pst-color-primary);
  background: color-mix(in srgb, var(--pst-color-primary) 7%, transparent);
}

.gap-one .gap-box span {
  color: var(--ln-ink);
}

/* Four ideas */
.ideas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  margin: 0 0 1rem;
}

.landing .ideas dt {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.landing .ideas dd {
  margin: 0;
  padding: 0;
  max-width: 32rem;
  color: var(--ln-ink);
}

.ln-diag {
  display: block;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #FF6912;
  background: var(--pst-color-surface);
}

/* Rows: learn, tools */
.ln-rows,
.ln-files {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ln-rows li,
.ln-files li {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--ln-rule);
}

.ln-rows li:last-child,
.ln-files li:last-child {
  border-bottom: 1px solid var(--ln-rule);
}

.ln-rows li>a {
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.ln-rows li>a:hover {
  text-decoration: underline;
}

.ln-rows li>span,
.ln-files li>span {
  color: var(--ln-ink);
  max-width: 40rem;
}

.ln-files li {
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  padding: 0.75rem 0;
}

.ln-files code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.9rem;
}

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 62rem) {

  .ln-hero,
  .ln-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .ln-prose,
  .ln-lead {
    max-width: none;
  }
}

@media (max-width: 40rem) {
  .ideas {
    grid-template-columns: minmax(0, 1fr);
  }

  .ln-rows li,
  .ln-files li {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .gap-link {
    writing-mode: horizontal-tb;
    transform: none;
    border-left: 0;
    border-top: 2px dashed var(--ln-rule);
    padding: 0.25rem 0.5rem;
    justify-self: start;
  }

  .stage-caption {
    min-height: 0;
  }
}

/* ---- Inside documentation pages ---------------------------------------- */

.md-link {
  font-size: 0.85rem;
  color: var(--pst-color-text-muted);
}
