/* consult.n3el.dev */

:root {
  color-scheme: dark light;
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #000000;
  --fg: #ffffff;
  --fg-2: rgba(255, 255, 255, 0.72);
  --fg-3: rgba(255, 255, 255, 0.56);
  --line: rgba(255, 255, 255, 0.12);
  --line-faint: rgba(255, 255, 255, 0.07);
  --panel: rgba(255, 255, 255, 0.035);
  --code-bg: rgba(255, 255, 255, 0.06);
  --ring: #7fc3ff;

  /* One hue per speaker. Color only ever says who is talking. */
  --claude: #f2a36e;
  --codex: #7fc3ff;
  --grok: #c4b5fd;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --fg-2: rgba(0, 0, 0, 0.72);
    --fg-3: rgba(0, 0, 0, 0.58);
    --line: rgba(0, 0, 0, 0.13);
    --line-faint: rgba(0, 0, 0, 0.07);
    --panel: rgba(0, 0, 0, 0.025);
    --code-bg: rgba(0, 0, 0, 0.05);
    --ring: #0b6bb8;
    --claude: #b1521b;
    --codex: #0b6bb8;
    --grok: #6242d6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: var(--fg-3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

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

p code,
dd code,
td code,
.notes code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* Nav */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
}

.brand-mark .mark-a {
  fill: var(--claude);
}

.brand-mark .mark-b {
  fill: var(--codex);
  mix-blend-mode: screen;
}

@media (prefers-color-scheme: light) {
  .brand-mark .mark-b {
    mix-blend-mode: multiply;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 15px;
}

.nav-links a {
  color: var(--fg-2);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
  padding-top: clamp(40px, 8vw, 104px);
  padding-bottom: clamp(64px, 9vw, 128px);
}

.hero-copy {
  padding-top: 8px;
}

h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.lede {
  margin-top: 28px;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--fg-2);
}

.who {
  font-weight: 500;
}

.who-claude {
  color: var(--claude);
}

.who-codex {
  color: var(--codex);
}

.who-grok {
  color: var(--grok);
}

.command {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  max-width: 100%;
}

.command code {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.command code::-webkit-scrollbar {
  display: none;
}

.prompt {
  color: var(--fg-3);
  user-select: none;
  margin-right: 0.5ch;
}

.copy {
  flex: none;
  font: 500 13px/1 var(--font-sans);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  min-width: 64px;
}

.copy:hover {
  background: var(--code-bg);
}

.copy[data-state="copied"] {
  color: var(--codex);
  border-color: currentColor;
}

.fineprint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--fg-3);
}

.fineprint a {
  color: var(--fg-2);
}

/* The consult thread */

.thread {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

.thread-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-faint);
  font-size: 13px;
  color: var(--fg-3);
}

.thread-head .mono {
  color: var(--fg-2);
}

.turns {
  list-style: none;
  margin: 0;
  padding: 8px 0 12px;
}

.turn {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  line-height: 1.55;
}

.speaker {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 23px;
  padding-top: 1px;
  font-weight: 500;
}

.turn-claude .speaker {
  color: var(--claude);
}

.turn-codex .speaker,
.turn-progress .speaker {
  color: var(--codex);
}

/* The advisor's reply sits on a rule in its own color, like a quoted consult note. */
.turn-codex .body {
  border-left: 2px solid var(--codex);
  padding-left: 16px;
  margin-left: -2px;
}

.body p + p {
  margin-top: 10px;
}

.body .mono {
  font-size: 0.88em;
}

.call {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--code-bg);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--fg-2);
}

.fn {
  color: var(--fg);
  font-weight: 500;
}

.str {
  color: var(--codex);
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--codex);
  flex: none;
}

.meta {
  margin-top: 14px !important;
  color: var(--fg-3);
  font-size: 12px !important;
  overflow-wrap: anywhere;
}

