/* dr.jinmugo.com. The colors are dr's own, from internal/tui/theme.go: the page stays
   quiet and color carries meaning only, as on dr's screen. */

@font-face {
  font-family: "Martian Mono";
  src: url("fonts/MartianMono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --page: #fbfbfc;
  --panel: #f3f4f7;
  --surface: #f0f2f5;
  --line: #d9dee5;
  --line2: #bfc6d1;
  --fg: #2b323d;
  --strong: #0e1117;
  --muted: #5b6574;
  --subtle: #8a93a0;
  --accent: #2c6ad8;
  --ask: #7550dc;
  --pending: #a86f05;
  --fix: #0d927e;
  --add: #1d8641;
  --addbg: #eef9f1;
  --hunkbg: #eef3fb;
  --hunkfg: #5470a0;
  --s1: #b9632c;
  --s2: #14858d;
  --s3: #b6427a;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1015;
    --panel: #11151b;
    --surface: #161b23;
    --line: #262d39;
    --line2: #3a4354;
    --fg: #c9d1dc;
    --strong: #f1f4f8;
    --muted: #8a93a3;
    --subtle: #5f6979;
    --accent: #6fb3ff;
    --ask: #b49cff;
    --pending: #f0b95b;
    --fix: #4fd6be;
    --add: #5cc777;
    --addbg: #0f1d16;
    --hunkbg: #101824;
    --hunkfg: #7890b6;
    --s1: #e7a274;
    --s2: #5fc6d0;
    --s3: #ea8cb3;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: 48px;
  background: var(--page);
  color: var(--fg);
  font: 400 15px/1.7 var(--mono);
  font-stretch: 87.5%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

code,
kbd {
  font-family: var(--mono);
  font-stretch: 87.5%;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--strong);
  font-size: 0.82em;
  line-height: 1.55;
  text-align: center;
}

p code {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  color: var(--strong);
}

/* The status line, as dr draws it: a mode pill, where you are, and what is around. */
.status {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 36px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(10px);
  font-size: 12px;
}

.pill {
  padding: 1px 10px;
  border-radius: 3px;
  background: var(--strong);
  color: var(--page);
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: background-color 0.2s;
}

.pill.yanked {
  background: var(--fix);
}

.path {
  color: var(--strong);
}

.status-right {
  margin-left: auto;
  color: var(--muted);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 60px 0 32px;
}

.logo img {
  display: block;
  width: 88px;
  height: 88px;
}

h1 {
  max-width: 14ch;
  margin: 6px 0 0;
  color: var(--strong);
  font-size: clamp(1.75rem, 5.2vw, 3.9rem);
  font-weight: 760;
  font-stretch: 100%;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

/* The install line. Its left edge is dr's rail, the color of the line's session. */
.get {
  max-width: 660px;
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs [role="tab"] {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.tabs [role="tab"] kbd {
  margin-right: 6px;
  font-size: 11px;
}

.tabs [role="tab"][aria-selected="true"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--strong);
}

.cmd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: var(--surface);
}

.cmd::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
}

.cmd[hidden] {
  display: none;
}

.cmd code {
  flex: 1;
  overflow-x: auto;
  color: var(--strong);
  font-size: 14px;
  white-space: nowrap;
  scrollbar-width: none;
}

.prompt {
  color: var(--subtle);
  user-select: none;
}

.copy {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--line2);
  color: var(--strong);
}

.copy.done {
  border-color: var(--fix);
  color: var(--fix);
}

.links {
  display: flex;
  gap: 22px;
  margin: 2px 0 0;
  font-size: 14px;
}

.links a::after {
  content: " →";
}

/* The demo is a dark terminal in both themes, so its frame is too. */
.term {
  margin: 20px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d1015;
  box-shadow: 0 32px 80px -44px rgb(0 0 0 / 0.5);
}

.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #262d39;
  background: #11151b;
  color: #8a93a3;
  font-size: 12px;
}

.term img {
  display: block;
  width: 100%;
  height: auto;
}

