/* Foreman's public front page. Tokens, faces and the square geometry are the desktop's
   (docs/desktop-design-system.md); the page follows the system's light or dark setting. */

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/ibm-plex-sans.woff2") format("woff2");
}
@font-face {
  font-family: Manrope;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/manrope.woff2") format("woff2");
}

:root {
  --bg: hsl(38 12% 95%);
  --panel: hsl(38 15% 98%);
  --ink: hsl(30 5% 12%);
  --muted: hsl(30 5% 40%);
  --line: hsl(30 5% 80%);
  --accent: hsl(16 82% 42%);
  --accent-hover: hsl(16 78% 36%);
  --on-accent: #fff;
  --soft: hsl(38 9% 91%);
  --band: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(30 5% 5%);
    --panel: hsl(30 5% 10%);
    --ink: hsl(38 9% 87%);
    --muted: hsl(38 9% 64%);
    --line: rgba(255, 255, 255, 0.14);
    --accent: hsl(16 72% 56%);
    --accent-hover: hsl(16 72% 64%);
    --on-accent: hsl(16 40% 8%);
    --soft: hsl(30 5% 13%);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "IBM Plex Sans", system-ui, sans-serif;
}

/* The sheet is the box's front, with its orange side along the right edge. */
.sheet {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset calc(-1 * var(--band)) 0 0 var(--accent);
  padding: 40px calc(40px + var(--band)) 32px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 650 17px/1 Manrope, system-ui, sans-serif;
  letter-spacing: -0.2px;
}

/* The moving box leaves room around itself to rock; the negative margin lines its front up
   with the text below. */
.brand img {
  display: block;
  margin-left: -10px;
}

h1 {
  margin: 40px 0 12px;
  font: 650 clamp(30px, 6vw, 42px) / 1.1 Manrope, system-ui, sans-serif;
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
}

.lead {
  margin: 0 0 32px;
  max-width: 34em;
  color: var(--muted);
  font-size: 17px;
}

h2 {
  margin: 0 0 6px;
  font: 650 18px/1.3 Manrope, system-ui, sans-serif;
  letter-spacing: -0.2px;
}

/* The desktop's settings row: what it is on the left, what to do on the right. */
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

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

.actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 15rem;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  transition:
    background 120ms var(--ease),
    border-color 120ms var(--ease);
}

.button:hover {
  background: var(--soft);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

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

footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  :root {
    --band: 8px;
  }

  body {
    padding: 16px;
    place-items: start stretch;
  }

  .sheet {
    padding: 24px calc(20px + var(--band)) 20px 20px;
  }

  h1 {
    margin-top: 32px;
  }

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

  .actions {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
