/* ==========================================================================
   poly_rust website stylesheet

   The file is intentionally organized by page area so that small visual
   changes can be made without searching through compressed or inline CSS.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Theme
   -------------------------------------------------------------------------- */

:root {
  --color-text: #202124;
  --color-muted: #666a6e;

  --color-page: #fbfaf8;
  --color-white: #ffffff;
  --color-panel: #f1eee9;
  --color-border: #d9d4cd;

  --color-rust: #99451f;
  --color-rust-dark: #743317;

  --color-dark: #18191a;
  --color-slate: #3e535c;

  --sidebar-width: 245px;
  --topbar-height: 54px;

  --content-max-width: 1220px;

  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  --font-mono:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
}


/* --------------------------------------------------------------------------
   2. Base elements
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font: 16px/1.65 var(--font-sans);
}

a {
  color: var(--color-rust-dark);
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 10px;
  color: var(--color-rust-dark);
  font-size: 38px;
}


/* --------------------------------------------------------------------------
   3. Top navigation
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;

  display: flex;
  align-items: center;

  height: var(--topbar-height);

  background: #171819;
  color: #ffffff;
  box-shadow: 0 1px 7px #0006;
}

.topbar a {
  display: flex;
  align-items: center;

  height: var(--topbar-height);
  padding: 0 17px;

  color: #ffffff;
  text-decoration: none;
}

.topbar a:hover {
  background: var(--color-rust);
}

.brand {
  font-family: var(--font-mono);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.topbar-links {
  display: flex;
}

.menu-button {
  display: none;
  margin-left: auto;
  padding: 0 18px;

  border: 0;
  background: none;
  color: #ffffff;

  font-size: 24px;
}


/* --------------------------------------------------------------------------
   4. Side navigation
   -------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  z-index: 15;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;

  width: var(--sidebar-width);
  padding-top: 12px;

  overflow: auto;

  border-right: 1px solid var(--color-border);
  background: #efede8;
}

.sidebar-title {
  margin: 1em 0;
  padding: 0 22px;
  font-size: 19px;
}

.sidebar a {
  display: block;
  padding: 10px 22px 10px 18px;

  border-left: 4px solid transparent;

  color: #333333;
  text-decoration: none;

  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.sidebar a:hover {
  background: #dfdad3;
  color: var(--color-rust-dark);
}

.sidebar a.is-active {
  border-left-color: var(--color-rust);
  color: var(--color-rust-dark);
}

.sidebar-release {
  padding: 22px;
  color: var(--color-muted);
  font-size: 13px;
}

.sidebar-close {
  display: none;
}

.menu-overlay {
  display: none;

  position: fixed;
  z-index: 12;
  inset: var(--topbar-height) 0 0 0;

  background: #0008;
}


/* --------------------------------------------------------------------------
   5. Main page and hero
   -------------------------------------------------------------------------- */

.page {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
}

.hero {
  display: flex;
  align-items: center;

  min-height: 520px;

  color: #ffffff;
  background:
    linear-gradient(
      100deg,
      #161718f5 0%,
      #161718e8 46%,
      #16171844 75%,
      #16171810
    ),
    url("assets/voronoi_mesh.png") right center / min(55vw, 700px) auto no-repeat,
    var(--color-dark);
}

.hero-content {
  width: min(730px, 90%);
  padding: 72px 58px;
}

.eyebrow {
  margin: 0;

  color: #d8b29a;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 12px 0 20px;

  font:
    750 clamp(50px, 7vw, 86px) / 1
    var(--font-mono);

  letter-spacing: -0.075em;
}