.chips {
  display: flex;
  gap: 14px;
}

.chip::before {
  content: "●";
  margin-right: 6px;
}

.chip.s1::before {
  color: #e7a274;
}

.chip.s2::before {
  color: #5fc6d0;
}

.chip.s3::before {
  color: #ea8cb3;
}

/* Why dr, drawn as a hunk of added lines. Each rail means what it means in dr:
   a session's color, a question, a comment that became a fix, three sessions, and
   the dotted rail of a line no session explains. */
.why {
  margin: 100px 0 0;
}

.hunk {
  margin: 0;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--hunkbg);
  color: var(--hunkfg);
  font-size: 13px;
  font-weight: 500;
}

.rows {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 4px 3ch 2ch minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
  padding: 18px 20px 18px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background: var(--addbg);
}

.row:first-child {
  border-top: none;
}

.row::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  margin: -18px 0;
  background: var(--rail, var(--line2));
}

.num {
  padding-top: 1px;
  color: var(--add);
  font-size: 13px;
  text-align: right;
  opacity: 0.75;
}

.sign {
  color: var(--add);
  font-weight: 700;
}

.row p {
  max-width: 66ch;
  margin: 0;
}

.row b {
  color: var(--strong);
  font-weight: 700;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.label.ask {
  color: var(--ask);
}

.label.fix {
  color: var(--fix);
}

.label.unknown {
  color: var(--subtle);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.s1 {
  background: var(--s1);
}

.dot.s2 {
  background: var(--s2);
}

.dot.s3 {
  background: var(--s3);
}

.r-session {
  --rail: var(--s1);
}

.r-ask {
  --rail: var(--ask);
}

.r-fix {
  --rail: linear-gradient(var(--pending) 0 50%, var(--fix) 50% 100%);
}

.r-three {
  --rail: linear-gradient(var(--s1) 0 33.4%, var(--s2) 33.4% 66.7%, var(--s3) 66.7%);
}

.r-unknown {
  --rail: repeating-linear-gradient(var(--subtle) 0 3px, transparent 3px 7px);
}

.install {
  margin: 100px 0 0;
  scroll-margin-top: 60px;
}

.install:focus {
  outline: none;
}

.install h2 {
  margin: 0 0 20px;
  color: var(--strong);
  font-size: 1.6rem;
  font-weight: 760;
  font-stretch: 100%;
  letter-spacing: -0.03em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Cards, like dr's: a band on the left that lights up for the one in focus. */
.card {
  position: relative;
  padding: 18px 20px 18px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--line2);
  transition: background-color 0.2s;
}

.card:hover::before,
.card:focus-within::before {
  background: var(--accent);
}

.card h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card .cmd {
  padding: 10px 10px 10px 14px;
  border-radius: 8px;
}

.card .cmd::before {
  display: none;
}

.card .cmd code {
  font-size: 13px;
}

.card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.needs {
  max-width: 82ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 120px auto 0;
  padding: 26px 24px 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.foot p {
  display: flex;
  gap: 20px;
  margin: 0;
}

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

/* The key row, as dr's last row lists the keys of the mode you are in. */
.keys {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  gap: 24px;
  padding: 9px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 12px;
}

.keys kbd {
  margin-right: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero > :nth-child(4) {
    animation-delay: 0.18s;
  }

  .hero > :nth-child(5) {
    animation-delay: 0.24s;
  }

  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 0.5s ease,
      transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }

  .reveal.in {
    opacity: 1;
    transform: none;
  }

  .row.reveal::before {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms + 0.1s);
  }

  .row.reveal.in::before {
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .hero {
    padding-top: 48px;
  }

  .status-right,
  .keys,
  .label {
    display: none;
  }

  .row {
    grid-template-columns: 4px 2ch 1.5ch minmax(0, 1fr);
    column-gap: 10px;
  }

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

  .foot p {
    flex-wrap: wrap;
  }

  .tabs [role="tab"] kbd {
    display: none;
  }
}