/* One orchestrated moment: the consult plays out once on load. */
@media (prefers-reduced-motion: no-preference) {
  .turn {
    opacity: 0;
    animation: turn-in 520ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }

  .turn:nth-child(1) { animation-delay: 250ms; }
  .turn:nth-child(2) { animation-delay: 1250ms; }
  .turn:nth-child(3) { animation-delay: 3100ms; }
  .turn:nth-child(4) { animation-delay: 4100ms; }

  .pulse {
    animation: pulse 1s ease-in-out 1250ms 2, settle 300ms ease 3100ms forwards;
  }

  .turn-codex .body {
    border-left-color: transparent;
    animation: rule-in 700ms ease 3300ms forwards;
  }
}

@keyframes turn-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

@keyframes settle {
  to {
    background: var(--fg-3);
  }
}

@keyframes rule-in {
  to {
    border-left-color: var(--codex);
  }
}

/* Sections */

.section {
  padding-top: clamp(56px, 7vw, 96px);
  padding-bottom: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line-faint);
}

.section-head {
  max-width: 40em;
}

h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
}

.section-head p {
  margin-top: 16px;
  color: var(--fg-2);
}

.aside {
  margin-top: 28px;
  max-width: 40em;
  color: var(--fg-3);
  font-size: 15px;
}

/* Tools */

.tools {
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px 48px;
  padding: 22px 0;
  border-top: 1px solid var(--line-faint);
}

.tool:last-child {
  border-bottom: 1px solid var(--line-faint);
}

.tool dt code {
  font-size: 14px;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}

.tool dd {
  margin: 0;
  color: var(--fg-2);
  font-size: 16px;
}

/* When to ask */

.moments {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 44em;
}

.moments li {
  position: relative;
  padding-left: 26px;
  color: var(--fg-2);
}

.moments li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-3);
}

.moments strong {
  color: var(--fg);
  font-weight: 500;
}

/* Containment */

.table-scroll {
  margin-top: 36px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.flags {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.flags th,
.flags td {
  text-align: left;
  vertical-align: top;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-faint);
}

.flags tr:last-child th,
.flags tr:last-child td {
  border-bottom: 0;
}

.flags thead th {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  background: var(--panel);
}

.flags tbody th {
  font-family: var(--font-mono);
  font-size: 14px;
  width: 110px;
}

.flags td {
  color: var(--fg-2);
}

/* Install */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 44em;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font: 500 13px/1 var(--font-mono);
  color: var(--fg-2);
}

.steps .command {
  margin-top: 14px;
}

.said {
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--claude);
  color: var(--fg);
}

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 48px;
  margin-top: 56px;
  max-width: 52em;
}

h3 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.notes p {
  margin-top: 6px;
  color: var(--fg-2);
  font-size: 15px;
}

/* CLI */

.shell {
  margin: 36px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
  line-height: 1.8;
  overflow-x: auto;
}

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-top: 32px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line-faint);
  font-size: 14px;
  color: var(--fg-3);
}

/* Wide screens: heading on the left, content on the right. */
@media (min-width: 921px) {
  .section {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(40px, 6vw, 88px);
    align-items: start;
  }

  .section > * {
    grid-column: 2;
  }

  .section > .section-head {
    grid-column: 1;
    grid-row: 1 / span 6;
    position: sticky;
    top: 32px;
  }

  .section > .section-head + * {
    margin-top: 6px;
  }

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

  .tools .tool:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .tools .tool:last-child {
    border-bottom: 0;
  }
}

/* Responsive */

@media (max-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .nav-links a:not(.nav-gh) {
    display: none;
  }

  .turn {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 12px 16px;
  }

  .turn-codex .body {
    margin-left: 0;
    padding-left: 14px;
  }

  .thread-head {
    padding: 12px 16px;
  }

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

  .flags th,
  .flags td {
    padding: 14px 14px;
  }

  .flags tbody th {
    width: 76px;
  }

  .command {
    flex-wrap: wrap;
    padding: 12px 12px 12px 14px;
    gap: 10px;
  }

  .command code {
    flex-basis: 100%;
  }

  .command .copy {
    width: 100%;
  }

  .command code {
    font-size: clamp(11.5px, 3.3vw, 13.5px);
  }

  .command .prompt {
    display: none;
  }

  .call {
    padding: 12px;
    font-size: clamp(10.5px, 3vw, 12.5px);
  }

  .copy {
    min-width: 58px;
    padding: 8px 10px;
  }
}