.hero-intro {
  max-width: 690px;
  color: #ece9e5;
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

.button {
  display: inline-block;
  padding: 11px 17px;

  border-radius: 4px;

  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  background: var(--color-rust);
  color: #ffffff;
}

.button-primary:hover {
  background: #b15327;
}

.button-secondary {
  border: 1px solid #ffffff77;
  background: #ffffff08;
  color: #ffffff;
}

.button-secondary:hover {
  background: #ffffff18;
}


.hero-example-link {
  margin: 18px 0 0;
  color: #c9c5c0;
  font-size: 13px;
}

.hero-example-link a {
  color: #efb68f;
  font-weight: 700;
}


/* --------------------------------------------------------------------------
   6. Shared content layout
   -------------------------------------------------------------------------- */

.content {
  max-width: var(--content-max-width);
  margin: auto;
}

.section {
  padding: 70px 52px;
}

.section-white {
  background: var(--color-white);
}

.section-heading {
  max-width: 830px;
  margin-bottom: 36px;
}

.section-heading p {
  margin: 0;
  color: var(--color-muted);
  font-size: 18px;
}


/* --------------------------------------------------------------------------
   7. Overview cards
   -------------------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  min-height: 215px;
  padding: 23px;

  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-rust);

  background: var(--color-white);
}

.feature-symbol {
  display: inline-grid;
  place-items: center;

  min-width: 31px;
  height: 31px;
  padding: 0 5px;

  border: 1px solid #b9ada4;

  color: var(--color-rust-dark);
  font: 750 17px/1 var(--font-mono);
}

.feature-card h3 {
  margin: 14px 0 7px;
  font-size: 20px;
}

.feature-card p {
  margin: 0;
  color: var(--color-muted);
}


/* --------------------------------------------------------------------------
   8. DSL and solver workflow
   -------------------------------------------------------------------------- */

.code-panel {
  overflow: hidden;

  border-radius: 5px;

  background: #17191c;
  color: #e8e8e8;
  box-shadow: 0 8px 25px #0002;
}

.code-panel-title {
  padding: 10px 15px;

  border-bottom: 1px solid #373b40;

  background: #25282c;
  color: #bdc3c7;

  font-size: 13px;
}

.code-panel pre {
  margin: 0;
  padding: 20px;

  overflow: auto;

  font-size: 13px;
  line-height: 1.55;
}

.syntax-keyword {
  color: #efa777;
}

.syntax-name {
  color: #b8daee;
}

.syntax-comment {
  color: #839098;
}

.workflow-block {
  margin-top: 34px;
}

.workflow-block h3 {
  margin: 0 0 14px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;

  padding: 13px 15px;

  border-top: 3px solid var(--color-slate);
  background: var(--color-panel);
}

.workflow-number {
  display: grid;
  place-items: center;

  width: 31px;
  height: 31px;

  border-radius: 50%;
  background: var(--color-slate);
  color: #ffffff;

  font-weight: 750;
}

.workflow-step strong {
  display: block;
}

.workflow-step span:not(.workflow-number) {
  color: var(--color-muted);
  font-size: 14px;
}


/* --------------------------------------------------------------------------
   9. Numerical examples
   -------------------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.gallery figure {
  margin: 0;

  border: 1px solid var(--color-border);
  background: var(--color-white);
}


.gallery img {
  display: block;

  width: 100%;
  height: auto;

  background: var(--color-white);
}

.gallery figcaption {
  padding: 14px 16px;

  color: var(--color-muted);
  font-size: 14px;
}

.gallery figcaption strong {
  display: block;

  color: var(--color-text);
  font-size: 16px;
}


.configuration-links {
  display: block;
  margin-top: 10px;
  padding-top: 9px;

  border-top: 1px solid var(--color-border);

  color: var(--color-muted);
  font-size: 13px;
}

.configuration-links a {
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: none;
}

.configuration-links a:hover {
  text-decoration: underline;
}


.run-example,
.example-resources {
  margin-top: 28px;
  padding: 22px 24px;

  border: 1px solid var(--color-border);
  background: var(--color-white);
}

.run-example h3 {
  margin: 0 0 6px;
}

.run-example p {
  margin: 0 0 14px;
  color: var(--color-muted);
}

.run-example pre {
  margin: 0 0 12px;
  padding: 14px;

  overflow-x: auto;

  border-radius: 4px;
  background: #17191c;
  color: #eeeeee;

  font-size: 13px;
  line-height: 1.55;
}

.run-example pre code {
  font: inherit;
}

.example-resources h3 {
  margin: 0 0 6px;
}

.example-resources p {
  margin: 0 0 14px;
  color: var(--color-muted);
}

.resource-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.resource-groups strong {
  display: block;
  margin-bottom: 4px;
}

.resource-groups a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.resource-groups a:hover {
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
   10. Installation
   -------------------------------------------------------------------------- */

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  gap: 24px;

  min-width: 0;
}

