/* dhat's public pages (docs/plans/site-look.md): the hosted site's home page
   and dat pages, and the share server's pages. Scott, 2026-10-02: "It
   should look pretty much like dhat is working on YouTube ... light mode".
   So these are YouTube's own shapes and colours, the ones the panel wears
   beside the player (youtube.css): a white page, Roboto, a 56px header
   with the search box in the middle, a row of chips, pictures and boxes
   with 12px corners, black for text, #606060 for the rest.
   Roboto (SIL Open Font License) is kept with the pages: they ask no other
   site for anything but YouTube's player and pictures. */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("roboto-var.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --text: #0f0f0f;
  --text-2: #606060;
  --line: rgba(0, 0, 0, 0.1);
  --chip: rgba(0, 0, 0, 0.05);
  --chip-hover: rgba(0, 0, 0, 0.1);
  --box: #f2f2f2;
  --blue: #065fd4;
  --head-height: 56px;
  --font: Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------- header */

/* YouTube's masthead: the name at the left, the search box in the middle, the one button at the right */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr minmax(0, 640px) 1fr;
  align-items: center;
  gap: 16px;
  height: var(--head-height);
  padding: 0 24px 0 16px;
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.mark {
  width: 26px;
  height: 26px;
}

.brand-name {
  font: 600 20px/1 var(--font);
  letter-spacing: -0.03em;
}

.search {
  display: flex;
  min-width: 0;
  height: 40px;
  margin: 0;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 16px;
  border: 1px solid #ccc;
  border-right: 0;
  border-radius: 40px 0 0 40px;
  background: #fff;
  color: var(--text);
  font: 400 16px/22px var(--font);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.search-input::placeholder {
  color: #888;
}

.search-input:focus {
  border-color: #1c62b9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px #1c62b9;
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 40px;
  padding: 0;
  border: 1px solid #d3d3d3;
  border-radius: 0 40px 40px 0;
  background: #f8f8f8;
  color: var(--text);
  cursor: pointer;
}

.search-go:hover {
  background: #f0f0f0;
}

.search-go svg {
  width: 22px;
  height: 22px;
}

/* The one black pill, as YouTube's Subscribe and the panel's Try again */
.get-dhat {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--text);
  color: #fff;
  font: 500 14px/36px var(--font);
  white-space: nowrap;
}

.get-dhat:hover,
.get-dhat:focus-visible {
  background: #272727;
  text-decoration: none;
}

/* --------------------------------------------------------- the chips */

/* YouTube's row of topics under its header, and sticky with it */
.chips {
  position: sticky;
  top: var(--head-height);
  z-index: 19;
  display: flex;
  gap: 12px;
  padding: 8px 24px 12px;
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text);
  font: 500 14px/32px var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  background: var(--chip-hover);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  color: #fff;
}

/* ---------------------------------------------------------- home page */

.home {
  max-width: 2160px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.home.narrow {
  max-width: 640px;
  padding-top: 48px;
}

.home.narrow h1 {
  margin-bottom: 8px;
  font: 600 24px/32px var(--font);
}

.home.narrow p {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 24px;
}

/* One line on what dhat is, in YouTube's grey box; a reader may close it */
.about {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 24px;
  padding: 14px 48px 14px 16px;
  border-radius: 12px;
  background: var(--box);
  font-size: 14px;
  line-height: 20px;
}

.about strong {
  font-weight: 500;
}

.about-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  font: 400 24px/32px var(--font);
  cursor: pointer;
}

.about-close:hover {
  background: var(--chip-hover);
  color: var(--text);
}

/* The dats, as YouTube's home page lays out videos: 4 across on a wide screen, 40px between rows */
.dat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 40px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dat-card {
  display: block;
  color: inherit;
}

.dat-card:hover {
  text-decoration: none;
}

.dat-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #e5e5e5;
}

.dat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dat-length {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font: 500 12px/12px var(--font);
  letter-spacing: 0.02em;
}

.dat-text {
  display: block;
  padding: 12px 0 0;
}

.dat-title {
  display: -webkit-box;
  margin: 0 0 4px;
  overflow: hidden;
  font: 500 16px/22px var(--font);
  color: var(--text);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-overflow: ellipsis;
}

.dat-meta {
  display: block;
  color: var(--text-2);
  font: 400 14px/20px var(--font);
}

.dat-gist {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text-2);
  font: 400 13px/18px var(--font);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.dat-empty,
.dat-none {
  padding: 64px 0;
  text-align: center;
  color: var(--text-2);
  font-size: 16px;
}

