/* The tokens, header, and type scale of generalforecast.com (the dark sheet), with a light
   variant of the same palette for light-mode systems. */

@font-face {
  font-family: "Neue Montreal";
  src: url("/fonts/NeueMontreal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101113;
  --ink: #eceef0;
  --quiet: #9aa0a6;
  --line: rgba(255, 255, 255, 0.11);
  --edge: clamp(1.25rem, 3vw, 3.25rem);
  --type: clamp(0.92rem, min(0.58rem + 0.86vw, 2.45vh), 1.45rem);
  --text: clamp(0.9rem, 0.72rem + 0.45vw, 1.2rem);
  --gap-claim: clamp(1.5rem, 6.5vh, 3.75rem);
  --measure: 44rem;
  --card: #17181b;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --ink: #101113;
    --quiet: #5f6368;
    --line: rgba(0, 0, 0, 0.11);
    --card: #f6f6f7;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Neue Montreal", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.quiet {
  color: var(--quiet);
}

.sheet {
  min-height: 100svh;
  padding: var(--edge);
}

/* Header: the mark on the left, quiet links on the right, the current page in ink. */

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: var(--type);
  line-height: 1.32;
}

.mark {
  letter-spacing: -0.015em;
}

.nav {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 2.2vw, 2rem);
  letter-spacing: -0.01em;
}

.nav a,
.nav button,
.nav span {
  color: var(--quiet);
  transition: color 0.14s ease;
}

.nav a:hover,
.nav button:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

/* Content: one centered column. */

main {
  max-width: var(--measure);
  margin: var(--gap-claim) auto 0;
  font-size: var(--text);
  line-height: 1.45;
}

#search.empty {
  margin-top: 22vh;
}

h1 {
  margin: 0 0 0.35em;
  font-size: inherit;
  font-weight: 400;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

#signin {
  margin-left: 0;
}

#gsi {
  min-height: 44px;
  margin: 1em 0;
}

/* Google's button is an iframe; under a dark color-scheme the browser paints it an opaque white
   backdrop unless the frame keeps the normal scheme. */
#gsi iframe {
  color-scheme: normal;
}

/* Layers: the question and lists of documents sit on cards; the agent's steps and answer sit on
   the sheet between them. */

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.composer {
  padding: 0.75em 1em;
}

.composer:focus-within {
  border-color: var(--quiet);
}

textarea {
  display: block;
  width: 100%;
  max-height: 40vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1em;
  line-height: 1.45;
  letter-spacing: -0.01em;
  resize: none;
  outline: none;
}

textarea:focus-visible {
  outline: none;
}

textarea::placeholder {
  color: var(--quiet);
}

.turn {
  margin-bottom: 2.2em;
}

.question {
  padding: 0.75em 1em;
  font-size: 1.1em;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.work {
  margin: 1.4em 1em 0;
  color: var(--quiet);
}

.work summary {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

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

.work summary:hover {
  color: var(--ink);
}

.chevron {
  width: 0.85em;
  height: 0.85em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-90deg);
  transition: transform 0.14s ease;
}

.work[open] .chevron {
  transform: none;
}

.steps {
  margin: 0.6em 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  margin: 0 0 0.35em;
  color: var(--ink);
}

.steps .quiet {
  overflow-wrap: anywhere;
}

.result > * {
  margin-top: 1.1em;
}

.answer {
  padding: 0 1em;
  font-size: 1.05em;
}

.answer p,
.answer ul,
.answer ol {
  margin: 0 0 0.7em;
}

.answer ul,
.answer ol {
  padding-left: 1.2em;
}

.answer a,
.docs a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  text-decoration-color: var(--quiet);
}

.answer a:hover,
.docs a:hover {
  text-decoration-color: var(--ink);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

.list {
  padding: 0 1em;
}

.list h2 {
  margin: 1.2em 0 0.4em;
  font-size: 0.85em;
  font-weight: 400;
  color: var(--quiet);
}

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

.docs li {
  margin-bottom: 1.1em;
}

.docs .meta {
  font-size: 0.8em;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.docs .meta span + span {
  margin-left: 0.8em;
}

.docs .title {
  font-size: 1.05em;
  overflow-wrap: anywhere;
}

.docs .snippet {
  font-size: 0.9em;
  color: var(--quiet);
  overflow-wrap: anywhere;
}

.connections {
  width: 100%;
  margin-top: 1.5em;
  border-collapse: collapse;
}

.connections td {
  padding: 0.7em 0;
  border-top: 1px solid var(--line);
}

.connections td:last-child {
  text-align: right;
}

.connections a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

#who {
  margin-top: 1.5em;
}

@media (max-width: 34rem) {
  :root {
    --type: clamp(0.95rem, 3.9vw, 1.15rem);
    --gap-claim: clamp(1.25rem, 4.5vh, 2rem);
  }
  .head {
    display: block;
  }
  .nav {
    flex-wrap: wrap;
    margin-top: 0.75rem;
    gap: 0.5rem 1.4rem;
  }
  #search.empty {
    margin-top: 12vh;
  }
}