.install-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 25px;

  border: 1px solid var(--color-border);
  background: var(--color-white);
}

.install-card-source {
  margin-top: 0;
}

.install-card h3 {
  margin-top: 0;
}

.install-card pre {
  display: block;
  max-width: 100%;
  padding: 14px;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  white-space: pre;

  border-radius: 4px;
  background: #17191c;
  color: #eeeeee;

  font-size: 13px;
  line-height: 1.55;
}

.install-card pre code {
  display: block;
  min-width: max-content;
  font: inherit;
}

/* Long paths and URLs in prose must wrap instead of widening the page. */
.install-card p code,
.install-card .small-note a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.download-button {
  display: inline-block;
  margin: 7px 0 11px;
  padding: 11px 15px;

  border-radius: 4px;

  background: var(--color-rust);
  color: #ffffff;

  font-weight: 700;
  text-decoration: none;
}

.download-button:hover {
  background: #b15327;
}

.small-note {
  color: var(--color-muted);
  font-size: 13px;
}

.pill {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 9px;

  border-radius: 30px;

  background: #eee6e0;
  color: var(--color-rust-dark);

  font-size: 12px;
  font-weight: 750;
}


/* --------------------------------------------------------------------------
   11. Paper
   -------------------------------------------------------------------------- */

.paper-card {
  padding: 29px;

  border-left: 5px solid var(--color-rust);

  background: #1d2023;
  color: #f3f3f3;
}

.paper-card h3 {
  margin: 0 0 8px;
  font-size: 25px;
}

.paper-card p {
  color: #ced2d4;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-placeholder {
  padding: 8px 11px;

  border: 1px dashed #777777;
  border-radius: 4px;

  color: #cccccc;
  font-size: 13px;
}


/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.footer {
  padding: 32px 52px;

  background: #151617;
  color: #c7c9ca;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 25px;

  max-width: var(--content-max-width);
  margin: auto;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.footer-logo-link {
  display: block;
  line-height: 0;
}

.footer-logo {
  display: block;
  width: auto;
  height: 48px;
}

.footer-brand {
  color: #ffffff;
}

.footer a {
  color: #eab28d;
}

.footer-person {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.footer-person:hover {
  color: #ffffff;
  text-decoration: underline;
}


/* --------------------------------------------------------------------------
   13. Responsive layout
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-groups {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (max-width: 992px) {
  .topbar-links {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .sidebar.is-open {
    display: block;
  }

  .sidebar-close {
    display: block;
    float: right;

    margin: 2px 12px 0 0;

    border: 0;
    background: none;

    font-size: 27px;
  }

  .menu-overlay.is-open {
    display: block;
  }

  .page {
    margin-left: 0;
  }

  .hero-content {
    padding: 66px 34px;
  }

  .section {
    padding: 58px 30px;
  }
}


@media (max-width: 700px) {
  h2 {
    font-size: 31px;
  }

  .feature-grid,
  .gallery,
  .install-grid,
  .workflow {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 510px;

    background-position: center bottom;
    background-size: 100vw auto;
  }

  .hero-content {
    width: 100%;
    padding: 62px 23px 190px;

    background:
      linear-gradient(
        180deg,
        #161718fa,
        #161718df 70%,
        #16171822
      );
  }

  .hero-intro {
    font-size: 18px;
  }

  .section {
    padding: 50px 22px;
  }

  .footer {
    padding: 30px 22px;
  }

  .footer-logos {
    width: 100%;
    justify-content: flex-end;
  }
}