/* Get dhat: one quiet box at the end, inside a hairline */
.get {
  max-width: 720px;
  margin: 64px auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.get h2 {
  margin-bottom: 8px;
  font: 600 20px/28px var(--font);
}

.get p {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 22px;
}

.get p:last-child {
  margin-bottom: 0;
}

.get strong {
  font-weight: 500;
}

.site-foot {
  max-width: 2160px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  line-height: 20px;
}

.site-foot p {
  margin: 0 0 4px;
}

.site-foot a {
  color: var(--text-2);
}

/* ------------------------------------------------ one dat's page */

/* YouTube's watch page: the player and its title at the left, a 402px column at the right */
.dhat-page {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1754px;
  margin: 0 auto;
  padding: 24px;
}

.dhat-watch {
  flex: 1 1 auto;
  min-width: 0;
}

.dhat-side {
  flex: 0 0 402px;
  min-width: 0;
}

/* The video's picture, a link to it on YouTube: the site plays no video (job C, 2026-10-05) */
.dhat-player {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.dhat-player img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dhat-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.dhat-play svg {
  width: 68px;
  height: 48px;
  opacity: 0.85;
}

.dhat-player:hover .dhat-play svg,
.dhat-player:focus-visible .dhat-play svg {
  opacity: 1;
}

.dhat-title {
  margin: 12px 0 8px;
  font: 600 20px/28px var(--font);
}

/* Under the title: the channel and the date at the left, Watch on YouTube at the right */
.dhat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 12px;
}

.dhat-meta {
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
}

.dhat-meta strong {
  color: var(--text);
  font-weight: 500;
}

.dhat-youtube {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 12px;
  border-radius: 18px;
  background: var(--chip);
  color: var(--text);
  font: 500 14px/36px var(--font);
  white-space: nowrap;
}

.dhat-youtube:hover {
  background: var(--chip-hover);
  text-decoration: none;
}

/* YouTube's description box */
.dhat-about {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--box);
  font-size: 14px;
  line-height: 20px;
}

.dhat-about p {
  margin: 0 0 8px;
}

.dhat-about p:last-child {
  margin: 0;
}

.dhat-about strong {
  font-weight: 500;
}

.dhat-get {
  font-weight: 500;
}

/* The panel, exactly as beside YouTube's player (youtube.css); its lists scroll inside it */
.dhat-side #youtube-index-panel {
  margin: 0 0 24px;
}

/* More dats under the panel, as YouTube lists more videos: a small picture and three lines */
.dat-more-head {
  margin: 0 0 12px;
  font: 500 16px/22px var(--font);
}

.dat-row {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
  color: inherit;
}

.dat-row:hover {
  text-decoration: none;
}

.dat-row-thumb {
  position: relative;
  flex: none;
  width: 168px;
  height: 94px;
  overflow: hidden;
  border-radius: 8px;
  background: #e5e5e5;
}

.dat-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dat-row-thumb .dat-length {
  right: 4px;
  bottom: 4px;
}

.dat-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 8px;
}

.dat-row-title {
  display: -webkit-box;
  margin: 0 0 4px;
  overflow: hidden;
  font: 500 14px/20px var(--font);
  color: var(--text);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.dat-row-meta {
  color: var(--text-2);
  font: 400 12px/18px var(--font);
}

/* The share server's other pages: what dhat is, a share that is not here, payments */
.dhat-home {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 24px;
  font-size: 16px;
  line-height: 24px;
}

.dhat-home h1 {
  margin-bottom: 12px;
  font: 600 28px/36px var(--font);
}

.dhat-home h2 {
  margin: 24px 0 8px;
  font: 600 20px/28px var(--font);
}

.dhat-home p,
.dhat-home ul {
  margin: 0 0 12px;
}

.dhat-home strong {
  font-weight: 500;
}

/* A narrow window: one column; the player full width, the panel under it, as YouTube on a phone */
@media (max-width: 1000px) {
  .dhat-page {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0 0 16px;
  }

  .dhat-player {
    border-radius: 0;
  }

  .dhat-title,
  .dhat-row,
  .dhat-about {
    margin-left: 16px;
    margin-right: 16px;
  }

  .dhat-side {
    flex: none;
    margin: 0 16px;
  }
}

@media (max-width: 760px) {
  .site-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 0 16px;
  }

  .brand-name {
    display: none;
  }

  .search-go {
    width: 48px;
  }

  .get-dhat {
    padding: 0 12px;
  }

  .chips {
    padding: 8px 16px 12px;
  }

  .home {
    padding: 8px 16px 32px;
  }

  .dat-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .get {
    margin-top: 40px;
    padding: 20px;
  }
}

/* ------------------------------------- the header's right end: Get dhat */

.site-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
  min-width: 0;
}

/* The privacy and terms pages (docs/plans/queue-end-to-end.md, 6) */
.legal h2 {
  margin: 24px 0 8px;
  font: 600 18px/26px var(--font);
}

.legal ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 24px;
}

/* The privacy page's first lines, in Scott's words: bigger, no bullets. */
.legal .privacy-lead {
  margin: 16px 0 24px;
  padding-left: 0;
  list-style: none;
}

.legal .privacy-lead li {
  margin-bottom: 4px;
  font: 500 20px/28px var(--font);
}

/* The Update dhat page (src/http/update-page.ts; round 4, job U): numbered
   steps, the download as the black pill */
.legal ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.legal ol li {
  padding-left: 4px;
}

.legal.update .dhat-lead {
  font-size: 18px;
  line-height: 26px;
}

.update .update-download {
  display: inline-block;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--text);
  color: #fff;
  font: 500 14px/36px var(--font);
}

.update .update-download:hover,
.update .update-download:focus-visible {
  background: #272727;
  text-decoration: none;
}

.update code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--box);
  font: 13px/20px ui-monospace, Menlo, Consolas, monospace;
}
