/* BoringBI shared design system.
   Values come from index.html, which is the visual reference. Page-specific styles stay in each page. */

:root {
  --bg: #fafafa;
  --white: #ffffff;
  --ink: #0a0a0a;
  --muted: #666666;
  --line: #dedede;
  --accent: #e8401c;
  --accent-dark: #bf3115;
  --mono: "JetBrains Mono", monospace;
  --sans: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* LAYOUT */

.container {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
}

.section {
  padding: 105px 0;
}

/* Diagonal line pattern from the homepage hero. The element needs position: relative and its content a higher stacking order. */
.bg-lines::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(30deg, transparent 49.8%, rgba(0,0,0,.045) 50%, transparent 50.2%) 0 0/90px 90px,
    linear-gradient(150deg, transparent 49.8%, rgba(0,0,0,.045) 50%, transparent 50.2%) 0 0/90px 90px;
  pointer-events: none;
}

/* TYPE */

.section-label {
  color: var(--accent);
  font: 600 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin: 0 0 23px;
}

.section-headline {
  font: 500 clamp(30px, 3.3vw, 45px)/1.22 var(--mono);
  letter-spacing: -2px;
  max-width: 850px;
  margin: 0;
}

.section-sub {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 610px;
  margin: 22px 0 0;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px 22px;
  min-height: 48px;
  font: 600 12px var(--mono);
  border: 1px solid var(--ink);
  transition: background .2s, color .2s, transform .2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: white;
}

/* PAGE HERO: homepage hero type, for pages without an illustration */

.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.page-hero-inner {
  position: relative;
  padding: 120px 0 110px;
}

.page-headline {
  font: 500 clamp(42px, 5vw, 76px)/1.14 var(--mono);
  letter-spacing: -4px;
  margin: 0;
}

.page-headline span {
  color: var(--accent);
}

.page-lead {
  font-size: 17px;
  line-height: 1.8;
  color: #555;
  max-width: 640px;
  margin: 30px 0 0;
}

/* CTA: same pattern as the end of the homepage */

.cta {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.cta::after {
  content: "BoringBI.";
  position: absolute;
  right: -20px;
  bottom: -75px;
  font: 700 clamp(120px, 20vw, 300px) var(--mono);
  letter-spacing: -20px;
  color: rgba(0,0,0,.035);
  pointer-events: none;
}

.cta-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 80px;
  align-items: center;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* NAVIGATION */

.site-header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,250,250,.96);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  width: min(1320px, calc(100% - 80px));
  height: 100%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.logo {
  font: 700 22px var(--mono);
  letter-spacing: -1.5px;
  white-space: nowrap;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 31px;
}

.nav-links > a,
.nav-links summary {
  font: 500 12px var(--mono);
  transition: color .2s;
}

.nav-links > a:hover,
.nav-links summary:hover {
  color: var(--accent);
}

.nav-links details {
  position: relative;
}

.nav-links summary {
  list-style: none;
  cursor: pointer;
}

.nav-links summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 25px);
  left: -18px;
  width: 285px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 16px 35px rgba(0,0,0,.08);
  padding: 10px;
  z-index: 101;
}

/* Invisible bridge across the gap, so moving the cursor down to the list does not count as leaving it */
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 26px;
}

.nav-dropdown a {
  display: block;
  padding: 11px;
  font: 500 11px/1.6 var(--mono);
}

.nav-dropdown a:hover {
  background: #f4f4f4;
  color: var(--accent);
}

.nav-cta {
  padding: 11px 17px;
  border: 1px solid var(--ink);
}

.nav-links a[aria-current] {
  color: var(--accent-dark);
}

/* An open menu sits above the cookie banner (z-index 140), so every link stays reachable */
.site-header:has(details[open]) {
  z-index: 150;
}

.mobile-menu-button {
  display: none;
  border: 1px solid var(--ink);
  background: white;
  padding: 9px 12px;
  font: 600 12px var(--mono);
}

/* Hamburger icon, used at 900px and below */
.menu-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 16px;
}

.menu-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform .25s ease, opacity .15s ease;
}

.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 7px; }
.menu-icon span:nth-child(3) { top: 14px; }

.mobile-menu-button[aria-expanded="true"] .menu-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-button[aria-expanded="true"] .menu-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button[aria-expanded="true"] .menu-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* While the panel is open the page behind it stays still and the header stays above the cookie banner */
html.menu-open {
  overflow: hidden;
}

html.menu-open body {
  overflow: clip;
}

html.menu-open .site-header {
  z-index: 150;
}

/* FOOTER */

.footer {
  background: #0a0a0a;
  color: white;
  padding: 75px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 75px;
}

.footer .logo {
  display: inline-block;
  margin-bottom: 20px;
}

.footer p {
  color: #999;
  font-size: 13px;
  line-height: 1.8;
}

.footer h3 {
  font: 600 11px var(--mono);
  margin: 0 0 22px;
}

.footer-links a {
  display: block;
  color: #aaa;
  font-size: 12px;
  margin-bottom: 13px;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 25px;
  border-top: 1px solid #333;
  color: #888;
  font: 10px var(--mono);
}

.footer-bottom a {
  margin-left: 18px;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .container {
    width: calc(100% - 40px);
  }

  .section {
    padding: 75px 0;
  }

  .nav-inner {
    width: calc(100% - 40px);
  }

  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--ink);
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
    padding: 8px 20px 32px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    visibility: hidden;
    transform: translateX(100%);
  }

  .nav-links.animate {
    transition: transform .28s ease, visibility 0s linear .28s;
  }

  .nav-links.open {
    visibility: visible;
    transform: none;
  }

  .nav-links.open.animate {
    transition: transform .28s ease, visibility 0s;
  }

  .nav-links > a,
  .nav-links summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 16px 0;
    font: 500 19px/1.3 var(--mono);
    letter-spacing: -.5px;
  }

  .nav-links > a,
  .nav-links details {
    flex: none;
    border-bottom: 1px solid var(--line);
  }

  .nav-links details {
    position: static;
  }

  .nav-chevron {
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    overflow: hidden;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    color: transparent;
    font-size: 0;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
  }

  .nav-links details[open] .nav-chevron {
    transform: translateY(2px) rotate(-135deg);
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    margin: 0;
    padding: 0 0 14px;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav-dropdown a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 0 10px 14px;
    border-left: 1px solid var(--line);
    font: 500 14px/1.45 var(--mono);
  }

  .nav-dropdown a:hover {
    background: none;
  }

  .nav-links > .nav-cta {
    justify-content: center;
    margin-top: 26px;
    padding: 16px 20px;
    border: 1px solid var(--ink);
    font-size: 15px;
    font-weight: 600;
  }

  /* A tap leaves :hover switched on, so touch screens skip the hover colours */
  @media (hover: none) {
    .nav-links > a:not([aria-current]):hover,
    .nav-links summary:hover,
    .nav-dropdown a:not([aria-current]):hover {
      color: var(--ink);
    }
  }

  .footer-links a {
    margin-bottom: 3px;
    padding-block: 6px;
  }

  .footer-bottom a {
    display: inline-block;
    padding-block: 6px;
  }

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

  .page-hero-inner {
    padding: 80px 0 70px;
  }

  .cta-layout {
    grid-template-columns: 1fr;
    gap: 35px;
  }
}

@media (max-width: 550px) {
  .section-headline {
    font-size: 29px;
    letter-spacing: -1.3px;
  }

  .page-headline {
    font-size: 40px;
    letter-spacing: -2px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .footer-bottom a {
    margin: 0 18px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
