/* A little internet utility, in the same neighborhood as aren.dev. */
:root {
  color-scheme: dark;
  --night: #080824;
  --paper: #dedeea;
  --ink: #211c39;
  --muted: #5c566c;
  --violet: #302566;
  --cyan: #8cffff;
  --yellow: #ffff9a;
  --mono: "Courier New", Courier, monospace;
  --serif: "Times New Roman", Times, serif;
  --sans: Arial, Helvetica, sans-serif;
  font: 100%/1.5 var(--serif);
  background: var(--night);
  color: #e8e8ff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--night) url('/assets/stars.svg') repeat; }
button, input, select { font: inherit; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:visited { color: #e5b5ff; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid #efbd00; outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { color: #181438; background: #b5ffff; }
.skip-link { position: absolute; left: -10000px; top: 8px; z-index: 1; padding: 10px; background: #ffff99; color: #11112c; }
.skip-link:focus { left: 8px; }
.site-shell { width: min(100% - 32px, 930px); margin: 25px auto 30px; }

.topbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; padding: 5px 3px; border-block: 1px solid #57577d; font: .875rem/1.6 var(--mono); color: #c0b7d9; }
.topbar > a { font-weight: bold; }
.path-separator { color: #807698; }
.top-note { margin-left: auto; font-size: .75rem; }
.masthead { padding: 28px 12px 25px; text-align: center; }
h1 { margin: 0 0 9px; font: bold clamp(2.25rem, 5vw, 3.5rem)/1.1 var(--serif); letter-spacing: -1.5px; color: var(--cyan); text-shadow: 2px 3px 0 #48418d; }
h1 em { color: var(--yellow); }
.masthead p { margin: 0; color: #c9bee6; font-size: 1rem; font-style: italic; }
.spectrum-rule { height: 3px; background: linear-gradient(90deg, #85ffff, #94a6ff 30%, #da9ae7 58%, #ffff9a); }
main { display: grid; grid-template-columns: minmax(0, 1fr) 218px; grid-template-rows: min-content auto; align-items: start; gap: 15px; padding-top: 19px; }

.workspace { min-width: 0; grid-column: 1; grid-row: 1; border: 2px solid; border-color: #f4f3ff #716a86 #716a86 #f4f3ff; padding: 3px; background: #bfbccd; color: var(--ink); box-shadow: 5px 5px 0 #0005; color-scheme: light; }
.workspace :focus-visible { outline-color: #554180; }
.window-title { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 9px; background: linear-gradient(90deg, #242266, #53417c); color: #fff; }
.window-title h2 { margin: 0; font: bold .875rem/1.5 var(--sans); }
.window-icon { color: #a5ffff; font: bold 1.25rem/1 var(--mono); }
.window-domain { margin-left: auto; color: #e0d6f2; font: .75rem/1.5 var(--mono); }
.window-body { padding: 19px 22px 23px; background: var(--paper); border: 1px solid; border-color: #f5f4fb #8d869d #8d869d #f5f4fb; }
.intro { margin: 0 0 22px; font-size: 1rem; color: #39304e; }
.field-label { display: block; margin: 0 0 9px; font-size: 1rem; font-weight: bold; color: #30275b; }
.step { margin-right: 4px; color: #69577e; font: bold .8125rem/1.5 var(--mono); }
.url-field { display: flex; gap: 8px; min-width: 0; }
input[type="url"] { width: 100%; min-width: 0; padding: 10px 11px; background: #fff; color: #241b3c; border: 2px solid; border-color: #777185 #fbfaff #fbfaff #777185; border-radius: 0; font: 1rem/1.5 var(--sans); box-shadow: inset 1px 1px 0 #c1bdce; }
input[type="url"]::placeholder { color: #777081; }
input[type="url"]:focus-visible { outline-color: #6253a0; outline-offset: 1px; }
.paste, .text-button { border: 2px solid; border-color: #fff #7d748f #7d748f #fff; border-radius: 0; background: #c9c5d7; color: #272042; font: bold .875rem/1.4 var(--sans); box-shadow: 1px 1px 0 #9f96b1; }
.paste { padding: 9px 14px; }
.paste:hover, .text-button:hover { background: #e9e5f1; }
.paste:active, .text-button:active { border-color: #7d748f #fff #fff #7d748f; box-shadow: none; }
.hint { margin: 8px 0 0; color: var(--muted); font: .8125rem/1.6 var(--sans); }
.options { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin: 23px 0 25px; }
fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
legend { padding: 0; }
.segmented { display: flex; gap: 5px; }
.segmented label { position: relative; display: flex; flex: 1; min-width: 0; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 5px; width: 100%; min-height: 45px; padding: 6px 8px; border: 2px solid; border-color: #fff #8b839b #8b839b #fff; background: #c9c5d7; color: #40374f; font: .875rem/1.4 var(--sans); }
.segmented small { font-size: .75rem; white-space: nowrap; }
.segmented label:hover span { background: #eae6f1; }
.segmented input:checked + span { background: #eceaf6; border-color: #655b80 #fff #fff #655b80; box-shadow: inset 0 -3px #726396; color: #26204d; font-weight: bold; }
.segmented input:focus-visible + span { outline: 3px solid #7a5a00; outline-offset: 2px; }
select { width: 100%; min-height: 45px; padding: 8px; background: #f7f6fc; color: #29203f; border: 2px solid; border-color: #777185 #fff #fff #777185; border-radius: 0; font: .875rem/1.5 var(--sans); }
select:disabled { background: #cac5d4; color: #6c6579; cursor: not-allowed; }
button:disabled { cursor: wait; opacity: .65; }
.primary, .primary:visited { display: flex; align-items: center; justify-content: center; gap: 13px; width: 100%; min-height: 49px; padding: 10px 16px; border: 2px solid; border-color: #edebff #312951 #312951 #edebff; border-radius: 0; background: #3c326e; color: #ffffb3; font: bold 1rem/1.5 var(--sans); text-decoration: none; box-shadow: 1px 1px 0 #6d6385; }
.primary:hover { background: #514183; color: #fffed7; }
.primary:active { border-color: #312951 #edebff #edebff #312951; box-shadow: none; }
.primary > span:last-child { font: bold 1.5rem/1 var(--mono); }
.status-bar { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; color: #484056; font: .75rem/1.5 var(--sans); }
.status-bar > span { flex: 1 1 auto; padding: 3px 7px; border: 1px solid; border-color: #8d849e #ede9f4 #ede9f4 #8d849e; white-space: nowrap; }

.sources { min-width: 0; grid-column: 2; grid-row: 1 / span 2; border: 1px solid #645a84; background: #17132d; }
.sources h2 { margin: 0; padding: 9px 12px; border-bottom: 1px solid #645a84; background: #292044; color: #eee4ff; font: bold .8125rem/1.5 var(--mono); letter-spacing: .25px; }
.source-list { margin: 0; padding: 5px 12px 0; list-style: none; }
.source-list li { padding: 7px 0; border-bottom: 1px dotted #4b405f; }
.source-list li:last-child { border-bottom: 0; }
.source-list span { display: block; color: #d6f7ff; font-size: 1rem; line-height: 1.2; }
.source-list small { display: block; margin-top: 2px; color: #b5a5c9; font: .75rem/1.3 var(--mono); }
.more-sources { margin: 8px 12px 0; padding-top: 9px; border-top: 1px solid #534668; color: #dfd2ef; font-size: .875rem; line-height: 1.7; }
.more-sources a { font-size: .875rem; }
.source-note { margin: 11px 12px 13px; color: #bbaacd; font-size: .8125rem; font-style: italic; line-height: 1.45; }

.notice { margin-top: 21px; padding: 11px 13px; border: 1px solid #9b7438; background: #fff4cc; color: #653710; font: .875rem/1.65 var(--sans); overflow-wrap: anywhere; }
.job { margin-top: 24px; padding-top: 20px; border-top: 2px groove #fbfaff; }
.job-top { display: flex; align-items: flex-start; gap: 12px; }
.file-icon { display: grid; place-items: center; flex-shrink: 0; width: 35px; height: 43px; border: 1px solid #827495; background: #f2eff8; color: #554079; box-shadow: 2px 2px #bcb2ca; font: bold 1.5rem/1 var(--mono); }
.job-info { flex: 1; min-width: 0; }
.eyebrow { color: #69577e; font: bold .75rem/1.4 var(--mono); letter-spacing: .4px; }
.job h2 { margin: 4px 0; color: #302454; font-size: 1.125rem; line-height: 1.4; overflow-wrap: anywhere; }
.job-info p { margin: 3px 0 0; color: var(--muted); font: .8125rem/1.5 var(--sans); }
.text-button { min-height: 35px; padding: 5px 9px; }
.progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 7px; font: .8125rem/1.5 var(--sans); color: #514460; }
#job-percent { flex-shrink: 0; font-family: var(--mono); }
progress { display: block; appearance: none; width: 100%; height: 17px; border: 2px solid; border-color: #8e849b #fff #fff #8e849b; border-radius: 0; background: #c8c2d3; accent-color: #514080; }
progress::-webkit-progress-bar { background: #c8c2d3; }
progress::-webkit-progress-value { background: repeating-linear-gradient(90deg, #514080 0 10px, #c8c2d3 10px 13px); }
progress::-moz-progress-bar { background: repeating-linear-gradient(90deg, #514080 0 10px, #c8c2d3 10px 13px); }
progress:not([value]) { background: repeating-linear-gradient(90deg, #aaa0c0 0 10px, #d7d1e1 10px 13px); }
.save { margin-top: 17px; }

.help-window { grid-column: 1; grid-row: 2; min-width: 0; margin-top: -1px; border: 1px solid #72618e; color: #dfd4f0; background: #1c1734; }
.help-window summary { padding: 10px 13px; cursor: pointer; color: #ffffb3; font-size: 1rem; }
.help-window summary::marker { color: #c19be2; }
.help-window summary span { margin-left: 10px; color: #c0adcf; font: .75rem/1.5 var(--mono); }
.help-window[open] summary { border-bottom: 1px solid #5b496e; }
.help-body { padding: 14px 16px 16px; }
.help-body p { margin: 0 0 12px; font-size: 1rem; line-height: 1.6; }
.help-body p:last-child { margin-bottom: 0; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 23px; padding: 13px 3px 0; border-top: 1px solid #575077; color: #beb0d2; font-size: .875rem; }
footer > span { font-style: italic; }

@media (max-width: 740px) {
  .site-shell { width: min(100% - 24px, 600px); margin-top: 16px; }
  .top-note { display: none; }
  .masthead { padding: 26px 5px 22px; }
  h1 { font-size: clamp(2rem, 7vw, 2.875rem); letter-spacing: -1px; }
  main { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 16px; padding-top: 16px; }
  .workspace { grid-row: 1; }
  .help-window { grid-row: 2; }
  .sources { grid-column: 1; grid-row: 3; }
  .source-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; padding-top: 7px; padding-bottom: 5px; }
  .source-list li:nth-last-child(-n + 3) { border-bottom: 0; }
  .more-sources br { display: none; }
  .more-sources a { margin-left: 7px; }
  .source-note { margin-top: 6px; }
  .window-body { padding: 17px 18px 20px; }
  footer { justify-content: center; text-align: center; }
  footer > span { display: none; }
}

@media (max-width: 420px) {
  .site-shell { width: calc(100% - 18px); }
  h1 { max-width: 100%; font-size: 2.3rem; }
  h1 em { display: block; }
  .masthead p { max-width: 270px; margin: 10px auto 0; }
  .window-body { padding: 16px 13px 18px; }
  .window-domain { display: none; }
  .options { grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 20px 0; }
  .segmented span { min-height: 44px; }
  .paste { padding-inline: 12px; }
  .source-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-list li:nth-last-child(3) { border-bottom: 1px dotted #4b405f; }
  .help-window summary span { display: block; margin-left: 15px; margin-top: 2px; }
  .job-top { gap: 9px; flex-wrap: wrap; }
  .text-button { margin-left: auto; }
}

@media (forced-colors: active) {
  .segmented input:checked + span { outline: 2px solid Highlight; }
  .primary, .paste, .text-button, select, input[type="url"] { border: 2px solid ButtonText; }
  progress { forced-color-adjust: auto; }
}

@media print {
  body { background: white; color: black; }
  .site-shell { width: 100%; margin: 0; }
  h1, h1 em, .masthead p { color: black; text-shadow: none; }
  .sources, footer, .spectrum-rule { display: none; }
  main { display: block; }
  .workspace, .window-title, .window-body { background: white; color: black; box-shadow: none; }
}
