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

body {
  font-family: var(--mono);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em 1em;
  background-color: var(--base2);
  color: var(--base00);
}

.term {
  width: 100%;
  max-width: 44em;
  background-color: var(--base3);
  border-radius: 0.75em;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 2.5em;
  display: flex;
  flex-direction: column;
  gap: 1.4em;
}

.path {
  font-size: 0.85em;
  color: var(--base1);
}

.path #host {
  color: var(--yellow);
}

.line {
  font-size: 0.95em;
}

.prompt {
  color: var(--green);
  font-weight: 600;
  user-select: none;
}

.input-line {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  cursor: text;
}

/* The input's width tracks its content (set in script.js) so the block cursor
   can sit immediately after the last character, the way a real terminal does. */
.field {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

#cmd {
  font: inherit;
  color: var(--base00);
  background: none;
  border: none;
  padding: 0;
  outline: none;
  width: 1ch;
  max-width: 100%;
  caret-color: transparent;
}

.cursor {
  flex-shrink: 0;
  width: 0.6em;
  height: 1.1em;
  align-self: center;
  background-color: var(--base00);
  animation: blink 0.7s step-end infinite;
}

/* A steady cursor while typing reads as "focused"; it resumes blinking on idle. */
.input-line.typing .cursor {
  animation: none;
}

#history .line {
  margin-bottom: 0.3em;
}

.out {
  font-size: 0.95em;
  color: var(--magenta);
  margin-bottom: 0.9em;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.talks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2em;
}

.talks a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.2em;
  text-decoration: none;
  color: inherit;
  padding: 0.35em 0.5em;
  margin: -0.35em -0.5em;
  border-radius: 0.25em;
  transition: background-color 0.15s;
}

.talks a:hover {
  background-color: var(--base2);
}

.talks time {
  color: var(--violet);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.talks .title {
  color: var(--base01);
  font-weight: 600;
}

.talks a:hover .title {
  color: var(--blue);
  text-decoration: underline;
}

.fmt {
  font-size: 0.85em;
  white-space: nowrap;
  user-select: none;
}

.fmt-slides { color: var(--cyan); }
.fmt-pdf    { color: var(--orange); }

/* Hang the metadata under the title, clear of the date column. The date is
   always YYYY-MM, so its width is a stable 7ch plus the grid gap. */
.meta {
  padding-left: calc(7ch + 1.2em);
  margin-top: 0.35em;
}

.subtitle {
  font-size: 0.9em;
  color: var(--base01);
}

.venue {
  font-size: 0.8em;
  color: var(--base1);
  margin-top: 0.15em;
}

.abstract {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--base00);
  max-width: 62ch;
  margin-top: 0.7em;
}

.back {
  align-self: flex-start;
  font-size: 0.85em;
  color: var(--base1);
  text-decoration: none;
  transition: color 0.2s;
}

.back:hover {
  color: var(--magenta);
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
    padding: 1.5em 0.75em;
  }

  .term {
    padding: 1.75em 1.25em;
  }

  /* Date and format badge share a row above the title, which gets the full width.
     The title spans both columns, so column 2 must absorb the slack (1fr) —
     otherwise it inflates the date column and strands the badge mid-row. */
  .talks a {
    grid-template-columns: auto 1fr;
    gap: 0.4em 1em;
  }

  .talks .fmt {
    justify-self: start;
  }

  .talks .title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  /* No date column to clear once the title wraps to its own row. */
  .meta {
    padding-left: 0;
  }
}
