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

* {
  box-sizing: border-box;
}
html {
  min-width: 20rem;
}

a {
  color: var(--link);
  -webkit-tap-highlight-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: max(1px, 0.0625rem);
  text-underline-offset: 0.08em;
}

a,
iframe,
textarea,
button {
  scroll-margin-block: 1rem;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 0.1875rem;
  -webkit-text-decoration-skip-ink: none;
  text-decoration-skip-ink: none;
  -webkit-text-decoration-skip: none;
  text-decoration-skip: none;
}

a:active {
  color: var(--link-active);
}

a:focus {
  outline: 3px solid transparent;
  color: var(--focus-ink);
  background: var(--focus);
  box-shadow: 0 -2px var(--focus), 0 4px var(--focus-ink);
  text-decoration: none;
}

.nav-link:visited:not(:hover, :active, :focus) {
  color: var(--link);
}

.parent-directory {
  position: relative;
  min-height: 24px;
  margin: 1rem 0 0;
}

.parent-directory .nav-link::before {
  position: absolute;
  right: 0;
  bottom: 0;
  width: max(24px, 100%);
  height: 24px;
  content: "";
}

.page-footer {
  display: grid;
  width: max-content;
  grid-template-columns: var(--title-column-width) var(--date-column-width);
  align-items: end;
}

.page-footer > .parent-directory {
  min-width: 0;
}

#current-date {
  white-space: pre;
}

.current-date-visible {
  position: relative;
  display: inline-block;
}

.current-weekday {
  position: absolute;
  right: 100%;
  width: max-content;
  text-align: right;
}

.visually-hidden,
.table-head {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (forced-colors: active) {
  a:focus,
  iframe:focus,
  textarea:focus,
  .command-output:focus {
    outline-color: Highlight;
  }
}

@media (max-width: 38rem) {
  :root {
    --mobile-browser-bottom-offset: 0px;
    --mobile-bottom-margin:
      max(
        16px,
        calc(
          env(safe-area-inset-bottom, 0px)
          + var(--mobile-browser-bottom-offset)
        )
      );
  }

  :root.instagram-in-app {
    --mobile-browser-bottom-offset: 16px;
  }

  html {
    overflow: hidden;
  }

  .page-footer {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) var(--date-column-width);
  }

  #current-date {
    text-align: right;
  }
}

:root {
  color-scheme: only light;
  --paper: #FAFAFA;
  --feedback: #f7f7f7;
  --ink: #0b0c0c;
  --secondary-ink: #484949;
  --link: #003078;
  --link-hover: #0f385c;
  --link-visited: #54319f;
  --link-active: #0b0c0c;
  --focus: #ffdd00;
  --focus-ink: var(--ink);
  --title-column-width: 18rem;
  --date-column-width: 8.5rem;
  --desktop-bottom-margin: 4rem;
}

html {
  background: var(--paper);
}

body {
  min-height: 100svh;
  margin: 0;
  padding: 8px 8px calc(var(--desktop-bottom-margin) + 24px);
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.5 "Tinos", "Times New Roman", Times, serif;
}

.page-footer {
  position: fixed;
  bottom: var(--desktop-bottom-margin);
  left: 8px;
}

.page-footer .nav-link:not(:hover, :focus) {
  text-decoration-thickness: auto;
}

.app-shell {
  width: 100%;
}

.app-scroll {
  display: grid;
  gap: 0.625rem;
}

.url-count {
  color: var(--secondary-ink);
  font-variant-numeric: tabular-nums;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.split-view section {
  min-width: 0;
}

textarea,
.command-output {
  width: 100%;
  height: 20rem;
  min-width: 0;
  margin: 0;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.3125rem;
  color: inherit;
  background: var(--paper);
  font: inherit;
  text-align: left;
  transition: background-color 100ms ease-out;
}

textarea {
  resize: none;
  appearance: none;
}

textarea::placeholder,
.command-output code:empty::before {
  color: var(--secondary-ink);
  opacity: 1;
}

.command-output code:empty::before {
  content: "generated yt-dlp command will appear here";
}

textarea:focus,
.command-output:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.command-output {
  display: flex;
  align-items: flex-start;
  appearance: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  cursor: pointer;
}

.command-output:disabled {
  opacity: 1;
  cursor: default;
}

.command-output code {
  width: 100%;
  font: inherit;
}

.feedback {
  background: var(--feedback);
  transition: none;
}

.command-hint {
  min-height: 1.5em;
  margin: 0;
  color: var(--secondary-ink);
}

.command-hint:empty {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  textarea,
  .command-output {
    transition: none;
  }
}

@media (max-width: 59rem) {
  textarea,
  .command-output {
    height: 16rem;
  }
}

@media (min-width: 38.0625rem) {
  .app-shell {
    width: calc((100vw - 1rem) / 2);
  }
}

@media (max-width: 38rem) {
  body {
    height: calc(100vh - 16px - var(--mobile-bottom-margin));
    height: calc(100svh - 16px - var(--mobile-bottom-margin));
    min-height: 0;
    margin: 16px 16px var(--mobile-bottom-margin);
    overflow: hidden;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1.55;
  }

  .app-shell {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
  }

  .app-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .page-footer {
    position: static;
    flex: 0 0 auto;
  }

  textarea,
  .command-output {
    padding: 0.625rem;
  }
}
